]> git.stg.codes - stg.git/blob - projects/sgauthstress/Makefile
WaitPackets moved to common.lib
[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 =  -lstgcrypto \
12            -lstgcommon \
13            -ldotconfpp
14
15 LIBS += $(LIB_THREAD)
16
17 ifeq ($(OS),linux)
18 LIBS += -ldl
19 else
20 LIBS += -lintl \
21         -lc
22 endif
23
24 SEARCH_DIRS = -I $(DIR_INCLUDE)
25
26 OBJS = $(notdir $(patsubst %.cpp, %.o, $(patsubst %.c, %.o, $(SRCS))))
27
28 CXXFLAGS += -Wall
29 LDFLAGS += -Wl,-E -L$(DIR_LIB) -Wl,-rpath,$(PREFIX)/usr/lib/stg -Wl,-rpath-link,$(DIR_LIB)
30
31 vpath %.a $(DIR_LIB)
32
33 .PHONY: all clean distclean libs plugins
34 all: libs plugins $(PROG) ../../Makefile.conf
35
36 libs:
37         $(MAKE) -C $(DIR_LIBSRC)
38
39 plugins: libs 
40         $(MAKE) -C $(DIR_PLUGINS)
41
42 $(PROG): $(OBJS) libs
43         $(CXX) $(OBJS) $(LDFLAGS) $(LIBS) $(STGLIBS) -o $(PROG)
44
45 clean:
46         rm -f deps $(PROG) *.o *.*~
47         $(MAKE) -C $(DIR_LIBSRC) clean
48         $(MAKE) -C $(DIR_PLUGINS) clean
49
50 distclean: clean
51         rm -f ../../Makefile.conf
52
53 ifneq ($(MAKECMDGOALS),distclean)
54 ifneq ($(MAKECMDGOALS),clean)
55 ifneq ($(MAKECMDGOALS),uninstall)
56 -include deps
57 endif
58 endif
59 endif
60
61 deps:   $(SRCS) ../../Makefile.conf
62         $(MAKE) -C $(DIR_LIBSRC) includes
63         @>deps ;\
64         for file in $(SRCS); do\
65           echo "`$(CC) $(CXXFLAGS) $(SEARCH_DIRS) -MM $$file` Makefile ../../Makefile.conf" >> deps ;\
66           echo -e '\t$$(CC) -c $$< $(CXXFLAGS) $(SEARCH_DIRS) $(DEFS)' >> deps ;\
67         done