From 495c196a82f04c8d5fae9ec52944292678f12ac5 Mon Sep 17 00:00:00 2001 From: psychon Date: Sat, 22 Aug 2009 16:03:51 +0000 Subject: [PATCH] Fix out-of-tree builds Instead of using sed to strip away the source dir this now uses make's notdir. $(notdir this/is/an/example) results in example. This also moved the generated dependency files from .depend/extra into .depend/ Since we need the extra/ path prefix for the modules from modules/extra, that one is added back via addprefix. git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1610 726aef4b-f618-498e-8847-2d620e286838 --- modules/Makefile.in | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/modules/Makefile.in b/modules/Makefile.in index 56ffb387..8479b5d7 100644 --- a/modules/Makefile.in +++ b/modules/Makefile.in @@ -31,15 +31,13 @@ ifneq "$(LIBZNC)" "" LDFLAGS += -L.. -lznc -Wl,-rpath,$(LIBZNCDIR) endif -FILES := $(wildcard $(srcdir)/*.cpp) +FILES := $(notdir $(wildcard $(srcdir)/*.cpp)) # If extra is enabled ifeq "@EXTRA@" "yes" -FILES += $(wildcard $(srcdir)/extra/*.cpp) +FILES += $(addprefix extra/, $(notdir $(wildcard $(srcdir)/extra/*.cpp))) endif FILES := $(basename $(FILES)) -# Strip away the srcdir, we want them to be created in the current dir -FILES := $(shell echo $(FILES) | sed -e "s: $(srcdir)/: :g") ifeq "@NOSSL@" "1" FILES := $(foreach file, $(FILES), \ @@ -101,9 +99,8 @@ clean: %.so: %.cpp Makefile @mkdir -p .depend - @mkdir -p .depend/extra @mkdir -p extra - $(CXX) $(MODFLAGS) $(LDFLAGS) $(MODLINK) -o $@ $< $($(shell echo '$(basename $@)' | sed -e 's:extra/::')FLAGS) -MMD -MF .depend/$@.dep + $(CXX) $(MODFLAGS) $(LDFLAGS) $(MODLINK) -o $@ $< $($(notdir $(basename $@))FLAGS) -MMD -MF .depend/$(notdir $@).dep modperl_install: create_install_dir for i in $(srcdir)/*.pm; do \