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)
30 SEARCH_DIRS = -I ../../include
32 OBJS = $(notdir $(patsubst %.cpp, %.o, $(patsubst %.c, %.o, $(SRCS))))
34 CXXFLAGS += $(DEFS) $(STGLIBS_INCS) $(SEARCH_DIRS)
35 CFLAGS += $(DEFS) $(STGLIBS_INCS) $(SEARCH_DIRS)
36 LDFLAGS += $(STGLIBS_LIBS)
38 .PHONY: all clean distclean libs install uninstall install-bin install-data uninstall-bin uninstall-data
39 all: libs $(PROG) ../../Makefile.conf
42 $(MAKE) -C $(DIR_LIBSRC)
45 $(CXX) $^ $(LDFLAGS) -o $(PROG) $(LIBS)
48 rm -f deps $(PROG) *.o tags *.*~ .OS
54 $(MAKE) -C $(DIR_LIBSRC) clean
57 rm -f ../../Makefile.conf
59 install: install-bin install-data
63 mkdir -m $(DIR_MODE) -p $(PREFIX)/usr/sbin
64 install -m $(BIN_MODE) -o $(OWNER) $(PROG) $(PREFIX)/usr/sbin/$(PROG)
66 mkdir -m $(DIR_MODE) -p $(PREFIX)/usr/sbin
67 install -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 ;\