1 ###############################################################################
2 # $Id: Makefile,v 1.21 2010/02/11 12:34:14 faust Exp $
3 ###############################################################################
5 include ../../Makefile.conf
17 STGLIBS_INCS = $(addprefix -I ../../stglibs/,$(addsuffix .lib/include,$(STGLIBS)))
18 STGLIBS_LIBS = $(addprefix -L ../../stglibs/,$(addsuffix .lib,$(STGLIBS)))
20 LIBS += $(addprefix -lstg,$(STGLIBS)) -lexpat $(LIB_THREAD) $(LIBICONV)
27 SEARCH_DIRS = -I ../../include
30 SEARCH_DIRS += -I/usr/local/include
31 CXXFLAGS += -DHAVE_DECL_GETOPT=1
35 SEARCH_DIRS += -I/usr/local/include
36 CXXFLAGS += -DHAVE_DECL_GETOPT=1
39 OBJS = $(notdir $(patsubst %.cpp, %.o, $(patsubst %.c, %.o, $(SRCS))))
41 CXXFLAGS += $(DEFS) $(STGLIBS_INCS) $(SEARCH_DIRS)
42 CFLAGS += $(DEFS) $(STGLIBS_INCS) $(SEARCH_DIRS)
43 LDFLAGS += $(STGLIBS_LIBS)
49 .PHONY: all clean distclean libs install uninstall install-bin install-data uninstall-bin uninstall-data
50 all: libs $(PROG) ../../Makefile.conf
53 $(MAKE) -C $(DIR_LIBSRC)
56 $(CXX) $^ $(LDFLAGS) $(LIBS) -o $(PROG)
59 rm -f deps $(PROG) *.o tags *.*~ .OS
64 $(MAKE) -C $(DIR_LIBSRC) clean
67 rm -f ../../Makefile.conf
73 mkdir -m $(DIR_MODE) -p $(PREFIX)/usr/sbin
74 install -m $(BIN_MODE) -o $(OWNER) $(PROG) $(PREFIX)/usr/sbin/$(PROG)
76 mkdir -m $(DIR_MODE) -p $(PREFIX)/usr/sbin
77 install -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/sbin/$(PROG)
79 $(MAKE) -C $(DIR_LIBSRC) install
81 uninstall: uninstall-bin
84 rm -f $(PREFIX)/usr/sbin/$(PROG)
87 ifneq ($(MAKECMDGOALS),distclean)
88 ifneq ($(MAKECMDGOALS),clean)
89 ifneq ($(MAKECMDGOALS),uninstall)
95 deps: $(SRCS) ../../Makefile.conf
96 $(MAKE) -C $(DIR_LIBSRC)
98 for file in $(SRCS); do\
99 echo "$$file" | grep ".c$$" > /dev/null;\
102 echo "`$(CC) $(CFLAGS) -MM $$file` Makefile" >> deps ;\
103 printf '%b\n' '\t$$(CC) $(CFLAGS) -c $$<' >> deps ;\
105 echo "`$(CXX) $(CXXFLAGS) -MM $$file` Makefile" >> deps ;\
106 printf '%b\n' '\t$$(CXX) $(CXXFLAGS) -c $$<' >> deps ;\