Kexec Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Simon Kågström" <simon.kagstrom@netinsight.net>
To: kexec@lists.infradead.org
Subject: [PATCH 3/4] build: Honor VPATH to support out-of-tree builds
Date: Mon, 3 Mar 2014 13:04:59 +0100	[thread overview]
Message-ID: <20140303130459.0fc230ae@marrow.netinsight.se> (raw)
In-Reply-To: <20140303130213.1d441d32@marrow.netinsight.se>

Signed-off-by: Simon Kagstrom <simon.kagstrom@netinsight.net>
---
 Makefile |   13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/Makefile b/Makefile
index 57e7e44..b9121ad 100644
--- a/Makefile
+++ b/Makefile
@@ -63,19 +63,20 @@ endif
 all: makedumpfile
 
 $(OBJ_PART): $(SRC_PART)
-	$(CC) $(CFLAGS) -c -o ./$@ ./$(@:.o=.c) 
+	$(CC) $(CFLAGS) -c -o ./$@ $(VPATH)$(@:.o=.c)
 
 $(OBJ_ARCH): $(SRC_ARCH)
-	$(CC) $(CFLAGS_ARCH) -c -o ./$@ ./$(@:.o=.c) 
+	@mkdir -p $(@D)
+	$(CC) $(CFLAGS_ARCH) -c -o ./$@ $(VPATH)$(@:.o=.c)
 
 makedumpfile: $(SRC) $(OBJ_PART) $(OBJ_ARCH)
 	$(CC) $(CFLAGS) $(LDFLAGS) $(OBJ_PART) $(OBJ_ARCH) -rdynamic -o $@ $< $(LIBS)
 	echo .TH MAKEDUMPFILE 8 \"$(DATE)\" \"makedumpfile v$(VERSION)\" \"Linux System Administrator\'s Manual\" > temp.8
-	grep -v "^.TH MAKEDUMPFILE 8" $(SRC)/makedumpfile.8 >> temp.8
+	grep -v "^.TH MAKEDUMPFILE 8" $(VPATH)makedumpfile.8 >> temp.8
 	mv temp.8 makedumpfile.8
 	gzip -c ./makedumpfile.8 > ./makedumpfile.8.gz
 	echo .TH MAKEDUMPFILE.CONF 5 \"$(DATE)\" \"makedumpfile v$(VERSION)\" \"Linux System Administrator\'s Manual\" > temp.5
-	grep -v "^.TH MAKEDUMPFILE.CONF 5" makedumpfile.conf.5 >> temp.5
+	grep -v "^.TH MAKEDUMPFILE.CONF 5" $(VPATH)makedumpfile.conf.5 >> temp.5
 	mv temp.5 makedumpfile.conf.5
 	gzip -c ./makedumpfile.conf.5 > ./makedumpfile.conf.5.gz
 
@@ -87,7 +88,7 @@ clean:
 
 install:
 	install -m 755 -d ${DESTDIR}/usr/sbin ${DESTDIR}/usr/share/man/man5 ${DESTDIR}/usr/share/man/man8 ${DESTDIR}/etc
-	install -m 755 -t ${DESTDIR}/usr/sbin makedumpfile makedumpfile-R.pl
+	install -m 755 -t ${DESTDIR}/usr/sbin makedumpfile $(VPATH)makedumpfile-R.pl
 	install -m 644 -t ${DESTDIR}/usr/share/man/man8 makedumpfile.8.gz
 	install -m 644 -t ${DESTDIR}/usr/share/man/man5 makedumpfile.conf.5.gz
-	install -m 644 -D makedumpfile.conf ${DESTDIR}/etc/makedumpfile.conf.sample
+	install -m 644 -D $(VPATH)makedumpfile.conf ${DESTDIR}/etc/makedumpfile.conf.sample
-- 
1.7.9.6


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

  parent reply	other threads:[~2014-03-03 12:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-03 12:02 [PATCH 0/4]: makedumpfile: Makefile improvements Simon Kågström
2014-03-03 12:04 ` [PATCH 1/4] build: Derive objects from source files Simon Kågström
2014-03-03 12:04 ` [PATCH 2/4] build: Use INCLUDES for normal CFLAGS in addition to CFLAGS_ARCH Simon Kågström
2014-03-03 12:04 ` Simon Kågström [this message]
2014-03-03 12:05 ` [PATCH 4/4] build: Rename generic-sounding SRC -> SRC_BASE Simon Kågström
2014-03-07  8:08 ` [PATCH 0/4]: makedumpfile: Makefile improvements Atsushi Kumagai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140303130459.0fc230ae@marrow.netinsight.se \
    --to=simon.kagstrom@netinsight.net \
    --cc=kexec@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox