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.
This commit is contained in:
Bert Münnich 2017-10-19 13:29:25 +02:00
parent d2b3a18d60
commit 4d2fc0b889

View File

@ -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 $@