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) $(LIBICONV)
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 += $(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 mkdir -m $(DIR_MODE) -p $(PREFIX)/usr/sbin
63 install -m $(BIN_MODE) -o $(OWNER) $(PROG) $(PREFIX)/usr/sbin/$(PROG)
65 mkdir -m $(DIR_MODE) -p $(PREFIX)/usr/sbin
66 install -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/sbin/$(PROG)
68 $(MAKE) -C $(DIR_LIBSRC) install
72 mkdir -m $(DIR_MODE) -p $(PREFIX)/etc
73 install -m $(DATA_MODE) -o $(OWNER) ./sgauth.conf $(PREFIX)/etc/sgauth.conf
75 uninstall: uninstall-bin uninstall-data
78 rm -f $(PREFIX)/usr/sbin/$(PROG)
82 rm -f $(PREFIX)/etc/sgauth.conf
85 ifneq ($(MAKECMDGOALS),distclean)
86 ifneq ($(MAKECMDGOALS),clean)
87 ifneq ($(MAKECMDGOALS),uninstall)
93 deps: $(SRCS) ../../Makefile.conf sgauth.css
94 $(MAKE) -C $(DIR_LIBSRC)
97 for file in $(SRCS); do\
98 echo "$$file" | grep ".c$$" > /dev/null;\
101 echo "`$(CC) $(CFLAGS) -MM $$file` Makefile" >> deps ;\
102 printf '%b\n' '\t$$(CC) $(CFLAGS) -c $$<' >> deps ;\
104 echo "`$(CXX) $(CXXFLAGS) -MM $$file` Makefile" >> deps ;\
105 printf '%b\n' '\t$$(CXX) $(CXXFLAGS) -c $$<' >> deps ;\