From a56d5c52dbd2d1d0fcf3535ae7196b91f85cbd85 Mon Sep 17 00:00:00 2001 From: Marcin Wojdyr Date: Sat, 29 Jun 2013 17:18:07 +0100 Subject: [PATCH] Makefile.in: support out-of-source build --- Makefile.in | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Makefile.in b/Makefile.in index a40d844..05c1374 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,6 +1,7 @@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ +srcdir = @srcdir@ libdir = @libdir@ datarootdir = @datarootdir@ datadir = @datadir@ @@ -30,7 +31,7 @@ install: mkdir -p $(DESTDIR)$(bindir) install -c -m755 $(PROG) $(DESTDIR)$(bindir)/$(PROG) mkdir -p $(DESTDIR)$(datarootdir)/aclocal - install -c -m644 pkg.m4 $(DESTDIR)$(datarootdir)/aclocal/pkg.m4 + install -c -m644 $(srcdir)/pkg.m4 $(DESTDIR)$(datarootdir)/aclocal/pkg.m4 check: $(PROG) $(SHELL) tests/run.sh ./$(PROG) @@ -38,6 +39,9 @@ check: $(PROG) valgrind-check: $(PROG) $(SHELL) tests/run.sh 'valgrind --leak-check=full --show-reachable=yes ./$(PROG)' +%.o: $(srcdir)/%.c + $(CC) -c $(CFLAGS) -I. $(CPPFLAGS) $< -o $@ + $(PROG): $(OBJS) ${CC} ${LDFLAGS} -o $@ $(OBJS)