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)
28 SEARCH_DIRS = -I ../../include
31 SEARCH_DIRS += -I/usr/local/include
32 CXXFLAGS += -DHAVE_DECL_GETOPT=1
36 SEARCH_DIRS += -I/usr/local/include
37 CXXFLAGS += -DHAVE_DECL_GETOPT=1
40 OBJS = $(notdir $(patsubst %.cpp, %.o, $(patsubst %.c, %.o, $(SRCS))))
42 CXXFLAGS += $(DEFS) $(STGLIBS_INCS) $(SEARCH_DIRS)
43 CFLAGS += $(DEFS) $(STGLIBS_INCS) $(SEARCH_DIRS)
44 LDFLAGS += $(STGLIBS_LIBS)
50 .PHONY: all clean distclean libs install uninstall install-bin install-data uninstall-bin uninstall-data
51 all: libs $(PROG) ../../Makefile.conf
54 $(MAKE) -C $(DIR_LIBSRC)
57 $(CXX) $^ $(LDFLAGS) $(LIBS) -o $(PROG)
60 rm -f deps $(PROG) *.o tags *.*~ .OS
65 $(MAKE) -C $(DIR_LIBSRC) clean
68 rm -f ../../Makefile.conf
74 install -D -m $(BIN_MODE) -o $(OWNER) $(PROG) $(PREFIX)/usr/bin/$(PROG)
76 install -D -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/bin/$(PROG)
78 $(MAKE) -C $(DIR_LIBSRC) install
80 uninstall: uninstall-bin
83 rm -f $(PREFIX)/usr/sbin/$(PROG)
86 ifneq ($(MAKECMDGOALS),distclean)
87 ifneq ($(MAKECMDGOALS),clean)
88 ifneq ($(MAKECMDGOALS),uninstall)
94 deps: $(SRCS) ../../Makefile.conf
95 $(MAKE) -C $(DIR_LIBSRC)
97 for file in $(SRCS); do\
98 echo "$$file" | grep ".c$$" > /dev/null;\
101 echo "`$(CC) $(CFLAGS) -MM $$file` Makefile" >> deps ;\
102 printf '%b\n' '\t$$(CC) $(CFLAGS) -c $$<' >> deps ;\
104 echo "`$(CXX) $(CXXFLAGS) -MM $$file` Makefile" >> deps ;\
105 printf '%b\n' '\t$$(CXX) $(CXXFLAGS) -c $$<' >> deps ;\