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 += $(addprefix -lstg,$(STGLIBS)) $(LIB_THREAD)
30 SEARCH_DIRS = -I ../../include
32 OBJS = $(notdir $(patsubst %.cpp, %.o, $(patsubst %.c, %.o, $(SRCS))))
34 CXXFLAGS += -fPIC $(DEFS) $(STGLIBS_INCS) $(SEARCH_DIRS)
35 CFLAGS += $(DEFS) $(STGLIBS_INCS) $(SEARCH_DIRS)
36 LDFLAGS += -shared -Wl,-rpath,$(PREFIX)/usr/lib/stg -Wl,-E $(STGLIBS_LIBS)
38 .PHONY: all clean distclean libs install uninstall install-bin uninstall-bin
39 all: libs $(PROG) ../../Makefile.conf
42 $(MAKE) -C $(DIR_LIBSRC)
45 $(CXX) $^ $(LDFLAGS) -o $(PROG) $(LIBS)
48 rm -f deps $(PROG) *.o tags *.*~ .OS
51 $(MAKE) -C $(DIR_LIBSRC) clean
54 rm -f ../../Makefile.conf
59 install -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/lib/$(PROG)
60 $(MAKE) -C $(DIR_LIBSRC) install
62 uninstall: uninstall-bin
65 rm -f $(PREFIX)/usr/lib/$(PROG)
67 ifneq ($(MAKECMDGOALS),distclean)
68 ifneq ($(MAKECMDGOALS),clean)
69 ifneq ($(MAKECMDGOALS),uninstall)
75 deps: $(SRCS) ../../Makefile.conf
76 $(MAKE) -C $(DIR_LIBSRC)
78 for file in $(SRCS); do\
79 echo "`$(CC) $(CXXFLAGS) -MM $$file` Makefile" >> deps ;\
80 printf '\t$$(CC) -c $$< $(CXXFLAGS)\n' >> deps ;\