1 ###############################################################################
2 # $Id: Makefile,v 1.5 2009/03/03 15:49:34 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)
31 SEARCH_DIRS = -I ../../include
33 OBJS = $(notdir $(patsubst %.cpp, %.o, $(patsubst %.c, %.o, $(SRCS))))
35 CXXFLAGS += -fPIC $(DEFS) $(STGLIBS_INCS) $(SEARCH_DIRS)
36 CFLAGS += $(DEFS) $(STGLIBS_INCS) $(SEARCH_DIRS)
37 LDFLAGS += -shared -Wl,-rpath,$(PREFIX)/usr/lib/stg -Wl,-E $(STGLIBS_LIBS)
39 .PHONY: all clean distclean libs install uninstall install-bin uninstall-bin
40 all: libs $(PROG) ../../Makefile.conf
43 $(MAKE) -C $(DIR_LIBSRC)
46 $(CXX) $^ $(LDFLAGS) -o $(PROG) $(LIBS)
49 rm -f deps $(PROG) *.o tags *.*~ .OS
52 $(MAKE) -C $(DIR_LIBSRC) clean
55 rm -f ../../Makefile.conf
61 install -D -m $(BIN_MODE) -o $(OWNER) $(PROG) $(PREFIX)/usr/lib/freeradius/$(PROG)
63 install -D -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/lib/freeradius/$(PROG)
65 $(MAKE) -C $(DIR_LIBSRC) install
67 uninstall: uninstall-bin
70 rm -f $(PREFIX)/usr/lib/freeradius/$(PROG)
72 ifneq ($(MAKECMDGOALS),distclean)
73 ifneq ($(MAKECMDGOALS),clean)
74 ifneq ($(MAKECMDGOALS),uninstall)
80 deps: $(SRCS) ../../Makefile.conf
81 $(MAKE) -C $(DIR_LIBSRC)
83 for file in $(SRCS); do\
84 echo "$$file" | grep ".c$$" > /dev/null;\
87 echo "`$(CC) $(CFLAGS) -MM $$file` Makefile" >> deps ;\
88 printf '%b\n' '\t$$(CC) $(CFLAGS) -c $$<' >> deps ;\
90 echo "`$(CXX) $(CXXFLAGS) -MM $$file` Makefile" >> deps ;\
91 printf '%b\n' '\t$$(CXX) $(CXXFLAGS) -c $$<' >> deps ;\