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 = -lstgcommon \
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 install -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/lib/$(PROG)
57 $(MAKE) -C $(DIR_LIBSRC) install
59 uninstall: uninstall-bin
62 rm -f $(PREFIX)/usr/lib/$(PROG)
64 ifneq ($(MAKECMDGOALS),distclean)
65 ifneq ($(MAKECMDGOALS),clean)
66 ifneq ($(MAKECMDGOALS),uninstall)
72 deps: $(SRCS) ../../Makefile.conf
73 $(MAKE) -C $(DIR_LIBSRC) includes
75 for file in $(SRCS); do\
76 echo "`$(CC) $(CXXFLAGS) $(SEARCH_DIRS) -MM $$file` Makefile" >> deps ;\
77 echo -e '\t$$(CC) -c $$< $(CXXFLAGS) $(SEARCH_DIRS) $(DEFS)' >> deps ;\