1 ###############################################################################
2 # $Id: Makefile,v 1.18 2010/02/11 12:22:01 faust Exp $
3 ###############################################################################
5 include ../../Makefile.conf
13 STGLIBS = scriptexecuter \
20 STGLIBS_INCS = $(addprefix -I ../../stglibs/,$(addsuffix .lib/include,$(STGLIBS)))
21 STGLIBS_LIBS = $(addprefix -L ../../stglibs/,$(addsuffix .lib,$(STGLIBS)))
23 LIBS += $(addprefix -lstg,$(STGLIBS)) $(LIB_THREAD)
29 SEARCH_DIRS = -I ../../include
31 OBJS = $(notdir $(patsubst %.cpp, %.o, $(patsubst %.c, %.o, $(SRCS))))
33 CXXFLAGS += $(DEFS) $(STGLIBS_INCS) $(SEARCH_DIRS)
34 CFLAGS += $(DEFS) $(STGLIBS_INCS) $(SEARCH_DIRS)
35 LDFLAGS += -Wl,-E $(STGLIBS_LIBS)
37 .PHONY: all clean distclean libs install uninstall
38 all: libs $(PROG) ../../Makefile.conf
41 $(MAKE) -C $(DIR_LIBSRC)
44 $(CXX) $^ $(LDFLAGS) $(LIBS) -o $(PROG)
47 rm -f deps $(PROG) *.o tags *.*~ .OS
52 $(MAKE) -C $(DIR_LIBSRC) clean
55 rm -f ../../Makefile.conf
57 install: install-bin install-data
61 install -D -m $(BIN_MODE) -o $(OWNER) $(PROG) $(PREFIX)/usr/sbin/$(PROG)
63 install -D -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/sbin/$(PROG)
65 $(MAKE) -C $(DIR_LIBSRC) install
69 mkdir -m $(DIR_MODE) -p $(PREFIX)/etc/rscriptd
70 install -m $(DATA_MODE) -o $(OWNER) ./rscriptd.conf $(PREFIX)/etc/rscriptd/rscriptd.conf
72 uninstall: uninstall-bin uninstall-data
75 rm -f $(PREFIX)/usr/sbin/$(PROG)
79 rm -f $(PREFIX)/etc/rscriptd/rscriptd.conf
82 ifneq ($(MAKECMDGOALS),distclean)
83 ifneq ($(MAKECMDGOALS),clean)
84 ifneq ($(MAKECMDGOALS),uninstall)
90 deps: $(SRCS) ../../Makefile.conf
91 $(MAKE) -C $(DIR_LIBSRC)
93 for file in $(SRCS); do\
94 echo "$$file" | grep ".c$$" > /dev/null;\
97 echo "`$(CC) $(CFLAGS) -MM $$file` Makefile" >> deps ;\
98 printf '%b\n' '\t$$(CC) $(CFLAGS) -c $$<' >> deps ;\
100 echo "`$(CXX) $(CXXFLAGS) -MM $$file` Makefile" >> deps ;\
101 printf '%b\n' '\t$$(CXX) $(CXXFLAGS) -c $$<' >> deps ;\