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)
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)
40 LDFLAGS += $(STGLIBS_LIBS)
42 .PHONY: all clean distclean libs install uninstall
43 all: libs $(PROG) ../../Makefile.conf
46 $(MAKE) -C $(DIR_LIBSRC)
49 $(CXX) $^ $(LDFLAGS) $(LIBS) -o $(PROG)
52 rm -f deps $(PROG) *.o tags *.*~ .OS
57 $(MAKE) -C $(DIR_LIBSRC) clean
60 rm -f ../../Makefile.conf
62 install: install-bin install-data
66 mkdir -m $(DIR_MODE) -p $(PREFIX)/usr/sbin
67 install -m $(BIN_MODE) -o $(OWNER) $(PROG) $(PREFIX)/usr/sbin/$(PROG)
69 mkdir -m $(DIR_MODE) -p $(PREFIX)/usr/sbin
70 install -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 mkdir -m $(DIR_MODE) -p $(PREFIX)/etc/rscriptd
80 install -m $(BIN_MODE) -o $(OWNER) ../stargazer/inst/linux/etc/stargazer/OnConnect $(PREFIX)/etc/rscriptd/
81 install -m $(BIN_MODE) -o $(OWNER) ../stargazer/inst/linux/etc/stargazer/OnDisconnect $(PREFIX)/etc/rscriptd/
83 mkdir -m $(DIR_MODE) -p $(PREFIX)/etc/rscriptd
84 install -m $(BIN_MODE) -o $(OWNER) ../stargazer/inst/freebsd/etc/stargazer/OnConnect $(PREFIX)/etc/rscriptd/
85 install -m $(BIN_MODE) -o $(OWNER) ../stargazer/inst/freebsd/etc/stargazer/OnDisconnect $(PREFIX)/etc/rscriptd/
88 uninstall: uninstall-bin uninstall-data
91 rm -f $(PREFIX)/usr/sbin/$(PROG)
95 rm -f $(PREFIX)/etc/rscriptd/rscriptd.conf
96 rm -f $(PREFIX)/etc/rscriptd/OnConnect
97 rm -f $(PREFIX)/etc/rscriptd/OnDisconnect
99 ifneq ($(MAKECMDGOALS),distclean)
100 ifneq ($(MAKECMDGOALS),clean)
101 ifneq ($(MAKECMDGOALS),uninstall)
107 deps: $(SRCS) ../../Makefile.conf
108 $(MAKE) -C $(DIR_LIBSRC)
110 for file in $(SRCS); do\
111 echo "$$file" | grep ".c$$" > /dev/null;\
114 echo "`$(CC) $(CFLAGS) -MM $$file` Makefile" >> deps ;\
115 printf '%b\n' '\t$$(CC) $(CFLAGS) -c $$<' >> deps ;\
117 echo "`$(CXX) $(CXXFLAGS) -MM $$file` Makefile" >> deps ;\
118 printf '%b\n' '\t$$(CXX) $(CXXFLAGS) -c $$<' >> deps ;\