1 ###############################################################################
2 # $Id: Makefile,v 1.5 2009/03/03 15:49:34 faust Exp $
3 ###############################################################################
5 include ../../Makefile.conf
19 STGLIBS_INCS = $(addprefix -I ../../stglibs/,$(addsuffix .lib/include,$(STGLIBS)))
20 STGLIBS_LIBS = $(addprefix -L ../../stglibs/,$(addsuffix .lib,$(STGLIBS)))
22 LIBS += $(addprefix -lstg,$(STGLIBS)) $(LIB_THREAD) $(LIBICONV)
31 SEARCH_DIRS = -I ../../include
33 OBJS = $(notdir $(patsubst %.cpp, %.o, $(patsubst %.c, %.o, $(SRCS))))
35 CFLAGS += -fPIC $(DEFS) $(STGLIBS_INCS) $(SEARCH_DIRS)
36 CXXFLAGS += -fPIC $(DEFS) $(STGLIBS_INCS) $(SEARCH_DIRS)
37 CFLAGS += $(DEFS) $(STGLIBS_INCS) $(SEARCH_DIRS)
38 LDFLAGS += -shared -Wl,-rpath,$(PREFIX)/usr/lib/stg -Wl,-E $(STGLIBS_LIBS)
40 .PHONY: all clean distclean libs install uninstall install-bin uninstall-bin
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
53 $(MAKE) -C $(DIR_LIBSRC) clean
56 rm -f ../../Makefile.conf
63 mkdir -m $(DIR_MODE) -p $(PREFIX)/usr/lib/freeradius
64 install -m $(BIN_MODE) -o $(OWNER) $(PROG) $(PREFIX)/usr/lib/freeradius/$(PROG)
66 mkdir -m $(DIR_MODE) -p $(PREFIX)/usr/lib
67 install -m $(BIN_MODE) -o $(OWNER) $(PROG) $(PREFIX)/usr/lib/$(PROG)
70 mkdir -m $(DIR_MODE) -p $(PREFIX)/usr/lib/freeradius
71 install -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/lib/freeradius/$(PROG)
73 mkdir -m $(DIR_MODE) -p $(PREFIX)/usr/lib/freeradius
74 install -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/lib/freeradius/$(PROG)
76 mkdir -m $(DIR_MODE) -p $(PREFIX)/usr/lib
77 install -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/lib/$(PROG)
80 $(MAKE) -C $(DIR_LIBSRC) install
82 uninstall: uninstall-bin
86 rm -f $(PREFIX)/usr/lib/freeradius/$(PROG)
88 rm -f $(PREFIX)/usr/lib/$(PROG)
91 ifneq ($(MAKECMDGOALS),distclean)
92 ifneq ($(MAKECMDGOALS),clean)
93 ifneq ($(MAKECMDGOALS),uninstall)
99 deps: $(SRCS) ../../Makefile.conf
100 $(MAKE) -C $(DIR_LIBSRC)
102 for file in $(SRCS); do\
103 echo "$$file" | grep ".c$$" > /dev/null;\
106 echo "`$(CC) $(CFLAGS) -MM $$file` Makefile" >> deps ;\
107 printf '%b\n' '\t$$(CC) $(CFLAGS) -c $$<' >> deps ;\
109 echo "`$(CXX) $(CXXFLAGS) -MM $$file` Makefile" >> deps ;\
110 printf '%b\n' '\t$$(CXX) $(CXXFLAGS) -c $$<' >> deps ;\