From 4d2fc0b8891974f69063f0fb4e88422a1dc78933 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bert=20M=C3=BCnnich?= <ber.t@posteo.de>
Date: Thu, 19 Oct 2017 13:29:25 +0200
Subject: [PATCH] Back to VPATH for out-of-source builds

OpenBSD make supports VPATH but not pattern rules. Everything in the new
Makefile should work no matter what make program is used.
---
 Makefile | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/Makefile b/Makefile
index fee7119..196b8ff 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,7 @@
-VERSION = git-20171016
+VERSION = git-20171019
 
 srcdir = .
+VPATH = $(srcdir)
 
 PREFIX = /usr/local
 MANPREFIX = $(PREFIX)/share/man
@@ -45,16 +46,13 @@ sxiv:	$(OBJS)
 	@echo "LINK $@"
 	$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(OBJS) $(LDLIBS)
 
-$(OBJS): $(srcdir)/Makefile $(srcdir)/sxiv.h config.h
+$(OBJS): Makefile sxiv.h commands.lst config.h
+window.o: icon/data.h
 
 .c.o:
 	@echo "CC $@"
 	$(CC) $(ALL_CPPFLAGS) $(CFLAGS) -c -o $@ $<
 
-%.o: $(srcdir)/%.c
-	@echo "CC $@"
-	$(CC) $(ALL_CPPFLAGS) $(CFLAGS) -c -o $@ $(srcdir)/$(@:.o=.c)
-
 config.h:
 	@echo "GEN $@"
 	cp $(srcdir)/config.def.h $@