1 ###############################################################################
2 # $Id: Makefile,v 1.12 2009/03/03 15:49:34 faust Exp $
3 ###############################################################################
5 include ../../Makefile.conf
18 STGLIBS_INCS = $(addprefix -I ../../stglibs/,$(addsuffix .lib/include,$(STGLIBS)))
19 STGLIBS_LIBS = $(addprefix -L ../../stglibs/,$(addsuffix .lib,$(STGLIBS)))
21 LIBS += $(addprefix -lstg,$(STGLIBS)) $(LIB_THREAD) $(LIBICONV)
29 SEARCH_DIRS = -I ../../include
31 OBJS = $(notdir $(patsubst %.cpp, %.o, $(patsubst %.c, %.o, $(SRCS))))
33 CXXFLAGS += $(DEFS) $(STGLIBS_INCS) $(SEARCH_DIRS)
34 CFLAGS += $(DEFS) $(STGLIBS_INCS) $(SEARCH_DIRS)
40 LDFLAGS += $(STGLIBS_LIBS)
42 .PHONY: all clean distclean libs plugins install uninstall
43 all: libs plugins $(PROG) ../../Makefile.conf
46 $(MAKE) -C $(DIR_LIBSRC)
49 $(MAKE) -C $(DIR_PLUGINS)
52 $(CXX) $^ $(LDFLAGS) $(LIBS) -o $(PROG)
55 rm -f deps $(PROG) *.o tags *.*~ .OS
60 $(MAKE) -C $(DIR_LIBSRC) clean
61 $(MAKE) -C $(DIR_PLUGINS) clean
64 rm -f ../../Makefile.conf
70 mkdir -m $(DIR_MODE) -p $(PREFIX)/usr/bin
71 install -m $(BIN_MODE) -o $(OWNER) $(PROG) $(PREFIX)/usr/bin/$(PROG)
73 mkdir -m $(DIR_MODE) -p $(PREFIX)/usr/bin
74 install -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/bin/$(PROG)
76 $(MAKE) -C $(DIR_PLUGINS) install
78 uninstall: uninstall-bin
81 rm -f $(PREFIX)/usr/bin/$(PROG)
83 ifneq ($(MAKECMDGOALS),distclean)
84 ifneq ($(MAKECMDGOALS),clean)
85 ifneq ($(MAKECMDGOALS),uninstall)
91 deps: $(SRCS) ../../Makefile.conf
92 $(MAKE) -C $(DIR_LIBSRC)
94 for file in $(SRCS); do\
95 echo "$$file" | grep ".c$$" > /dev/null;\
98 echo "`$(CC) $(CFLAGS) -MM $$file` Makefile" >> deps ;\
99 printf '%b\n' '\t$$(CC) $(CFLAGS) -c $$<' >> deps ;\
101 echo "`$(CXX) $(CXXFLAGS) -MM $$file` Makefile" >> deps ;\
102 printf '%b\n' '\t$$(CXX) $(CXXFLAGS) -c $$<' >> deps ;\