]> git.stg.codes - stg.git/blob - projects/sgauthstress/Makefile
Extra semicolon removed
[stg.git] / projects / sgauthstress / Makefile
1 include ../../Makefile.conf
2
3 PROG = sgauthstress
4
5 SRCS = main.cpp \
6        settings.cpp \
7        store_loader.cpp \
8        user.cpp \
9        proto.cpp
10
11 STGLIBS = dotconfpp \
12           locker \
13           crypto \
14           common
15
16 STGLIBS_INCS = $(addprefix -I ../../stglibs/,$(addsuffix .lib/include,$(STGLIBS)))
17 STGLIBS_LIBS = $(addprefix -L ../../stglibs/,$(addsuffix .lib,$(STGLIBS)))
18
19 LIBS += $(addprefix -lstg,$(STGLIBS)) $(LIB_THREAD)
20
21 ifeq ($(OS),linux)
22 LIBS += -ldl
23 else
24 LIBS += -lintl \
25         -lc \
26         -liconv
27 endif
28
29 SEARCH_DIRS = -I ../../include
30
31 OBJS = $(notdir $(patsubst %.cpp, %.o, $(patsubst %.c, %.o, $(SRCS))))
32
33 CXXFLAGS += $(DEFS) $(STGLIBS_INCS) $(SEARCH_DIRS)
34 CFLAGS += $(DEFS) $(STGLIBS_INCS) $(SEARCH_DIRS)
35 LDFLAGS += -Wl,-E $(STGLIBS_LIBS)
36
37 .PHONY: all clean distclean libs plugins
38 all: libs plugins $(PROG) ../../Makefile.conf
39
40 libs:
41         $(MAKE) -C $(DIR_LIBSRC)
42
43 plugins: libs 
44         $(MAKE) -C $(DIR_PLUGINS)
45
46 $(PROG): $(OBJS)
47         $(CXX) $^ $(LDFLAGS) $(LIBS) -o $(PROG)
48
49 clean:
50         rm -f deps $(PROG) *.o *.*~
51         $(MAKE) -C $(DIR_LIBSRC) clean
52         $(MAKE) -C $(DIR_PLUGINS) clean
53
54 distclean: clean
55         rm -f ../../Makefile.conf
56
57 ifneq ($(MAKECMDGOALS),distclean)
58 ifneq ($(MAKECMDGOALS),clean)
59 ifneq ($(MAKECMDGOALS),uninstall)
60 -include deps
61 endif
62 endif
63 endif
64
65 deps:   $(SRCS) ../../Makefile.conf
66         $(MAKE) -C $(DIR_LIBSRC)
67         @>deps ;\
68         for file in $(SRCS); do\
69           echo "`$(CC) $(CXXFLAGS) -MM $$file` Makefile ../../Makefile.conf" >> deps ;\
70           echo -e '\t$$(CC) -c $$< $(CXXFLAGS)' >> deps ;\
71         done