forked from CleverRaven/Cataclysm-DDA
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
34 lines (23 loc) · 817 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
PKGCONFIG = pkg-config
QT5_MODULES = Qt5Core Qt5Gui Qt5Widgets
QT5_LIBS = `$(PKGCONFIG) $(QT5_MODULES) --libs`
QT5_CFLAGS = `$(PKGCONFIG) $(QT5_MODULES) --cflags`
SOURCES = $(wildcard *.cpp) messages.cpp format.cpp
VPATH=../src:../tools/format
OBJS = $(sort $(SOURCES:%.cpp=$(ODIR)/%.o))
CATA_LIB=../$(BUILD_PREFIX)cataclysm.a
ODIR ?= obj
CXXFLAGS += $(QT5_CFLAGS) -I../src -I../tools/format -isystem ../src/third-party -fPIC
LDFLAGS += $(QT5_LIBS)
DEFINES += -DQT_NO_KEYWORDS
object_creator: $(OBJS) $(CATA_LIB)
+$(CXX) -o $@ $(OBJS) $(CATA_LIB) $(CXXFLAGS) $(LDFLAGS)
clean:
rm -f object_creator
rm -rf $(ODIR)
$(shell mkdir -p $(ODIR))
$(ODIR)/%.o: %.cpp
$(CXX) $(CPPFLAGS) $(DEFINES) $(CXXFLAGS) -c ../object_creator/$< -o $@
.PHONY: clean object_creator
.SECONDARY: $(OBJS)
-include ${OBJS:.o=.d}