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)
32 SEARCH_DIRS = -I ../../include
34 OBJS = $(notdir $(patsubst %.cpp, %.o, $(patsubst %.c, %.o, $(SRCS))))
36 CXXFLAGS += $(DEFS) $(STGLIBS_INCS) $(SEARCH_DIRS)
37 CFLAGS += $(DEFS) $(STGLIBS_INCS) $(SEARCH_DIRS)
38 LDFLAGS += $(STGLIBS_LIBS)
40 .PHONY: all clean distclean libs install uninstall install-bin install-data uninstall-bin uninstall-data
41 all: libs $(PROG) ../../Makefile.conf
44 $(MAKE) -C $(DIR_LIBSRC)
47 $(CXX) $^ $(LDFLAGS) -o $(PROG) $(LIBS)
50 rm -f deps $(PROG) *.o tags *.*~ .OS
56 $(MAKE) -C $(DIR_LIBSRC) clean
59 rm -f ../../Makefile.conf
61 install: install-bin install-data
65 install $(D_FLAG) -m $(BIN_MODE) -o $(OWNER) $(PROG) $(PREFIX)/usr/sbin/$(PROG)
67 install $(D_FLAG) -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/sbin/$(PROG)
69 $(MAKE) -C $(DIR_LIBSRC) install
73 mkdir -m $(DIR_MODE) -p $(PREFIX)/etc
74 install -m $(DATA_MODE) -o $(OWNER) ./sgauth.conf $(PREFIX)/etc/sgauth.conf
76 uninstall: uninstall-bin uninstall-data
79 rm -f $(PREFIX)/usr/sbin/$(PROG)
83 rm -f $(PREFIX)/etc/sgauth.conf
86 ifneq ($(MAKECMDGOALS),distclean)
87 ifneq ($(MAKECMDGOALS),clean)
88 ifneq ($(MAKECMDGOALS),uninstall)
94 deps: $(SRCS) ../../Makefile.conf sgauth.css
95 $(MAKE) -C $(DIR_LIBSRC)
98 for file in $(SRCS); do\
99 echo "$$file" | grep ".c$$" > /dev/null;\
102 echo "`$(CC) $(CFLAGS) -MM $$file` Makefile" >> deps ;\
103 printf '%b\n' '\t$$(CC) $(CFLAGS) -c $$<' >> deps ;\
105 echo "`$(CXX) $(CXXFLAGS) -MM $$file` Makefile" >> deps ;\
106 printf '%b\n' '\t$$(CXX) $(CXXFLAGS) -c $$<' >> deps ;\