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) $(LIBICONV)
30 SEARCH_DIRS = -I ../../include
32 OBJS = $(notdir $(patsubst %.cpp, %.o, $(patsubst %.c, %.o, $(SRCS))))
34 CXXFLAGS += -fPIC $(DEFS) $(STGLIBS_INCS) $(SEARCH_DIRS)
35 CFLAGS += $(DEFS) $(STGLIBS_INCS) $(SEARCH_DIRS)
36 LDFLAGS += -shared -Wl,-rpath,$(PREFIX)/usr/lib/stg -Wl,-E $(STGLIBS_LIBS)
38 .PHONY: all clean distclean libs install uninstall install-bin uninstall-bin
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
51 $(MAKE) -C $(DIR_LIBSRC) clean
54 rm -f ../../Makefile.conf
61 mkdir -m $(DIR_MODE) -p $(PREFIX)/usr/lib/freeradius
62 install -m $(BIN_MODE) -o $(OWNER) $(PROG) $(PREFIX)/usr/lib/freeradius/$(PROG)
64 mkdir -m $(DIR_MODE) -p $(PREFIX)/usr/lib
65 install -m $(BIN_MODE) -o $(OWNER) $(PROG) $(PREFIX)/usr/lib/$(PROG)
68 mkdir -m $(DIR_MODE) -p $(PREFIX)/usr/lib/freeradius
69 install -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/lib/freeradius/$(PROG)
71 mkdir -m $(DIR_MODE) -p $(PREFIX)/usr/lib/freeradius
72 install -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/lib/freeradius/$(PROG)
74 mkdir -m $(DIR_MODE) -p $(PREFIX)/usr/lib
75 install -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/lib/$(PROG)
78 $(MAKE) -C $(DIR_LIBSRC) install
80 uninstall: uninstall-bin
84 rm -f $(PREFIX)/usr/lib/freeradius/$(PROG)
86 rm -f $(PREFIX)/usr/lib/$(PROG)
89 ifneq ($(MAKECMDGOALS),distclean)
90 ifneq ($(MAKECMDGOALS),clean)
91 ifneq ($(MAKECMDGOALS),uninstall)
97 deps: $(SRCS) ../../Makefile.conf
98 $(MAKE) -C $(DIR_LIBSRC)
100 for file in $(SRCS); do\
101 echo "$$file" | grep ".c$$" > /dev/null;\
104 echo "`$(CC) $(CFLAGS) -MM $$file` Makefile" >> deps ;\
105 printf '%b\n' '\t$$(CC) $(CFLAGS) -c $$<' >> deps ;\
107 echo "`$(CXX) $(CXXFLAGS) -MM $$file` Makefile" >> deps ;\
108 printf '%b\n' '\t$$(CXX) $(CXXFLAGS) -c $$<' >> deps ;\