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 += $(LIB_THREAD) $(addprefix -lstg,$(STGLIBS))
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
61 install -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/sbin/$(PROG)
62 $(MAKE) -C $(DIR_LIBSRC) install
66 mkdir -m $(DIR_MODE) -p $(PREFIX)/etc
67 install -m $(DATA_MODE) -o $(OWNER) ./sgauth.conf $(PREFIX)/etc/sgauth.conf
69 uninstall: uninstall-bin uninstall-data
72 rm -f $(PREFIX)/usr/sbin/$(PROG)
76 rm -f $(PREFIX)/etc/sgauth.conf
79 ifneq ($(MAKECMDGOALS),distclean)
80 ifneq ($(MAKECMDGOALS),clean)
81 ifneq ($(MAKECMDGOALS),uninstall)
87 deps: $(SRCS) ../../Makefile.conf sgauth.css
88 $(MAKE) -C $(DIR_LIBSRC)
91 for file in $(SRCS); do\
92 echo "`$(CC) $(CXXFLAGS) -MM $$file` Makefile" >> deps ;\
93 echo -e '\t$$(CC) -c $$< $(CXXFLAGS)' >> deps ;\