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