-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
executable file
·66 lines (49 loc) · 1.91 KB
/
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
LIB_NAME = libhermes.a
LIB_SRCFILES = $(wildcard source/*.cpp)
LIB_OBJFILES = $(LIB_SRCFILES:%.cpp=%.o)
EXT_MODULE_NAME = libhmsextmodule.a
EXT_MODULE_SRCFILES = ext/hmsModule.cpp
EXT_MODULE_OBJFILES = $(EXT_MODULE_SRCFILES:%.cpp=%.o)
EXT_JNI_NAME = libhmsextjni.a
EXT_JNI_SRCFILES = ext/hmsJNI.cpp
EXT_JNI_OBJFILES = $(EXT_JNI_SRCFILES:%.cpp=%.o)
EXT_AASSETREADER_NAME = libhmsextaassetreader.a
EXT_AASSETREADER_SRCFILES = ext/hmsAAssetReader.cpp
EXT_AASSETREADER_OBJFILES = $(EXT_AASSETREADER_SRCFILES:%.cpp=%.o)
EXT_SERIALIZER_NAME = libhmsextserializer.a
EXT_SERIALIZER_SRCFILES = ext/hmsSerializer.cpp
EXT_SERIALIZER_OBJFILES = $(EXT_SERIALIZER_SRCFILES:%.cpp=%.o)
EXT_GZIPREADER_NAME = libhmsextgzipreader.a
EXT_GZIPREADER_SRCFILES = ext/hmsGZipReader.cpp
EXT_GZIPREADER_OBJFILES = $(EXT_GZIPREADER_SRCFILES:%.cpp=%.o)
CXXFLAGS += -Iinclude -Idepend/aes/include -Idepend/curl/include -Idepend/jsoncpp/include -Idepend/zlib/include -Wreorder
ifndef NDEBUG
CXXFLAGS += -g -D_DEBUG=1 -DDEBUG=1
else
ifdef DSYM
CXXFLAGS += -g
endif
CXXFLAGS += -DNDEBUG=1 -O2
endif
all: $(LIB_NAME) $(EXT_MODULE_NAME) $(EXT_SERIALIZER_NAME)
$(LIB_NAME): $(LIB_OBJFILES)
$(AR) rs $@ $^
$(EXT_MODULE_NAME): $(EXT_MODULE_OBJFILES)
$(AR) rs $@ $^
$(EXT_JNI_NAME): $(EXT_JNI_OBJFILES)
$(AR) rs $@ $^
$(EXT_AASSETREADER_NAME): $(EXT_AASSETREADER_OBJFILES)
$(AR) rs $@ $^
$(EXT_SERIALIZER_NAME): $(EXT_SERIALIZER_OBJFILES)
$(AR) rs $@ $^
$(EXT_GZIPREADER_NAME): $(EXT_GZIPREADER_OBJFILES)
$(AR) rs $@ $^
%.d:%.cpp
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -MM -MF $@ $<
clean:
ifeq ($(OS), Windows_NT)
del $(LIB_NAME) $(EXT_MODULE_NAME) $(EXT_JNI_NAME) $(EXT_AASSETREADER_NAME) $(EXT_SERIALIZER_NAME) $(EXT_GZIPREADER_NAME) source\*.o source\*.d ext\*.o ext\*.d >nul 2>&1
else
$(RM) $(LIB_NAME) $(EXT_MODULE_NAME) $(EXT_JNI_NAME) $(EXT_AASSETREADER_NAME) $(EXT_SERIALIZER_NAME) $(EXT_GZIPREADER_NAME) source/*.o source/*.d ext/*.o ext/*.d
endif
.PHONY: all clean