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
61 ifneq ($(MAKECMDGOALS),distclean)
62 ifneq ($(MAKECMDGOALS),clean)
63 ifneq ($(MAKECMDGOALS),uninstall)
69 deps: $(SRCS) ../../Makefile.conf
70 $(MAKE) -C $(DIR_LIBSRC)
72 for file in $(SRCS); do\
73 echo "$$file" | grep ".c$$" > /dev/null;\
76 echo "`$(CC) $(CFLAGS) -MM $$file` Makefile" >> deps ;\
77 printf '%b\n' '\t$$(CC) $(CFLAGS) -c $$<' >> deps ;\
79 echo "`$(CXX) $(CXXFLAGS) -MM $$file` Makefile" >> deps ;\
80 printf '%b\n' '\t$$(CXX) $(CXXFLAGS) -c $$<' >> deps ;\