############################################################################### # $Id: Makefile.in,v 1.11 2009/03/03 15:49:35 faust Exp $ ############################################################################### SEARCH_DIRS = -I $(DIR_INCLUDE) OBJS = $(notdir $(patsubst %.cpp, %.o, $(patsubst %.c, %.o, $(SRCS)))) LN = ln STGLIBS_INCS = $(addprefix -I ../../../../../stglibs/,$(addsuffix .lib/include,$(STGLIBS))) STGLIBS_LIBS = $(addprefix -L ../../../../../stglibs/,$(addsuffix .lib,$(STGLIBS))) LIBS += $(addprefix -lstg,$(STGLIBS)) CXXFLAGS += -fPIC $(STGLIBS_INCS) CFLAGS += -fPIC $(STGLIBS_INCS) LDFLAGS += -shared -Wl,-rpath,$(PREFIX)/usr/lib/stg all: $(PROG) $(PROG): $(OBJS) $(CXX) $^ $(STGLIBS_LIBS) $(LIBS) $(LDFLAGS) -o $(PROG) $(LN) -fs "`pwd`/$(PROG)" $(DIR_MOD)/$(PROG) clean: rm -f deps $(PROG) *.o tags *.*~ install: $(PROG) mkdir -m $(DIR_MODE) -p $(PREFIX)/usr/lib/stg install -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/lib/stg/$(PROG) uninstall: rm -f $(PREFIX)/usr/lib/stg/$(PROG) ifneq ($(MAKECMDGOALS),clean) ifneq ($(MAKECMDGOALS),uninstall) -include deps endif endif deps: $(SRCS) ../../../../../Makefile.conf @>deps ;\ for file in $(SRCS); do\ echo "$$file" | grep ".c$$" > /dev/null;\ if [ $$? -eq 0 ];\ then\ echo "`$(CC) $(CFLAGS) $(DEFS) $(SEARCH_DIRS) -MM $$file` Makefile ../../../../../Makefile.conf" >> deps ;\ printf '%b\n' '\t$$(CC) -c $$< $(CFLAGS) $(SEARCH_DIRS) $(DEFS)' >> deps ;\ else\ echo "`$(CXX) $(CXXFLAGS) $(DEFS) $(SEARCH_DIRS) -MM $$file` Makefile ../../../../../Makefile.conf" >> deps ;\ printf '%b\n' '\t$$(CXX) -c $$< $(CXXFLAGS) $(SEARCH_DIRS) $(DEFS)' >> deps ;\ fi;\ done