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 \
17 STGLIBS_INCS = $(addprefix -I ../../stglibs/,$(addsuffix .lib/include,$(STGLIBS)))
18 STGLIBS_LIBS = $(addprefix -L ../../stglibs/,$(addsuffix .lib,$(STGLIBS)))
20 LIBS += $(LIB_THREAD) $(addprefix -lstg,$(STGLIBS))
29 SEARCH_DIRS = -I ../../include
31 OBJS = $(notdir $(patsubst %.cpp, %.o, $(patsubst %.c, %.o, $(SRCS))))
33 CXXFLAGS += -fPIC $(DEFS) $(STGLIBS_INCS) $(SEARCH_DIRS)
34 CFLAGS += $(DEFS) $(STGLIBS_INCS) $(SEARCH_DIRS)
35 LDFLAGS += -shared -Wl,-rpath,$(PREFIX)/usr/lib/stg -Wl,-E $(STGLIBS_LIBS)
37 .PHONY: all clean distclean libs install uninstall install-bin uninstall-bin
38 all: libs $(PROG) ../../Makefile.conf
41 $(MAKE) -C $(DIR_LIBSRC)
44 $(CXX) $^ $(LDFLAGS) -o $(PROG) $(LIBS)
47 rm -f deps $(PROG) *.o tags *.*~ .OS
50 $(MAKE) -C $(DIR_LIBSRC) clean
53 rm -f ../../Makefile.conf
58 install -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/lib/$(PROG)
59 $(MAKE) -C $(DIR_LIBSRC) install
61 uninstall: uninstall-bin
64 rm -f $(PREFIX)/usr/lib/$(PROG)
66 ifneq ($(MAKECMDGOALS),distclean)
67 ifneq ($(MAKECMDGOALS),clean)
68 ifneq ($(MAKECMDGOALS),uninstall)
74 deps: $(SRCS) ../../Makefile.conf
75 $(MAKE) -C $(DIR_LIBSRC)
77 for file in $(SRCS); do\
78 echo "`$(CC) $(CXXFLAGS) -MM $$file` Makefile" >> deps ;\
79 echo -e '\t$$(CC) -c $$< $(CXXFLAGS)' >> deps ;\