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)
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 install -D -m $(BIN_MODE) -o $(OWNER) $(PROG) $(PREFIX)/usr/bin/$(PROG)
72 install -D -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/bin/$(PROG)
74 $(MAKE) -C $(DIR_PLUGINS) install
76 uninstall: uninstall-bin
79 rm -f $(PREFIX)/usr/bin/$(PROG)
81 ifneq ($(MAKECMDGOALS),distclean)
82 ifneq ($(MAKECMDGOALS),clean)
83 ifneq ($(MAKECMDGOALS),uninstall)
89 deps: $(SRCS) ../../Makefile.conf
90 $(MAKE) -C $(DIR_LIBSRC)
92 for file in $(SRCS); do\
93 echo "$$file" | grep ".c$$" > /dev/null;\
96 echo "`$(CC) $(CFLAGS) -MM $$file` Makefile" >> deps ;\
97 printf '%b\n' '\t$$(CC) $(CFLAGS) -c $$<' >> deps ;\
99 echo "`$(CXX) $(CXXFLAGS) -MM $$file` Makefile" >> deps ;\
100 printf '%b\n' '\t$$(CXX) $(CXXFLAGS) -c $$<' >> deps ;\