1 ###############################################################################
2 # $Id: Makefile,v 1.21 2010/02/11 12:34:14 faust Exp $
3 ###############################################################################
5 include ../../Makefile.conf
25 STGLIBS_INCS = $(addprefix -I ../../stglibs/,$(addsuffix .lib/include,$(STGLIBS)))
26 STGLIBS_LIBS = $(addprefix -L ../../stglibs/,$(addsuffix .lib,$(STGLIBS)))
28 LIBS += $(addprefix -lstg,$(STGLIBS)) -lexpat $(LIB_THREAD)
36 SEARCH_DIRS = -I ../../include
39 SEARCH_DIRS += -I/usr/local/include
40 CXXFLAGS += -DHAVE_DECL_GETOPT=1
44 SEARCH_DIRS += -I/usr/local/include
45 CXXFLAGS += -DHAVE_DECL_GETOPT=1
48 OBJS = $(notdir $(patsubst %.cpp, %.o, $(patsubst %.c, %.o, $(SRCS))))
50 CXXFLAGS += $(DEFS) $(STGLIBS_INCS) $(SEARCH_DIRS)
51 CFLAGS += $(DEFS) $(STGLIBS_INCS) $(SEARCH_DIRS)
52 LDFLAGS += $(STGLIBS_LIBS)
58 .PHONY: all clean distclean libs install uninstall install-bin install-data uninstall-bin uninstall-data
59 all: libs $(PROG) ../../Makefile.conf
62 $(MAKE) -C $(DIR_LIBSRC)
65 $(CXX) $^ $(LDFLAGS) $(LIBS) -o $(PROG)
68 rm -f deps $(PROG) *.o
69 $(MAKE) -C $(DIR_LIBSRC) clean
72 rm -f ../../Makefile.conf
78 install -D -m $(BIN_MODE) -o $(OWNER) $(PROG) $(PREFIX)/usr/bin/$(PROG)
80 install -D -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/bin/$(PROG)
82 $(MAKE) -C $(DIR_LIBSRC) install
84 uninstall: uninstall-bin
87 rm -f $(PREFIX)/usr/sbin/$(PROG)
90 ifneq ($(MAKECMDGOALS),distclean)
91 ifneq ($(MAKECMDGOALS),clean)
92 ifneq ($(MAKECMDGOALS),uninstall)
98 deps: $(SRCS) ../../Makefile.conf
99 $(MAKE) -C $(DIR_LIBSRC)
101 for file in $(SRCS); do\
102 echo "$$file" | grep ".c$$" > /dev/null;\
105 echo "`$(CC) $(CFLAGS) -MM $$file` Makefile" >> deps ;\
106 printf '%b\n' '\t$$(CC) $(CFLAGS) -c $$<' >> deps ;\
108 echo "`$(CXX) $(CXXFLAGS) -MM $$file` Makefile" >> deps ;\
109 printf '%b\n' '\t$$(CXX) $(CXXFLAGS) -c $$<' >> deps ;\