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)
31 SEARCH_DIRS = -I ../../include
33 OBJS = $(notdir $(patsubst %.cpp, %.o, $(patsubst %.c, %.o, $(SRCS))))
35 CXXFLAGS += $(DEFS) $(STGLIBS_INCS) $(SEARCH_DIRS)
36 CFLAGS += $(DEFS) $(STGLIBS_INCS) $(SEARCH_DIRS)
42 LDFLAGS += $(STGLIBS_LIBS)
44 .PHONY: all clean distclean libs install uninstall
45 all: libs $(PROG) ../../Makefile.conf
48 $(MAKE) -C $(DIR_LIBSRC)
51 $(CXX) $^ $(LDFLAGS) $(LIBS) -o $(PROG)
54 rm -f deps $(PROG) *.o tags *.*~ .OS
59 $(MAKE) -C $(DIR_LIBSRC) clean
62 rm -f ../../Makefile.conf
64 install: install-bin install-data
68 install $(D_FLAG) -m $(BIN_MODE) -o $(OWNER) $(PROG) $(PREFIX)/usr/sbin/$(PROG)
70 install $(D_FLAG) -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/sbin/$(PROG)
72 $(MAKE) -C $(DIR_LIBSRC) install
76 mkdir -m $(DIR_MODE) -p $(PREFIX)/etc/rscriptd
77 install -m $(DATA_MODE) -o $(OWNER) ./rscriptd.conf $(PREFIX)/etc/rscriptd/rscriptd.conf
79 install $(D_FLAG) -m $(BIN_MODE) -o $(OWNER) ../stargazer/inst/linux/etc/stargazer/OnConnect $(PREFIX)/etc/rscriptd/
80 install $(D_FLAG) -m $(BIN_MODE) -o $(OWNER) ../stargazer/inst/linux/etc/stargazer/OnDisconnect $(PREFIX)/etc/rscriptd/
82 install $(D_FLAG) -m $(BIN_MODE) -o $(OWNER) ../stargazer/inst/freebsd/etc/stargazer/OnConnect $(PREFIX)/etc/rscriptd/
83 install $(D_FLAG) -m $(BIN_MODE) -o $(OWNER) ../stargazer/inst/freebsd/etc/stargazer/OnDisconnect $(PREFIX)/etc/rscriptd/
86 uninstall: uninstall-bin uninstall-data
89 rm -f $(PREFIX)/usr/sbin/$(PROG)
93 rm -f $(PREFIX)/etc/rscriptd/rscriptd.conf
94 rm -f $(PREFIX)/etc/rscriptd/OnConnect
95 rm -f $(PREFIX)/etc/rscriptd/OnDisconnect
97 ifneq ($(MAKECMDGOALS),distclean)
98 ifneq ($(MAKECMDGOALS),clean)
99 ifneq ($(MAKECMDGOALS),uninstall)
105 deps: $(SRCS) ../../Makefile.conf
106 $(MAKE) -C $(DIR_LIBSRC)
108 for file in $(SRCS); do\
109 echo "$$file" | grep ".c$$" > /dev/null;\
112 echo "`$(CC) $(CFLAGS) -MM $$file` Makefile" >> deps ;\
113 printf '%b\n' '\t$$(CC) $(CFLAGS) -c $$<' >> deps ;\
115 echo "`$(CXX) $(CXXFLAGS) -MM $$file` Makefile" >> deps ;\
116 printf '%b\n' '\t$$(CXX) $(CXXFLAGS) -c $$<' >> deps ;\