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)
32 SEARCH_DIRS = -I ../../include
34 OBJS = $(notdir $(patsubst %.cpp, %.o, $(patsubst %.c, %.o, $(SRCS))))
36 CFLAGS += -fPIC $(DEFS) $(STGLIBS_INCS) $(SEARCH_DIRS)
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 mkdir -m $(DIR_MODE) -p $(PREFIX)/usr/lib/freeradius
65 install -m $(BIN_MODE) -o $(OWNER) $(PROG) $(PREFIX)/usr/lib/freeradius/$(PROG)
67 mkdir -m $(DIR_MODE) -p $(PREFIX)/usr/lib
68 install -m $(BIN_MODE) -o $(OWNER) $(PROG) $(PREFIX)/usr/lib/$(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/freeradius
75 install -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/lib/freeradius/$(PROG)
77 mkdir -m $(DIR_MODE) -p $(PREFIX)/usr/lib
78 install -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/lib/$(PROG)
81 $(MAKE) -C $(DIR_LIBSRC) install
83 uninstall: uninstall-bin
87 rm -f $(PREFIX)/usr/lib/freeradius/$(PROG)
89 rm -f $(PREFIX)/usr/lib/$(PROG)
92 ifneq ($(MAKECMDGOALS),distclean)
93 ifneq ($(MAKECMDGOALS),clean)
94 ifneq ($(MAKECMDGOALS),uninstall)
100 deps: $(SRCS) ../../Makefile.conf
101 $(MAKE) -C $(DIR_LIBSRC)
103 for file in $(SRCS); do\
104 echo "$$file" | grep ".c$$" > /dev/null;\
107 echo "`$(CC) $(CFLAGS) -MM $$file` Makefile" >> deps ;\
108 printf '%b\n' '\t$$(CC) $(CFLAGS) -c $$<' >> deps ;\
110 echo "`$(CXX) $(CXXFLAGS) -MM $$file` Makefile" >> deps ;\
111 printf '%b\n' '\t$$(CXX) $(CXXFLAGS) -c $$<' >> deps ;\