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) $(LIBICONV)
24 SEARCH_DIRS = -I ../../include
26 OBJS = $(notdir $(patsubst %.cpp, %.o, $(patsubst %.c, %.o, $(SRCS))))
28 CXXFLAGS += $(DEFS) $(STGLIBS_INCS) $(SEARCH_DIRS)
29 CFLAGS += $(DEFS) $(STGLIBS_INCS) $(SEARCH_DIRS)
35 LDFLAGS += $(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 mkdir -m $(DIR_MODE) -p $(PREFIX)/usr/sbin
62 install -m $(BIN_MODE) -o $(OWNER) $(PROG) $(PREFIX)/usr/sbin/$(PROG)
64 mkdir -m $(DIR_MODE) -p $(PREFIX)/usr/sbin
65 install -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/sbin/$(PROG)
67 $(MAKE) -C $(DIR_LIBSRC) install
71 mkdir -m $(DIR_MODE) -p $(PREFIX)/etc/rscriptd
72 install -m $(DATA_MODE) -o $(OWNER) ./rscriptd.conf $(PREFIX)/etc/rscriptd/rscriptd.conf
74 mkdir -m $(DIR_MODE) -p $(PREFIX)/etc/rscriptd
75 install -m $(BIN_MODE) -o $(OWNER) ../stargazer/inst/linux/etc/stargazer/OnConnect $(PREFIX)/etc/rscriptd/
76 install -m $(BIN_MODE) -o $(OWNER) ../stargazer/inst/linux/etc/stargazer/OnDisconnect $(PREFIX)/etc/rscriptd/
78 mkdir -m $(DIR_MODE) -p $(PREFIX)/etc/rscriptd
79 install -m $(BIN_MODE) -o $(OWNER) ../stargazer/inst/freebsd/etc/stargazer/OnConnect $(PREFIX)/etc/rscriptd/
80 install -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 ;\