1 ###############################################################################
2 # $Id: Makefile,v 1.21 2010/02/11 12:34:14 faust Exp $
3 ###############################################################################
5 include ../../Makefile.conf
24 STGLIBS_INCS = $(addprefix -I ../../stglibs/,$(addsuffix .lib/include,$(STGLIBS)))
25 STGLIBS_LIBS = $(addprefix -L ../../stglibs/,$(addsuffix .lib,$(STGLIBS)))
27 LIBS += $(addprefix -lstg,$(STGLIBS)) -lexpat $(LIB_THREAD)
35 SEARCH_DIRS = -I ../../include
38 SEARCH_DIRS += -I/usr/local/include
39 CXXFLAGS += -DHAVE_DECL_GETOPT=1
43 SEARCH_DIRS += -I/usr/local/include
44 CXXFLAGS += -DHAVE_DECL_GETOPT=1
47 OBJS = $(notdir $(patsubst %.cpp, %.o, $(patsubst %.c, %.o, $(SRCS))))
49 CXXFLAGS += $(DEFS) $(STGLIBS_INCS) $(SEARCH_DIRS)
50 CFLAGS += $(DEFS) $(STGLIBS_INCS) $(SEARCH_DIRS)
51 LDFLAGS += $(STGLIBS_LIBS)
57 .PHONY: all clean distclean libs install uninstall install-bin install-data uninstall-bin uninstall-data
58 all: libs $(PROG) ../../Makefile.conf
61 $(MAKE) -C $(DIR_LIBSRC)
64 $(CXX) $^ $(LDFLAGS) $(LIBS) -o $(PROG)
67 rm -f deps $(PROG) *.o
68 $(MAKE) -C $(DIR_LIBSRC) clean
71 rm -f ../../Makefile.conf
77 install -D -m $(BIN_MODE) -o $(OWNER) $(PROG) $(PREFIX)/usr/bin/$(PROG)
79 install -D -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/bin/$(PROG)
81 $(MAKE) -C $(DIR_LIBSRC) install
83 uninstall: uninstall-bin
86 rm -f $(PREFIX)/usr/sbin/$(PROG)
89 ifneq ($(MAKECMDGOALS),distclean)
90 ifneq ($(MAKECMDGOALS),clean)
91 ifneq ($(MAKECMDGOALS),uninstall)
97 deps: $(SRCS) ../../Makefile.conf
98 $(MAKE) -C $(DIR_LIBSRC)
100 for file in $(SRCS); do\
101 echo "$$file" | grep ".c$$" > /dev/null;\
104 echo "`$(CC) $(CFLAGS) -MM $$file` Makefile" >> deps ;\
105 printf '%b\n' '\t$$(CC) $(CFLAGS) -c $$<' >> deps ;\
107 echo "`$(CXX) $(CXXFLAGS) -MM $$file` Makefile" >> deps ;\
108 printf '%b\n' '\t$$(CXX) $(CXXFLAGS) -c $$<' >> deps ;\