blob: 32881811a39005951e947308bf45f9899454195f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
CC = g++
INCFLAGS = -Isrc
INCFLAGS += -Iengine
INCFLAGS += -Ilib/glfw/include
INCFLAGS += -Ilib/glm
INCFLAGS += -Ilib/stb
INCFLAGS += -Ilib/openal-soft/include
INCFLAGS += -Ilib/freealut/include
CCFLAGS = -std=c++17 -O2 -g
CCFLAGS += $(INCFLAGS)
LDFLAGS = -lm
LDFLAGS += -lglfw
LDFLAGS += -ldl
LDFLAGS += -lopenal
LDFLAGS += -lalut
LDFLAGS += -lvulkan
LDFLAGS += $(INCFLAGS)
SRC = $(shell find src -name "*.cpp")
SRC += $(shell find engine -name "*.cpp")
OBJ = $(SRC:.cpp=.o)
BIN = bin
VERTSRC = $(shell find ./res/shaders -type f -name "*.vert")
VERTOBJ = $(patsubst %.vert, %.vert.spv, $(VERTSRC))
FRAGSRC = $(shell find ./res/shaders -type f -name "*.frag")
FRAGOBJ = $(patsubst %.frag, %.frag.spv, $(FRAGSRC))
.PHONY: all clean
all: dirs shader build
dirs:
mkdir -p ./$(BIN)
shader: $(VERTOBJ) $(FRAGOBJ)
run: build
$(RUN) $(BIN)/game
build: dirs shader ${OBJ}
${CC} -o $(BIN)/game $(filter %.o,$^) $(LDFLAGS)
%.spv: %
glslc -o $@ $<
%.o: %.cpp
$(CC) -o $@ -c $< $(CCFLAGS)
clean:
rm -rf app
rm -rf $(BIN) $(OBJ)
rm -rf res/shaders/*.spv
rm -rf lib/glfw/CMakeCache.txt
|