1 ###############################################################################
2 # $Id: Makefile,v 1.21 2010/02/11 12:34:14 faust Exp $
3 ###############################################################################
5 include ../../Makefile.conf
12 STGLIBS = -lconffiles \
27 SEARCH_DIRS = -I $(DIR_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))))
42 LDFLAGS += -Wl,-E -L$(DIR_LIB) -Wl,-rpath,$(PREFIX)/usr/lib/stg -Wl,-rpath-link,$(DIR_LIB)
46 .PHONY: all clean distclean libs install uninstall install-bin install-data uninstall-bin uninstall-data
47 all: libs $(PROG) ../../Makefile.conf
50 $(MAKE) -C $(DIR_LIBSRC)
52 $(PROG): $(OBJS) $(STGLIBS)
53 $(CC) $^ $(LDFLAGS) $(LIBS) -o $(PROG)
56 rm -f deps $(PROG) *.o tags *.*~ .OS
61 $(MAKE) -C $(DIR_LIBSRC) clean
64 rm -f ../../Makefile.conf
66 install: install-bin install-data
69 mkdir -m $(BIN_MODE) -p $(PREFIX)/usr/sbin
70 install -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/sbin/$(PROG)
71 $(MAKE) -C $(DIR_LIBSRC) install
75 uninstall: uninstall-bin uninstall-data
78 rm -f $(PREFIX)/usr/sbin/$(PROG)
83 ifneq ($(MAKECMDGOALS),distclean)
84 ifneq ($(MAKECMDGOALS),clean)
85 ifneq ($(MAKECMDGOALS),uninstall)
91 deps: $(SRCS) ../../Makefile.conf
92 $(MAKE) -C $(DIR_LIBSRC) includes
94 for file in $(SRCS); do\
95 echo "`$(CC) $(CXXFLAGS) $(SEARCH_DIRS) -MM $$file` Makefile" >> deps ;\
96 echo -e '\t$$(CC) -c $$< $(CXXFLAGS) $(SEARCH_DIRS) $(DEFS)' >> deps ;\