-
Notifications
You must be signed in to change notification settings - Fork 48
/
Makefile
50 lines (36 loc) · 950 Bytes
/
Makefile
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
GAME := flappingbird
BUILD := build
SRCS := $(wildcard *.cpp)
OBJS := $(addprefix $(BUILD)/, $(SRCS:.cpp=.o))
SGE := SimpleGameEngine
LIBSGE := $(SGE)/build/libsge.a
CXXFLAGS := -Wall \
-Wextra \
-Wwrite-strings \
-Winit-self \
-Wcast-align \
-Wcast-qual \
-Wpointer-arith \
-Wstrict-aliasing \
-Wformat=2 \
-Wmissing-declarations \
-Wmissing-include-dirs \
-Wno-unused-parameter \
-Wuninitialized \
-Wno-reorder
override CXXFLAGS += -std=c++11 -I./$(SGE)/build/include
GLFWDEPS = $(shell grep Libs.private $(SGE)/build/glfw/src/glfw3.pc | cut -d' ' -f2-)
all: $(GAME)
$(BUILD):
mkdir -p $(BUILD)
spritesheet.png:
curl -o $@ http://www.spriters-resource.com/resources/sheets/56/59537.png
$(LIBSGE):
$(MAKE) -C $(SGE)
$(GAME): $(LIBSGE) $(OBJS) | spritesheet.png
$(CXX) -o $@ $^ $(GLFWDEPS) $(LDFLAGS)
$(BUILD)/%.o: %.cpp | $(BUILD)
$(CXX) -c -o $@ $< $(CXXFLAGS)
clean:
rm -rf $(BUILD) flappingbird
.PHONY: all clean