1 ###############################################################################
2 # $Id: Makefile,v 1.5 2009/03/03 15:49:34 faust Exp $
3 ###############################################################################
5 include ../../Makefile.conf
21 STGLIBS_INCS = $(addprefix -I ../../stglibs/,$(addsuffix .lib/include,$(STGLIBS)))
22 STGLIBS_LIBS = $(addprefix -L ../../stglibs/,$(addsuffix .lib,$(STGLIBS)))
24 LIBS += $(addprefix -lstg,$(STGLIBS)) $(LIB_THREAD) $(LIBICONV)
35 SEARCH_DIRS = -I ../../include
37 OBJS = $(notdir $(patsubst %.cpp, %.o, $(patsubst %.c, %.o, $(SRCS))))
39 CFLAGS += -fPIC $(DEFS) $(STGLIBS_INCS) $(SEARCH_DIRS)
40 CXXFLAGS += -fPIC $(DEFS) $(STGLIBS_INCS) $(SEARCH_DIRS)
41 CFLAGS += $(DEFS) $(STGLIBS_INCS) $(SEARCH_DIRS)
42 LDFLAGS += -shared -Wl,-rpath,$(PREFIX)/usr/lib/stg -Wl,-E $(STGLIBS_LIBS)
44 .PHONY: all clean distclean libs install uninstall install-bin uninstall-bin
45 all: libs $(PROG) ../../Makefile.conf
48 $(MAKE) -C $(DIR_LIBSRC)
51 $(CXX) $^ $(LDFLAGS) -o $(PROG) $(LIBS)
54 rm -f deps $(PROG) *.o tags *.*~ .OS
57 $(MAKE) -C $(DIR_LIBSRC) clean
60 rm -f ../../Makefile.conf
67 mkdir -m $(DIR_MODE) -p $(PREFIX)/usr/lib/freeradius
68 install -m $(BIN_MODE) -o $(OWNER) $(PROG) $(PREFIX)/usr/lib/freeradius/$(PROG)
70 mkdir -m $(DIR_MODE) -p $(PREFIX)/usr/lib
71 install -m $(BIN_MODE) -o $(OWNER) $(PROG) $(PREFIX)/usr/lib/$(PROG)
74 mkdir -m $(DIR_MODE) -p $(PREFIX)/usr/lib/freeradius
75 install -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/lib/freeradius/$(PROG)
77 mkdir -m $(DIR_MODE) -p $(PREFIX)/usr/lib/freeradius
78 install -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/lib/freeradius/$(PROG)
80 mkdir -m $(DIR_MODE) -p $(PREFIX)/usr/lib
81 install -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/lib/$(PROG)
84 $(MAKE) -C $(DIR_LIBSRC) install
86 uninstall: uninstall-bin
90 rm -f $(PREFIX)/usr/lib/freeradius/$(PROG)
92 rm -f $(PREFIX)/usr/lib/$(PROG)
95 ifneq ($(MAKECMDGOALS),distclean)
96 ifneq ($(MAKECMDGOALS),clean)
97 ifneq ($(MAKECMDGOALS),uninstall)
103 deps: $(SRCS) ../../Makefile.conf
104 $(MAKE) -C $(DIR_LIBSRC)
106 for file in $(SRCS); do\
107 echo "$$file" | grep ".c$$" > /dev/null;\
110 echo "`$(CC) $(CFLAGS) -MM $$file` Makefile" >> deps ;\
111 printf '%b\n' '\t$$(CC) $(CFLAGS) -c $$<' >> deps ;\
113 echo "`$(CXX) $(CXXFLAGS) -MM $$file` Makefile" >> deps ;\
114 printf '%b\n' '\t$$(CXX) $(CXXFLAGS) -c $$<' >> deps ;\