1 ###############################################################################
2 # $Id: Makefile,v 1.18 2010/02/11 12:22:01 faust Exp $
3 ###############################################################################
5 include ../../Makefile.conf
13 STGLIBS = scriptexecuter \
19 STGLIBS_INCS = $(addprefix -I ../../stglibs/,$(addsuffix .lib/include,$(STGLIBS)))
20 STGLIBS_LIBS = $(addprefix -L ../../stglibs/,$(addsuffix .lib,$(STGLIBS)))
22 LIBS += $(addprefix -lstg,$(STGLIBS)) $(LIB_THREAD)
28 SEARCH_DIRS = -I ../../include
30 OBJS = $(notdir $(patsubst %.cpp, %.o, $(patsubst %.c, %.o, $(SRCS))))
32 CXXFLAGS += $(DEFS) $(STGLIBS_INCS) $(SEARCH_DIRS)
33 CFLAGS += $(DEFS) $(STGLIBS_INCS) $(SEARCH_DIRS)
34 LDFLAGS += -Wl,-E $(STGLIBS_LIBS)
36 .PHONY: all clean distclean libs install uninstall
37 all: libs $(PROG) ../../Makefile.conf
40 $(MAKE) -C $(DIR_LIBSRC)
43 $(CXX) $^ $(LDFLAGS) $(LIBS) -o $(PROG)
46 rm -f deps $(PROG) *.o tags *.*~ .OS
51 $(MAKE) -C $(DIR_LIBSRC) clean
54 rm -f ../../Makefile.conf
56 install: install-bin install-data
60 install -D -m $(BIN_MODE) -o $(OWNER) $(PROG) $(PREFIX)/usr/sbin/$(PROG)
62 install -D -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/sbin/$(PROG)
64 $(MAKE) -C $(DIR_LIBSRC) install
68 mkdir -m $(DIR_MODE) -p $(PREFIX)/etc/rscriptd
69 install -m $(DATA_MODE) -o $(OWNER) ./rscriptd.conf $(PREFIX)/etc/rscriptd/rscriptd.conf
71 install -D -m $(BIN_MODE) -o $(OWNER) ../stargazer/inst/linux/etc/stargazer/OnConnect $(PREFIX)/etc/rscriptd/
72 install -D -m $(BIN_MODE) -o $(OWNER) ../stargazer/inst/linux/etc/stargazer/OnDisconnect $(PREFIX)/etc/rscriptd/
74 install -D -m $(BIN_MODE) -o $(OWNER) ../stargazer/inst/freebsd/etc/stargazer/OnConnect $(PREFIX)/etc/rscriptd/
75 install -D -m $(BIN_MODE) -o $(OWNER) ../stargazer/inst/freebsd/etc/stargazer/OnDisconnect $(PREFIX)/etc/rscriptd/
78 uninstall: uninstall-bin uninstall-data
81 rm -f $(PREFIX)/usr/sbin/$(PROG)
85 rm -f $(PREFIX)/etc/rscriptd/rscriptd.conf
86 rm -f $(PREFIX)/etc/rscriptd/OnConnect
87 rm -f $(PREFIX)/etc/rscriptd/OnDisconnect
89 ifneq ($(MAKECMDGOALS),distclean)
90 ifneq ($(MAKECMDGOALS),clean)
91 ifneq ($(MAKECMDGOALS),uninstall)
97 deps: $(SRCS) ../../Makefile.conf
98 $(MAKE) -C $(DIR_LIBSRC)
100 for file in $(SRCS); do\
101 echo "$$file" | grep ".c$$" > /dev/null;\
104 echo "`$(CC) $(CFLAGS) -MM $$file` Makefile" >> deps ;\
105 printf '%b\n' '\t$$(CC) $(CFLAGS) -c $$<' >> deps ;\
107 echo "`$(CXX) $(CXXFLAGS) -MM $$file` Makefile" >> deps ;\
108 printf '%b\n' '\t$$(CXX) $(CXXFLAGS) -c $$<' >> deps ;\