]> git.stg.codes - stg.git/blob - projects/sgauthstress/Makefile
Settings code and header files renamed
[stg.git] / projects / sgauthstress / Makefile
1 include ../../Makefile.conf
2
3 PROG = sgauthstress
4
5 SRCS = ./main.cpp \
6        ./settings_impl.cpp \
7        ./store_loader.cpp
8
9 STGLIBS =  -lstgcrypto \
10            -lstgcommon \
11            -ldotconfpp \
12            -lstgia
13
14 LIBS += $(LIB_THREAD)
15
16 ifeq ($(OS),linux)
17 LIBS += -ldl
18 else
19 LIBS += -lintl \
20         -lc
21 endif
22
23 SEARCH_DIRS = -I $(DIR_INCLUDE)
24
25 OBJS = $(notdir $(patsubst %.cpp, %.o, $(patsubst %.c, %.o, $(SRCS))))
26
27 CXXFLAGS += -Wall
28 LDFLAGS += -Wl,-E -L$(DIR_LIB) -Wl,-rpath,$(PREFIX)/usr/lib/stg -Wl,-rpath-link,$(DIR_LIB)
29
30 vpath %.so $(DIR_LIB)
31
32 .PHONY: all clean distclean libs plugins
33 all: libs plugins $(PROG) ../../Makefile.conf
34
35 libs:
36         $(MAKE) -C $(DIR_LIBSRC)
37
38 plugins: libs 
39         $(MAKE) -C $(DIR_PLUGINS)
40
41 $(PROG): $(OBJS) $(STGLIBS) 
42         $(CC) $^ $(LDFLAGS) -o $(PROG) $(LIBS)
43
44 clean:
45         rm -f deps $(PROG) *.o tags *.*~ .OS
46         rm -f .OS
47         rm -f .store
48         rm -f .db.sql
49         rm -f core*
50         rm -f css.h
51         $(MAKE) -C $(DIR_LIBSRC) clean
52
53 distclean: clean
54         rm -f ../../Makefile.conf
55
56 ifneq ($(MAKECMDGOALS),distclean)
57 ifneq ($(MAKECMDGOALS),clean)
58 ifneq ($(MAKECMDGOALS),uninstall)
59 -include deps
60 endif
61 endif
62 endif
63
64 deps:   $(SRCS) ../../Makefile.conf
65         $(MAKE) -C $(DIR_LIBSRC) includes
66         @>deps ;\
67         ./make_css.sh
68         for file in $(SRCS); do\
69           echo "`$(CC) $(CXXFLAGS) $(SEARCH_DIRS) -MM $$file` Makefile" >> deps ;\
70           echo -e '\t$$(CC) -c $$< $(CXXFLAGS) $(SEARCH_DIRS) $(DEFS)' >> deps ;\
71         done