1 ###############################################################################
2 # $Id: Makefile,v 1.21 2010/02/11 12:34:14 faust Exp $
3 ###############################################################################
5 include ../../Makefile.conf
19 STGLIBS_INCS = $(addprefix -I ../../stglibs/,$(addsuffix .lib/include,$(STGLIBS)))
20 STGLIBS_LIBS = $(addprefix -L ../../stglibs/,$(addsuffix .lib,$(STGLIBS)))
22 LIBS += $(addprefix -lstg,$(STGLIBS)) -lexpat $(LIB_THREAD)
30 SEARCH_DIRS = -I ../../include
33 SEARCH_DIRS += -I/usr/local/include
34 CXXFLAGS += -DHAVE_DECL_GETOPT=1
38 SEARCH_DIRS += -I/usr/local/include
39 CXXFLAGS += -DHAVE_DECL_GETOPT=1
42 OBJS = $(notdir $(patsubst %.cpp, %.o, $(patsubst %.c, %.o, $(SRCS))))
44 CXXFLAGS += $(DEFS) $(STGLIBS_INCS) $(SEARCH_DIRS)
45 CFLAGS += $(DEFS) $(STGLIBS_INCS) $(SEARCH_DIRS)
46 LDFLAGS += $(STGLIBS_LIBS)
52 .PHONY: all clean distclean libs install uninstall install-bin install-data uninstall-bin uninstall-data
53 all: libs $(PROG) ../../Makefile.conf
56 $(MAKE) -C $(DIR_LIBSRC)
59 $(CXX) $^ $(LDFLAGS) $(LIBS) -o $(PROG)
62 rm -f deps $(PROG) *.o tags *.*~ .OS
67 $(MAKE) -C $(DIR_LIBSRC) clean
70 rm -f ../../Makefile.conf
76 install -D -m $(BIN_MODE) -o $(OWNER) $(PROG) $(PREFIX)/usr/bin/$(PROG)
78 install -D -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/bin/$(PROG)
80 $(MAKE) -C $(DIR_LIBSRC) install
82 uninstall: uninstall-bin
85 rm -f $(PREFIX)/usr/sbin/$(PROG)
88 ifneq ($(MAKECMDGOALS),distclean)
89 ifneq ($(MAKECMDGOALS),clean)
90 ifneq ($(MAKECMDGOALS),uninstall)
96 deps: $(SRCS) ../../Makefile.conf
97 $(MAKE) -C $(DIR_LIBSRC)
99 for file in $(SRCS); do\
100 echo "$$file" | grep ".c$$" > /dev/null;\
103 echo "`$(CC) $(CFLAGS) -MM $$file` Makefile" >> deps ;\
104 printf '%b\n' '\t$$(CC) $(CFLAGS) -c $$<' >> deps ;\
106 echo "`$(CXX) $(CXXFLAGS) -MM $$file` Makefile" >> deps ;\
107 printf '%b\n' '\t$$(CXX) $(CXXFLAGS) -c $$<' >> deps ;\