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)
33 SEARCH_DIRS = -I ../../include
35 OBJS = $(notdir $(patsubst %.cpp, %.o, $(patsubst %.c, %.o, $(SRCS))))
37 CXXFLAGS += -fPIC $(DEFS) $(STGLIBS_INCS) $(SEARCH_DIRS)
38 CFLAGS += $(DEFS) $(STGLIBS_INCS) $(SEARCH_DIRS)
39 LDFLAGS += -shared -Wl,-rpath,$(PREFIX)/usr/lib/stg -Wl,-E $(STGLIBS_LIBS)
41 .PHONY: all clean distclean libs install uninstall install-bin uninstall-bin
42 all: libs $(PROG) ../../Makefile.conf
45 $(MAKE) -C $(DIR_LIBSRC)
48 $(CXX) $^ $(LDFLAGS) -o $(PROG) $(LIBS)
51 rm -f deps $(PROG) *.o tags *.*~ .OS
54 $(MAKE) -C $(DIR_LIBSRC) clean
57 rm -f ../../Makefile.conf
64 install $(D_FLAG) -m $(BIN_MODE) -o $(OWNER) $(PROG) $(PREFIX)/usr/lib/freeradius/$(PROG)
66 install $(D_FLAG) -m $(BIN_MODE) -o $(OWNER) $(PROG) $(PREFIX)/usr/lib/$(PROG)
69 install $(D_FLAG) -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/lib/freeradius/$(PROG)
71 install $(D_FLAG) -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/lib/freeradius/$(PROG)
73 install $(D_FLAG) -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/lib/$(PROG)
76 $(MAKE) -C $(DIR_LIBSRC) install
78 uninstall: uninstall-bin
82 rm -f $(PREFIX)/usr/lib/freeradius/$(PROG)
84 rm -f $(PREFIX)/usr/lib/$(PROG)
87 ifneq ($(MAKECMDGOALS),distclean)
88 ifneq ($(MAKECMDGOALS),clean)
89 ifneq ($(MAKECMDGOALS),uninstall)
95 deps: $(SRCS) ../../Makefile.conf
96 $(MAKE) -C $(DIR_LIBSRC)
98 for file in $(SRCS); do\
99 echo "$$file" | grep ".c$$" > /dev/null;\
102 echo "`$(CC) $(CFLAGS) -MM $$file` Makefile" >> deps ;\
103 printf '%b\n' '\t$$(CC) $(CFLAGS) -c $$<' >> deps ;\
105 echo "`$(CXX) $(CXXFLAGS) -MM $$file` Makefile" >> deps ;\
106 printf '%b\n' '\t$$(CXX) $(CXXFLAGS) -c $$<' >> deps ;\