2024-10-04 19:56:58 -05:00
|
|
|
CPPFLAGS=-g
|
2024-10-04 03:36:56 -05:00
|
|
|
LDFLAGS=-lglfw -lvulkan -ldl -lpthread -lX11 -lXxf86vm -lXrandr -lXi
|
2024-10-06 04:35:53 -05:00
|
|
|
DEBUGFLAGS=-DDEBUG -fsanitize=address
|
2024-10-04 01:03:13 -05:00
|
|
|
SRC=$(shell find . -name *.cpp)
|
|
|
|
OBJ=$(SRC:%.cpp=%.o)
|
2024-10-04 03:36:56 -05:00
|
|
|
|
2024-10-04 23:16:24 -05:00
|
|
|
BIN=build/agnosiaengine
|
2024-10-04 01:03:13 -05:00
|
|
|
|
|
|
|
|
|
|
|
.PHONY: all
|
|
|
|
all: $(BIN)
|
|
|
|
|
2024-10-04 03:36:56 -05:00
|
|
|
.PHONY: run
|
|
|
|
run: $(BIN)
|
|
|
|
./$(BIN)
|
2024-10-04 19:56:58 -05:00
|
|
|
.PHONY: debug
|
|
|
|
debug: LDFLAGS+=$(DEBUGFLAGS)
|
|
|
|
debug: $(BIN)
|
|
|
|
./$(BIN)
|
2024-10-04 01:03:13 -05:00
|
|
|
.PHONY: dep
|
|
|
|
dep:
|
2024-10-04 03:36:56 -05:00
|
|
|
sudo pacman -S gcc glfw glm shaderc libxi libxxf86vm
|
2024-10-04 01:03:13 -05:00
|
|
|
.PHONY: info
|
|
|
|
info:
|
|
|
|
@echo "make: Build executable"
|
|
|
|
@echo "make dep: Make all required dependencies"
|
|
|
|
@echo "make debug: Make with Debug hooked in"
|
|
|
|
@echo "make clean: Clean all files"
|
2024-10-04 03:36:56 -05:00
|
|
|
@echo "make run: Run the executable after building"
|
2024-10-04 01:03:13 -05:00
|
|
|
|
|
|
|
$(BIN): $(OBJ)
|
|
|
|
mkdir -p build
|
2024-10-04 03:36:56 -05:00
|
|
|
g++ $(CPPFLAGS) -o $(BIN) $(OBJ) $(LDFLAGS)
|
2024-10-04 01:03:13 -05:00
|
|
|
|
|
|
|
%.o: %.cpp
|
2024-10-04 03:36:56 -05:00
|
|
|
g++ -c $< -o $@ $(LDFLAGS)
|
2024-10-04 01:03:13 -05:00
|
|
|
|
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
|
|
|
rm -rf build
|
2024-10-04 03:36:56 -05:00
|
|
|
find . -name "*.o" -type f -delete
|