1 ###############################################################################
2 # $Id: Makefile,v 1.5 2009/03/03 15:49:34 faust Exp $
3 ###############################################################################
5 include ../../Makefile.conf
11 SRCS = ./rlm_stg.cpp \
14 STGLIBS = -lstg_common \
26 SEARCH_DIRS = -I $(DIR_INCLUDE)
28 OBJS = $(notdir $(patsubst %.cpp, %.o, $(patsubst %.c, %.o, $(SRCS))))
30 CXXFLAGS += -Wall -fPIC -I./
31 LDFLAGS += -shared -L$(DIR_LIB) -Wl,-rpath,$(PREFIX)/usr/lib/stg
35 .PHONY: all clean distclean libs install uninstall install-bin uninstall-bin
36 all: libs $(PROG) ../../Makefile.conf
39 $(MAKE) -C $(DIR_LIBSRC)
41 $(PROG): $(OBJS) $(STGLIBS)
42 $(CC) $^ $(LDFLAGS) -o $(PROG) $(LIBS)
45 rm -f deps $(PROG) *.o tags *.*~ .OS
48 $(MAKE) -C $(DIR_LIBSRC) clean
51 rm -f ../../Makefile.conf
56 mkdir -m $(BIN_MODE) -p $(PREFIX)/usr/lib
57 install -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/lib/$(PROG)
58 $(MAKE) -C $(DIR_LIBSRC) install
60 uninstall: uninstall-bin
63 rm -f $(PREFIX)/usr/sbin/$(PROG)
65 ifneq ($(MAKECMDGOALS),distclean)
66 ifneq ($(MAKECMDGOALS),clean)
67 ifneq ($(MAKECMDGOALS),uninstall)
73 deps: $(SRCS) ../../Makefile.conf
74 $(MAKE) -C $(DIR_LIBSRC) includes
76 for file in $(SRCS); do\
77 echo "`$(CC) $(CXXFLAGS) $(SEARCH_DIRS) -MM $$file` Makefile" >> deps ;\
78 echo -e '\t$$(CC) -c $$< $(CXXFLAGS) $(SEARCH_DIRS) $(DEFS)' >> deps ;\