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)
35 LDFLAGS += -Wl,-E $(STGLIBS_LIBS)
37 .PHONY: all clean distclean libs plugins install uninstall
38 all: libs plugins $(PROG) ../../Makefile.conf
41 $(MAKE) -C $(DIR_LIBSRC)
44 $(MAKE) -C $(DIR_PLUGINS)
47 $(CXX) $^ $(LDFLAGS) $(LIBS) -o $(PROG)
50 rm -f deps $(PROG) *.o tags *.*~ .OS
55 $(MAKE) -C $(DIR_LIBSRC) clean
56 $(MAKE) -C $(DIR_PLUGINS) clean
59 rm -f ../../Makefile.conf
65 install -D -m $(BIN_MODE) -o $(OWNER) $(PROG) $(PREFIX)/usr/bin/$(PROG)
67 install -D -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/bin/$(PROG)
69 $(MAKE) -C $(DIR_PLUGINS) install
71 uninstall: uninstall-bin
74 rm -f $(PREFIX)/usr/bin/$(PROG)
76 ifneq ($(MAKECMDGOALS),distclean)
77 ifneq ($(MAKECMDGOALS),clean)
78 ifneq ($(MAKECMDGOALS),uninstall)
84 deps: $(SRCS) ../../Makefile.conf
85 $(MAKE) -C $(DIR_LIBSRC)
87 for file in $(SRCS); do\
88 echo "$$file" | grep ".c$$" > /dev/null;\
91 echo "`$(CC) $(CFLAGS) -MM $$file` Makefile" >> deps ;\
92 printf '%b\n' '\t$$(CC) $(CFLAGS) -c $$<' >> deps ;\
94 echo "`$(CXX) $(CXXFLAGS) -MM $$file` Makefile" >> deps ;\
95 printf '%b\n' '\t$$(CXX) $(CXXFLAGS) -c $$<' >> deps ;\