Krolyxon
Commit a46006f

Branches

Refs →

nsxiva46006f

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.
Author
Bert Münnich
Date
2017-09-08 16:20 +0200
Committer
Bert Münnich · 2017-09-08 16:20 +0200
Parent
e46b1fa
Commit
a46006f527db5743c3cb43e541857705a05884cf

+6 −2

2 files changed

  1. M Makefile +4 −2
  2. M config.mk +2 −0
M Makefile View
@@ -5,7 +5,9 @@ VERSION := git-20170908
55
66 include config.mk
77
8−CPPFLAGS += -DVERSION=\"$(VERSION)\" -DHAVE_GIFLIB=$(HAVE_GIFLIB) -DHAVE_LIBEXIF=$(HAVE_LIBEXIF)
8+VPATH := $(SRCDIR)
9+
10+CPPFLAGS += -I. -DVERSION=\"$(VERSION)\" -DHAVE_GIFLIB=$(HAVE_GIFLIB) -DHAVE_LIBEXIF=$(HAVE_LIBEXIF)
911 DEPFLAGS := -MMD -MP
1012
1113 LDLIBS := -lImlib2 -lX11 -lXft
@@ -31,7 +33,7 @@ $(OBJ): Makefile
3133 $(CC) $(CFLAGS) $(CPPFLAGS) $(DEPFLAGS) -c -o $@ $<
3234
3335 config.h:
34− cp config.def.h $@
36+ cp $(SRCDIR)/config.def.h $@
3537
3638 sxiv: $(OBJ)
3739 $(CC) $(LDFLAGS) -o $@ $(OBJ) $(LDLIBS)
M config.mk View
@@ -1,3 +1,5 @@
1+SRCDIR := .
2+
13 PREFIX := /usr/local
24 MANPREFIX := $(PREFIX)/share/man
35