From a46006f527db5743c3cb43e541857705a05884cf Mon Sep 17 00:00:00 2001 From: Bert Münnich Date: Fri, 8 Sep 2017 16:20:03 +0200 Subject: Support out-of-source builds Fixes issue #167. Long after closing this issue (kind of wontfix) we have switched to GNU make and can thus use its features like VPATH. --- Makefile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index f3ca3f1..f7654da 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,9 @@ VERSION := git-20170908 include config.mk -CPPFLAGS += -DVERSION=\"$(VERSION)\" -DHAVE_GIFLIB=$(HAVE_GIFLIB) -DHAVE_LIBEXIF=$(HAVE_LIBEXIF) +VPATH := $(SRCDIR) + +CPPFLAGS += -I. -DVERSION=\"$(VERSION)\" -DHAVE_GIFLIB=$(HAVE_GIFLIB) -DHAVE_LIBEXIF=$(HAVE_LIBEXIF) DEPFLAGS := -MMD -MP LDLIBS := -lImlib2 -lX11 -lXft @@ -31,7 +33,7 @@ $(OBJ): Makefile $(CC) $(CFLAGS) $(CPPFLAGS) $(DEPFLAGS) -c -o $@ $< config.h: - cp config.def.h $@ + cp $(SRCDIR)/config.def.h $@ sxiv: $(OBJ) $(CC) $(LDFLAGS) -o $@ $(OBJ) $(LDLIBS) -- cgit v1.2.3-54-g00ecf