1 ###############################################################################
2 # $Id: Makefile,v 1.5 2009/03/03 15:49:34 faust Exp $
3 ###############################################################################
5 include ../../Makefile.conf
20 STGLIBS_INCS = $(addprefix -I ../../stglibs/,$(addsuffix .lib/include,$(STGLIBS)))
21 STGLIBS_LIBS = $(addprefix -L ../../stglibs/,$(addsuffix .lib,$(STGLIBS)))
23 LIBS += $(addprefix -lstg,$(STGLIBS)) $(LIB_THREAD) $(LIBICONV)
34 SEARCH_DIRS = -I ../../include
36 OBJS = $(notdir $(patsubst %.cpp, %.o, $(patsubst %.c, %.o, $(SRCS))))
38 CFLAGS += -fPIC $(DEFS) $(STGLIBS_INCS) $(SEARCH_DIRS)
39 CXXFLAGS += -fPIC $(DEFS) $(STGLIBS_INCS) $(SEARCH_DIRS)
40 CFLAGS += $(DEFS) $(STGLIBS_INCS) $(SEARCH_DIRS)
41 LDFLAGS += -shared -Wl,-rpath,$(PREFIX)/usr/lib/stg -Wl,-E $(STGLIBS_LIBS)
43 .PHONY: all clean distclean libs install uninstall install-bin uninstall-bin
44 all: libs $(PROG) ../../Makefile.conf
47 $(MAKE) -C $(DIR_LIBSRC)
50 $(CXX) $^ $(LDFLAGS) -o $(PROG) $(LIBS)
53 rm -f deps $(PROG) *.o tags *.*~ .OS
56 $(MAKE) -C $(DIR_LIBSRC) clean
59 rm -f ../../Makefile.conf
66 mkdir -m $(DIR_MODE) -p $(PREFIX)/usr/lib/freeradius
67 install -m $(BIN_MODE) -o $(OWNER) $(PROG) $(PREFIX)/usr/lib/freeradius/$(PROG)
69 mkdir -m $(DIR_MODE) -p $(PREFIX)/usr/lib
70 install -m $(BIN_MODE) -o $(OWNER) $(PROG) $(PREFIX)/usr/lib/$(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/freeradius
77 install -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/lib/freeradius/$(PROG)
79 mkdir -m $(DIR_MODE) -p $(PREFIX)/usr/lib
80 install -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/lib/$(PROG)
83 $(MAKE) -C $(DIR_LIBSRC) install
85 uninstall: uninstall-bin
89 rm -f $(PREFIX)/usr/lib/freeradius/$(PROG)
91 rm -f $(PREFIX)/usr/lib/$(PROG)
94 ifneq ($(MAKECMDGOALS),distclean)
95 ifneq ($(MAKECMDGOALS),clean)
96 ifneq ($(MAKECMDGOALS),uninstall)
102 deps: $(SRCS) ../../Makefile.conf
103 $(MAKE) -C $(DIR_LIBSRC)
105 for file in $(SRCS); do\
106 echo "$$file" | grep ".c$$" > /dev/null;\
109 echo "`$(CC) $(CFLAGS) -MM $$file` Makefile" >> deps ;\
110 printf '%b\n' '\t$$(CC) $(CFLAGS) -c $$<' >> deps ;\
112 echo "`$(CXX) $(CXXFLAGS) -MM $$file` Makefile" >> deps ;\
113 printf '%b\n' '\t$$(CXX) $(CXXFLAGS) -c $$<' >> deps ;\