1 ###############################################################################
2 # $Id: Makefile,v 1.21 2010/02/11 12:34:14 faust Exp $
3 ###############################################################################
5 include ../../Makefile.conf
21 STGLIBS_INCS = $(addprefix -I ../../stglibs/,$(addsuffix .lib/include,$(STGLIBS)))
22 STGLIBS_LIBS = $(addprefix -L ../../stglibs/,$(addsuffix .lib,$(STGLIBS)))
24 LIBS += $(addprefix -lstg,$(STGLIBS)) -lexpat $(LIB_THREAD)
32 SEARCH_DIRS = -I ../../include
35 SEARCH_DIRS += -I/usr/local/include
36 CXXFLAGS += -DHAVE_DECL_GETOPT=1
40 SEARCH_DIRS += -I/usr/local/include
41 CXXFLAGS += -DHAVE_DECL_GETOPT=1
44 OBJS = $(notdir $(patsubst %.cpp, %.o, $(patsubst %.c, %.o, $(SRCS))))
46 CXXFLAGS += $(DEFS) $(STGLIBS_INCS) $(SEARCH_DIRS)
47 CFLAGS += $(DEFS) $(STGLIBS_INCS) $(SEARCH_DIRS)
48 LDFLAGS += $(STGLIBS_LIBS)
54 .PHONY: all clean distclean libs install uninstall install-bin install-data uninstall-bin uninstall-data
55 all: libs $(PROG) ../../Makefile.conf
58 $(MAKE) -C $(DIR_LIBSRC)
61 $(CXX) $^ $(LDFLAGS) $(LIBS) -o $(PROG)
64 rm -f deps $(PROG) *.o tags *.*~ .OS
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 ;\