forked from skeeto/pixelcity
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
40 lines (29 loc) · 802 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
all: pixelcity
SRCS := $(wildcard *.cpp *.c)
DEPS_TMP := $(SRCS:.cpp=.d)
DEPS := $(DEPS_TMP:.c=.d)
OBJS := $(DEPS:.d=.o)
# automatic dependencies: include them all so GNU make will remake them,
-include $(DEPS)
# ...and provide rules to re-make them via gcc/g++
%.d: %.c
@$(CC) -MM -MP -MF $@ $(CPPFLAGS) $<
%.d: %.cpp
@$(CXX) -MM -MP -MF $@ $(CPPFLAGS) $<
pixelcity: $(OBJS)
g++ -o $@ -g $(OBJS) $(LDFLAGS) -lm -lX11 -lGL -lGLU
CFLAGS=-Wall -pedantic -D_FILE_OFFSET_BITS=64
CXXFLAGS=-Wall -pedantic -D_FILE_OFFSET_BITS=64
CPPFLAGS=$(shell pkg-config --cflags fontconfig freetype2)
LDFLAGS=$(shell pkg-config --libs fontconfig freetype2)
ifeq ($(OPT), 0)
CFLAGS += -g -O0
CXXFLAGS += -g -O0
else
CFLAGS += -O3
CXXFLAGS += -O3
endif
clean:
rm -f *.o pixelcity
realclean: clean
rm -f *.d