inital stuff
This commit is contained in:
5
.gitignore
vendored
5
.gitignore
vendored
@@ -32,3 +32,8 @@
|
|||||||
*.out
|
*.out
|
||||||
*.app
|
*.app
|
||||||
|
|
||||||
|
# Build directories
|
||||||
|
build/
|
||||||
|
|
||||||
|
# Vscode
|
||||||
|
.vscode/
|
||||||
4
.gitmodules
vendored
Normal file
4
.gitmodules
vendored
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
[submodule "lib/imgui"]
|
||||||
|
path = lib/imgui
|
||||||
|
url = https://github.com/ocornut/imgui.git
|
||||||
|
branch = docking
|
||||||
1
lib/imgui
Submodule
1
lib/imgui
Submodule
Submodule lib/imgui added at 3912b3d9a9
64
makefile
Normal file
64
makefile
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
# Directories
|
||||||
|
INCLUDE_DIR = inc
|
||||||
|
SRC_DIR = src
|
||||||
|
BUILD_DIR = build
|
||||||
|
|
||||||
|
# imgui bs
|
||||||
|
IMGUI_DIR = lib/imgui
|
||||||
|
INCLUDE_DIR += $(IMGUI_DIR) $(IMGUI_DIR)/backends
|
||||||
|
|
||||||
|
# Compiler, flags and libraries
|
||||||
|
CXX = g++
|
||||||
|
CXXFLAGS = -std=c++17
|
||||||
|
LIBS = -lGL -lglm `pkg-config --libs sdl3 sdl3-image`
|
||||||
|
|
||||||
|
# =============================== Don't touch below pwease :3 ===============================
|
||||||
|
|
||||||
|
# Compiler and linker settings
|
||||||
|
CXXFLAGS += $(addprefix -I, $(INCLUDE_DIR))
|
||||||
|
|
||||||
|
# Source files
|
||||||
|
SRC = $(wildcard $(SRC_DIR)/*.cpp)
|
||||||
|
|
||||||
|
# Imgui specific stuff
|
||||||
|
SRC += $(IMGUI_DIR)/imgui.cpp $(IMGUI_DIR)/imgui_demo.cpp $(IMGUI_DIR)/imgui_draw.cpp $(IMGUI_DIR)/imgui_tables.cpp $(IMGUI_DIR)/imgui_widgets.cpp
|
||||||
|
SRC += $(IMGUI_DIR)/backends/imgui_impl_sdl3.cpp $(IMGUI_DIR)/backends/imgui_impl_opengl3.cpp
|
||||||
|
|
||||||
|
# Target executable
|
||||||
|
UNAME := $(shell uname -s)
|
||||||
|
BUILD_DIR := $(BUILD_DIR)/$(UNAME)
|
||||||
|
OBJ_DIR := $(BUILD_DIR)/objs
|
||||||
|
BIN = $(BUILD_DIR)/main
|
||||||
|
|
||||||
|
# Object files corresponding to the source files
|
||||||
|
OBJS = $(addprefix $(OBJ_DIR)/, $(addsuffix .o, $(basename $(notdir $(SRC)))))
|
||||||
|
|
||||||
|
# black magic wizardry below this line (pwease don't touch i beg you)
|
||||||
|
dev: CXXFLAGS += -g -Wall -Wformat
|
||||||
|
dev: all
|
||||||
|
|
||||||
|
release: CXXFLAGS += -O3
|
||||||
|
release: all
|
||||||
|
|
||||||
|
dirs:
|
||||||
|
@mkdir -p $(BUILD_DIR)
|
||||||
|
@mkdir -p $(OBJ_DIR)
|
||||||
|
|
||||||
|
# Even more imgui specific stuff >:(
|
||||||
|
$(OBJ_DIR)/%.o: $(IMGUI_DIR)/%.cpp
|
||||||
|
$(CXX) $(CXXFLAGS) -c -o $@ $<
|
||||||
|
|
||||||
|
$(OBJ_DIR)/%.o: $(IMGUI_DIR)/backends/%.cpp
|
||||||
|
$(CXX) $(CXXFLAGS) -c -o $@ $<
|
||||||
|
|
||||||
|
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.cpp
|
||||||
|
$(CXX) $(CXXFLAGS) -c -o $@ $<
|
||||||
|
|
||||||
|
all: dirs $(BIN)
|
||||||
|
@echo Build complete
|
||||||
|
|
||||||
|
$(BIN): $(OBJS)
|
||||||
|
$(CXX) -o $@ $^ $(CXXFLAGS) $(LIBS)
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -rf $(BUILD_DIR)
|
||||||
0
src/main.cpp
Normal file
0
src/main.cpp
Normal file
Reference in New Issue
Block a user