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)
39 LDFLAGS += $(STGLIBS_LIBS)
41 .PHONY: all clean distclean libs install uninstall
42 all: libs $(PROG) ../../Makefile.conf
45 $(MAKE) -C $(DIR_LIBSRC)
48 $(CXX) $^ $(LDFLAGS) $(LIBS) -o $(PROG)
51 rm -f deps $(PROG) *.o tags *.*~ .OS
56 $(MAKE) -C $(DIR_LIBSRC) clean
59 rm -f ../../Makefile.conf
61 install: install-bin install-data
65 install -D -m $(BIN_MODE) -o $(OWNER) $(PROG) $(PREFIX)/usr/sbin/$(PROG)
67 install -D -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/sbin/$(PROG)
69 $(MAKE) -C $(DIR_LIBSRC) install
73 mkdir -m $(DIR_MODE) -p $(PREFIX)/etc/rscriptd
74 install -m $(DATA_MODE) -o $(OWNER) ./rscriptd.conf $(PREFIX)/etc/rscriptd/rscriptd.conf
76 install -D -m $(BIN_MODE) -o $(OWNER) ../stargazer/inst/linux/etc/stargazer/OnConnect $(PREFIX)/etc/rscriptd/
77 install -D -m $(BIN_MODE) -o $(OWNER) ../stargazer/inst/linux/etc/stargazer/OnDisconnect $(PREFIX)/etc/rscriptd/
79 install -D -m $(BIN_MODE) -o $(OWNER) ../stargazer/inst/freebsd/etc/stargazer/OnConnect $(PREFIX)/etc/rscriptd/
80 install -D -m $(BIN_MODE) -o $(OWNER) ../stargazer/inst/freebsd/etc/stargazer/OnDisconnect $(PREFIX)/etc/rscriptd/
83 uninstall: uninstall-bin uninstall-data
86 rm -f $(PREFIX)/usr/sbin/$(PROG)
90 rm -f $(PREFIX)/etc/rscriptd/rscriptd.conf
91 rm -f $(PREFIX)/etc/rscriptd/OnConnect
92 rm -f $(PREFIX)/etc/rscriptd/OnDisconnect
94 ifneq ($(MAKECMDGOALS),distclean)
95 ifneq ($(MAKECMDGOALS),clean)
96 ifneq ($(MAKECMDGOALS),uninstall)
102 deps: $(SRCS) ../../Makefile.conf
103 $(MAKE) -C $(DIR_LIBSRC)
105 for file in $(SRCS); do\
106 echo "$$file" | grep ".c$$" > /dev/null;\
109 echo "`$(CC) $(CFLAGS) -MM $$file` Makefile" >> deps ;\
110 printf '%b\n' '\t$$(CC) $(CFLAGS) -c $$<' >> deps ;\
112 echo "`$(CXX) $(CXXFLAGS) -MM $$file` Makefile" >> deps ;\
113 printf '%b\n' '\t$$(CXX) $(CXXFLAGS) -c $$<' >> deps ;\