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 install -D -m $(BIN_MODE) -o $(OWNER) ../stargazer/inst/linux/etc/stargazer/OnConnect $(PREFIX)/etc/rscriptd/
73 install -D -m $(BIN_MODE) -o $(OWNER) ../stargazer/inst/linux/etc/stargazer/OnDisconnect $(PREFIX)/etc/rscriptd/
75 install -D -m $(BIN_MODE) -o $(OWNER) ../stargazer/inst/freebsd/etc/stargazer/OnConnect $(PREFIX)/etc/rscriptd/
76 install -D -m $(BIN_MODE) -o $(OWNER) ../stargazer/inst/freebsd/etc/stargazer/OnDisconnect $(PREFIX)/etc/rscriptd/
79 uninstall: uninstall-bin uninstall-data
82 rm -f $(PREFIX)/usr/sbin/$(PROG)
86 rm -f $(PREFIX)/etc/rscriptd/rscriptd.conf
87 rm -f $(PREFIX)/etc/rscriptd/OnConnect
88 rm -f $(PREFIX)/etc/rscriptd/OnDisconnect
90 ifneq ($(MAKECMDGOALS),distclean)
91 ifneq ($(MAKECMDGOALS),clean)
92 ifneq ($(MAKECMDGOALS),uninstall)
98 deps: $(SRCS) ../../Makefile.conf
99 $(MAKE) -C $(DIR_LIBSRC)
101 for file in $(SRCS); do\
102 echo "$$file" | grep ".c$$" > /dev/null;\
105 echo "`$(CC) $(CFLAGS) -MM $$file` Makefile" >> deps ;\
106 printf '%b\n' '\t$$(CC) $(CFLAGS) -c $$<' >> deps ;\
108 echo "`$(CXX) $(CXXFLAGS) -MM $$file` Makefile" >> deps ;\
109 printf '%b\n' '\t$$(CXX) $(CXXFLAGS) -c $$<' >> deps ;\