Compare commits

...

2 Commits

Author SHA1 Message Date
OusmBlueNinja
611bc36ad6 Merge branch 'main' of https://dock-it.dev/Bit-By-Byte/Tesseract-Engine
Some checks failed
Build And Release / build_release (push) Failing after 1m44s
2025-01-03 20:45:38 -06:00
OusmBlueNinja
1bd5f34e21 linux build scripts 2025-01-03 20:45:31 -06:00
2 changed files with 100 additions and 48 deletions

122
Makefile
View File

@ -1,27 +1,82 @@
# Makefile
# Compiler and Flags
# ------------------------------------------------------------------------------
# Compiler and Base Flags
# ------------------------------------------------------------------------------
CXX := g++
CXXFLAGS := -Wall -Wextra -std=c++17 -g -DDEBUG -DTIMERS
# ------------------------------------------------------------------------------
# Detect Platform
# ------------------------------------------------------------------------------
ifeq ($(OS),Windows_NT)
# -------------------- Windows --------------------
EXE_EXT := .exe
# Example paths (adjust if you have your libs somewhere else):
# Include directories for GLFW, GLEW, etc.
GLFW_INCLUDE := C:/libs/glfw/include
GLEW_INCLUDE := C:/libs/glew/include
# Library search paths
LIB_PATHS := -LC:/libs/glfw/lib \
-LC:/libs/glew/lib \
-Llib
# Libraries to link against (adjust if needed)
LIBS := -lglfw3 -lopengl32 -lgdi32 -limm32 -lole32 -loleaut32 -luuid \
-lwinmm -lglew32 -lglu32 -lyaml-cpp -llua54
# A Windows-compatible "mkdir" command:
define MKDIR_P
if not exist "$(1)" mkdir "$(1)" >nul 2>&1
endef
else
# -------------------- Linux (or other Unix-likes) --------------------
EXE_EXT :=
# If libs are installed system-wide, you usually only need -lGL, -lGLEW, etc.
# But you can still point to custom paths if needed:
GLFW_INCLUDE := /usr/include
GLEW_INCLUDE := /usr/include
# Library search paths (often not needed if system-wide)
LIB_PATHS :=
# Libraries on Linux
LIBS := -lglfw -lGL -lGLEW -lGLU -lyaml-cpp -llua
# A Linux-compatible "mkdir -p" command:
define MKDIR_P
mkdir -p "$(1)"
endef
endif
# ------------------------------------------------------------------------------
# Directories
# ------------------------------------------------------------------------------
SRC_DIR := src
VENDOR_DIRS := vendor/imgui-docking vendor/stb
BUILD_DIR := build
# ------------------------------------------------------------------------------
# Include Directories
GLFW_INCLUDE := C:/libraries/glfw/include
INCLUDE_DIRS := $(SRC_DIR) $(VENDOR_DIRS) $(GLFW_INCLUDE) vendor/stb/include C:\msys64\mingw64\include vendor/lua vendor/gcml
INCLUDES := $(addprefix -I, $(INCLUDE_DIRS))
# ------------------------------------------------------------------------------
INCLUDE_DIRS := \
$(SRC_DIR) \
$(VENDOR_DIRS) \
$(GLFW_INCLUDE) \
$(GLEW_INCLUDE) \
vendor/stb/include \
vendor/lua \
vendor/gcml
# Update compiler flags with include paths
CXXFLAGS += $(INCLUDES)
# Add them to compiler flags:
CXXFLAGS += $(foreach inc,$(INCLUDE_DIRS),-I$(inc))
# -------------------------------------------------------------------------
# ------------------------------------------------------------------------------
# Source Files
# 1) Recursively gather *.cpp in src (including subfolders).
# 2) Gather *.cpp from vendor/imgui-docking, vendor/stb, etc.
# -------------------------------------------------------------------------
# ------------------------------------------------------------------------------
SRC_FILES := $(wildcard $(SRC_DIR)/*.cpp) \
$(wildcard $(SRC_DIR)/**/*.cpp)
@ -29,46 +84,43 @@ VENDOR_SRC := $(foreach dir, $(VENDOR_DIRS), $(wildcard $(dir)/*.cpp))
STB_SRC := $(wildcard vendor/stb/src/*.cpp) # If stb has .cpp files
ALL_SRC := $(SRC_FILES) $(VENDOR_SRC) $(STB_SRC)
# -------------------------------------------------------------------------
# ------------------------------------------------------------------------------
# Object Files
# Convert each .cpp to a corresponding .o under the build/ directory.
# For example:
# src/Engine.cpp -> build/src/Engine.o
# src/Windows/LoggerWindow.cpp -> build/src/Windows/LoggerWindow.o
# -------------------------------------------------------------------------
# ------------------------------------------------------------------------------
OBJ_FILES := $(patsubst %.cpp, $(BUILD_DIR)/%.o, $(ALL_SRC))
# Target executable name
TARGET := TesseractEngine.exe
# Libraries
LIBS := -LC:/libraries/glfw/lib -Llib -lglfw3 -lopengl32 -lgdi32 -limm32 -lole32 -loleaut32 -luuid -lwinmm -lglew32 -lglu32 -lyaml-cpp -llua54
# ------------------------------------------------------------------------------
# Target
# ------------------------------------------------------------------------------
TARGET := TesseractEngine$(EXE_EXT)
# ------------------------------------------------------------------------------
# Phony Targets
.PHONY: all clean copy_assets
# ------------------------------------------------------------------------------
.PHONY: all clean
# Default target
all: copy_assets $(TARGET)
# Copy assets/fonts to build/assets/fonts
copy_assets:
@echo Copying font assets...
xcopy /E /I /Y "assets\fonts" "$(BUILD_DIR)\assets\fonts" >nul
all: $(TARGET)
# ------------------------------------------------------------------------------
# Link all object files to create the executable
# ------------------------------------------------------------------------------
$(TARGET): $(OBJ_FILES)
@echo Linking $@...
$(CXX) $(CXXFLAGS) -o $@ $^ $(LIBS)
$(CXX) $(CXXFLAGS) -o $@ $^ $(LIB_PATHS) $(LIBS)
# ------------------------------------------------------------------------------
# Pattern rule to compile .cpp files to .o files
# Note the mkdir on the $(dir $@) ensures subfolders under build/ exist.
# ------------------------------------------------------------------------------
$(BUILD_DIR)/%.o: %.cpp
@mkdir "$(dir $@)" >nul 2>&1 | echo Folder exists
@$(call MKDIR_P,$(dir $@))
@echo Compiling $<...
$(CXX) $(CXXFLAGS) -c $< -o $@
# ------------------------------------------------------------------------------
# Clean build artifacts
# ------------------------------------------------------------------------------
clean:
@echo Cleaning up...
if exist "$(BUILD_DIR)" rmdir /s /q "$(BUILD_DIR)"
if exist "$(TARGET)" del /q "$(TARGET)"
rm -rf "$(BUILD_DIR)"
rm -f "$(TARGET)"

View File

@ -1,6 +1,6 @@
[Window][DockSpace]
Pos=0,0
Size=1920,1177
Size=1280,720
Collapsed=0
[Window][Debug##Default]
@ -80,8 +80,8 @@ Collapsed=0
DockId=0x0000001F,0
[Window][Performance##performance]
Pos=8,581
Size=335,588
Pos=8,360
Size=335,352
Collapsed=0
DockId=0x0000001C,0
@ -105,7 +105,7 @@ DockId=0x0000000F,0
[Window][Scene Window##SceneWindow]
Pos=8,28
Size=335,551
Size=335,330
Collapsed=0
DockId=0x0000001B,0
@ -134,26 +134,26 @@ Collapsed=0
DockId=0x0000001E,0
[Window][ Logger##logger]
Pos=345,846
Size=1170,323
Pos=345,389
Size=530,323
Collapsed=0
DockId=0x00000025,0
[Window][ Editor##EditorWindow]
Pos=345,28
Size=1170,816
Size=530,359
Collapsed=0
DockId=0x0000001F,0
[Window][ Inspector##InspectorWindow]
Pos=1517,28
Size=395,1141
Pos=877,28
Size=395,684
Collapsed=0
DockId=0x00000022,0
[Window][ Profiler]
Pos=345,846
Size=1170,323
Pos=345,389
Size=530,323
Collapsed=0
DockId=0x00000025,1
@ -170,7 +170,7 @@ Column 2 Weight=0.9665
Column 3 Weight=0.6950
[Docking][Data]
DockSpace ID=0x14621557 Window=0x3DA2F1DE Pos=8,51 Size=1904,1141 Split=X Selected=0xF7365A5A
DockSpace ID=0x14621557 Window=0x3DA2F1DE Pos=302,345 Size=1264,684 Split=X Selected=0xF7365A5A
DockNode ID=0x00000020 Parent=0x14621557 SizeRef=884,684 Split=X
DockNode ID=0x00000013 Parent=0x00000020 SizeRef=335,1142 Split=Y Selected=0x818D04BB
DockNode ID=0x0000001B Parent=0x00000013 SizeRef=264,551 HiddenTabBar=1 Selected=0x1D5D92B6
@ -193,7 +193,7 @@ DockSpace ID=0x14621557 Window=0x3DA2F1DE Pos=8,51 Size=
DockNode ID=0x00000017 Parent=0x0000000D SizeRef=1202,776 Split=Y Selected=0xDFF75B3F
DockNode ID=0x0000001D Parent=0x00000017 SizeRef=518,720 Split=Y Selected=0x9A7B23B9
DockNode ID=0x0000001F Parent=0x0000001D SizeRef=549,359 CentralNode=1 HiddenTabBar=1 Selected=0x9A7B23B9
DockNode ID=0x00000025 Parent=0x0000001D SizeRef=549,323 Selected=0x7A66B86B
DockNode ID=0x00000025 Parent=0x0000001D SizeRef=549,323 Selected=0x1F29F1F5
DockNode ID=0x0000001E Parent=0x00000017 SizeRef=518,417 Selected=0xC74E1AEE
DockNode ID=0x00000018 Parent=0x0000000D SizeRef=1202,364 Split=X Selected=0x1C0788A1
DockNode ID=0x00000019 Parent=0x00000018 SizeRef=601,364 Selected=0x1C0788A1