1 ###############################################################################
2 # $Id: Makefile,v 1.18 2009/08/06 12:50:55 faust Exp $
3 ###############################################################################
5 include ../../Makefile.conf
18 STGLIBS_INCS = $(addprefix -I ../../stglibs/,$(addsuffix .lib/include,$(STGLIBS)))
19 STGLIBS_LIBS = $(addprefix -L ../../stglibs/,$(addsuffix .lib,$(STGLIBS)))
21 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 install-bin install-data uninstall-bin uninstall-data
38 all: libs $(PROG) ../../Makefile.conf
41 $(MAKE) -C $(DIR_LIBSRC)
44 $(CXX) $^ $(LDFLAGS) -o $(PROG) $(LIBS)
47 rm -f deps $(PROG) *.o tags *.*~ .OS
53 $(MAKE) -C $(DIR_LIBSRC) clean
56 rm -f ../../Makefile.conf
58 install: install-bin install-data
62 install -D -m $(BIN_MODE) -o $(OWNER) $(PROG) $(PREFIX)/usr/sbin/$(PROG)
64 install -D -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/sbin/$(PROG)
66 $(MAKE) -C $(DIR_LIBSRC) install
70 mkdir -m $(DIR_MODE) -p $(PREFIX)/etc
71 install -m $(DATA_MODE) -o $(OWNER) ./sgauth.conf $(PREFIX)/etc/sgauth.conf
73 uninstall: uninstall-bin uninstall-data
76 rm -f $(PREFIX)/usr/sbin/$(PROG)
80 rm -f $(PREFIX)/etc/sgauth.conf
83 ifneq ($(MAKECMDGOALS),distclean)
84 ifneq ($(MAKECMDGOALS),clean)
85 ifneq ($(MAKECMDGOALS),uninstall)
91 deps: $(SRCS) ../../Makefile.conf sgauth.css
92 $(MAKE) -C $(DIR_LIBSRC)
95 for file in $(SRCS); do\
96 echo "$$file" | grep ".c$$" > /dev/null;\
99 echo "`$(CC) $(CFLAGS) -MM $$file` Makefile" >> deps ;\
100 printf '%b\n' '\t$$(CC) $(CFLAGS) -c $$<' >> deps ;\
102 echo "`$(CXX) $(CXXFLAGS) -MM $$file` Makefile" >> deps ;\
103 printf '%b\n' '\t$$(CXX) $(CXXFLAGS) -c $$<' >> deps ;\