1 ###############################################################################
2 # $Id: Makefile,v 1.21 2010/02/11 12:34:14 faust Exp $
3 ###############################################################################
5 include ../../Makefile.conf
22 STGLIBS_INCS = $(addprefix -I ../../stglibs/,$(addsuffix .lib/include,$(STGLIBS)))
23 STGLIBS_LIBS = $(addprefix -L ../../stglibs/,$(addsuffix .lib,$(STGLIBS)))
25 LIBS += $(addprefix -lstg,$(STGLIBS)) -lexpat $(LIB_THREAD)
33 SEARCH_DIRS = -I ../../include
36 SEARCH_DIRS += -I/usr/local/include
37 CXXFLAGS += -DHAVE_DECL_GETOPT=1
41 SEARCH_DIRS += -I/usr/local/include
42 CXXFLAGS += -DHAVE_DECL_GETOPT=1
45 OBJS = $(notdir $(patsubst %.cpp, %.o, $(patsubst %.c, %.o, $(SRCS))))
47 CXXFLAGS += $(DEFS) $(STGLIBS_INCS) $(SEARCH_DIRS)
48 CFLAGS += $(DEFS) $(STGLIBS_INCS) $(SEARCH_DIRS)
49 LDFLAGS += $(STGLIBS_LIBS)
55 .PHONY: all clean distclean libs install uninstall install-bin install-data uninstall-bin uninstall-data
56 all: libs $(PROG) ../../Makefile.conf
59 $(MAKE) -C $(DIR_LIBSRC)
62 $(CXX) $^ $(LDFLAGS) $(LIBS) -o $(PROG)
65 rm -f deps $(PROG) *.o tags *.*~ .OS
70 $(MAKE) -C $(DIR_LIBSRC) clean
73 rm -f ../../Makefile.conf
79 install -D -m $(BIN_MODE) -o $(OWNER) $(PROG) $(PREFIX)/usr/bin/$(PROG)
81 install -D -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/bin/$(PROG)
83 $(MAKE) -C $(DIR_LIBSRC) install
85 uninstall: uninstall-bin
88 rm -f $(PREFIX)/usr/sbin/$(PROG)
91 ifneq ($(MAKECMDGOALS),distclean)
92 ifneq ($(MAKECMDGOALS),clean)
93 ifneq ($(MAKECMDGOALS),uninstall)
99 deps: $(SRCS) ../../Makefile.conf
100 $(MAKE) -C $(DIR_LIBSRC)
102 for file in $(SRCS); do\
103 echo "$$file" | grep ".c$$" > /dev/null;\
106 echo "`$(CC) $(CFLAGS) -MM $$file` Makefile" >> deps ;\
107 printf '%b\n' '\t$$(CC) $(CFLAGS) -c $$<' >> deps ;\
109 echo "`$(CXX) $(CXXFLAGS) -MM $$file` Makefile" >> deps ;\
110 printf '%b\n' '\t$$(CXX) $(CXXFLAGS) -c $$<' >> deps ;\