1 ###############################################################################
2 # $Id: Makefile,v 1.3 2008/05/11 09:30:43 nobunaga Exp $
3 ###############################################################################
5 include ../../Makefile.conf
35 SEARCH_DIRS = -I $(DIR_INCLUDE)
37 OBJS = $(notdir $(patsubst %.cpp, %.o, $(patsubst %.c, %.o, $(SRCS))))
42 LDFLAGS += -Wl,-E -L$(DIR_LIB) -Wl,-rpath,$(PREFIX)/usr/lib/stg
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) $(LIBS)
53 $(CC) $^ $(LDFLAGS) -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 install -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/sbin/$(PROG)
70 $(MAKE) -C $(DIR_LIBSRC) install
74 install -m $(DATA_MODE) -o $(OWNER) -D $(ETC_DIR)/sgconf.conf $(PREFIX)/etc/stargazer/sgconf.conf
76 uninstall: uninstall-bin uninstall-data
79 rm -f $(PREFIX)/usr/sbin/$(PROG)
83 rm -f $(PREFIX)/etc/stargazer/sgconf.conf
86 ifneq ($(MAKECMDGOALS),distclean)
87 ifneq ($(MAKECMDGOALS),clean)
88 ifneq ($(MAKECMDGOALS),uninstall)
94 deps: $(SRCS) ../../Makefile.conf
95 $(MAKE) -C $(DIR_LIBSRC) includes
97 for file in $(SRCS); do\
98 echo "`$(CC) $(CFLAGS) $(SEARCH_DIRS) -MM $$file` Makefile" >> deps ;\
99 echo -e '\t$$(CC) -c $$< $(CFLAGS) $(SEARCH_DIRS) $(DEFS)' >> deps ;\