1 ###############################################################################
2 # $Id: Makefile,v 1.21 2010/02/11 12:34:14 faust Exp $
3 ###############################################################################
5 include ../../Makefile.conf
23 STGLIBS_INCS = $(addprefix -I ../../stglibs/,$(addsuffix .lib/include,$(STGLIBS)))
24 STGLIBS_LIBS = $(addprefix -L ../../stglibs/,$(addsuffix .lib,$(STGLIBS)))
26 LIBS += $(addprefix -lstg,$(STGLIBS)) -lexpat $(LIB_THREAD)
34 SEARCH_DIRS = -I ../../include
37 SEARCH_DIRS += -I/usr/local/include
38 CXXFLAGS += -DHAVE_DECL_GETOPT=1
42 SEARCH_DIRS += -I/usr/local/include
43 CXXFLAGS += -DHAVE_DECL_GETOPT=1
46 OBJS = $(notdir $(patsubst %.cpp, %.o, $(patsubst %.c, %.o, $(SRCS))))
48 CXXFLAGS += $(DEFS) $(STGLIBS_INCS) $(SEARCH_DIRS)
49 CFLAGS += $(DEFS) $(STGLIBS_INCS) $(SEARCH_DIRS)
50 LDFLAGS += $(STGLIBS_LIBS)
56 .PHONY: all clean distclean libs install uninstall install-bin install-data uninstall-bin uninstall-data
57 all: libs $(PROG) ../../Makefile.conf
60 $(MAKE) -C $(DIR_LIBSRC)
63 $(CXX) $^ $(LDFLAGS) $(LIBS) -o $(PROG)
66 rm -f deps $(PROG) *.o tags *.*~ .OS
71 $(MAKE) -C $(DIR_LIBSRC) clean
74 rm -f ../../Makefile.conf
80 install -D -m $(BIN_MODE) -o $(OWNER) $(PROG) $(PREFIX)/usr/bin/$(PROG)
82 install -D -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/bin/$(PROG)
84 $(MAKE) -C $(DIR_LIBSRC) install
86 uninstall: uninstall-bin
89 rm -f $(PREFIX)/usr/sbin/$(PROG)
92 ifneq ($(MAKECMDGOALS),distclean)
93 ifneq ($(MAKECMDGOALS),clean)
94 ifneq ($(MAKECMDGOALS),uninstall)
100 deps: $(SRCS) ../../Makefile.conf
101 $(MAKE) -C $(DIR_LIBSRC)
103 for file in $(SRCS); do\
104 echo "$$file" | grep ".c$$" > /dev/null;\
107 echo "`$(CC) $(CFLAGS) -MM $$file` Makefile" >> deps ;\
108 printf '%b\n' '\t$$(CC) $(CFLAGS) -c $$<' >> deps ;\
110 echo "`$(CXX) $(CXXFLAGS) -MM $$file` Makefile" >> deps ;\
111 printf '%b\n' '\t$$(CXX) $(CXXFLAGS) -c $$<' >> deps ;\