All of lore.kernel.org
 help / color / mirror / Atom feed
From: Javi Merino <javi.merino@kernel.org>
To: airlied@linux.ie, C.Emde@osadl.org
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	linux-kernel@lists.codethink.co.uk,
	Javi Merino <javi.merino@kernel.org>
Subject: [PATCH 2/2] drm: Add O= support
Date: Mon,  6 Mar 2017 14:27:36 +0000	[thread overview]
Message-ID: <1488810456-4583-3-git-send-email-javi.merino@kernel.org> (raw)
In-Reply-To: <1488810456-4583-1-git-send-email-javi.merino@kernel.org>

Add an option to put all output files in a given directory, similar to
what kbuild does.

Cc: Carsten Emde <C.Emde@osadl.org>
Cc: David Airlie <airlied@linux.ie>
Signed-off-by: Javi Merino <javi.merino@kernel.org>
---
 Documentation/EDID/Makefile | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/Documentation/EDID/Makefile b/Documentation/EDID/Makefile
index 17763ca..76e8ef5 100644
--- a/Documentation/EDID/Makefile
+++ b/Documentation/EDID/Makefile
@@ -1,26 +1,29 @@
 
+# use "make O=dir" to locate all output files in "dir"
+O ?= .
+
 SOURCES	:= $(wildcard [0-9]*x[0-9]*.S)
 
-BIN	:= $(patsubst %.S, %.bin, $(SOURCES))
+BIN	:= $(patsubst %.S, $(O)/%.bin, $(SOURCES))
 
-IHEX	:= $(patsubst %.S, %.bin.ihex, $(SOURCES))
+IHEX	:= $(patsubst %.S, $(O)/%.bin.ihex, $(SOURCES))
 
-CODE	:= $(patsubst %.S, %.c, $(SOURCES))
+CODE	:= $(patsubst %.S, $(O)/%.c, $(SOURCES))
 
 all:	$(BIN) $(IHEX) $(CODE)
 
 clean:
-	@rm -f *.o *.bin.ihex *.bin *.c
+	@rm -f $(O)/*.o $(O)/*.bin.ihex $(O)/*.bin $(O)/*.c
 
-%.o:	%.S
-	@cc -c $^
+$(O)/%.o:	%.S
+	@cc -c $^ -o $@
 
-%.bin:	%.o
+$(O)/%.bin:	$(O)/%.o
 	@objcopy -Obinary $^ $@
 
-%.bin.ihex:	%.o
+$(O)/%.bin.ihex:	$(O)/%.o
 	@objcopy -Oihex $^ $@
 	@dos2unix $@ 2>/dev/null
 
-%.c:	%.bin
+$(O)/%.c:	$(O)/%.bin
 	@echo "{" >$@; hexdump -f hex $^ >>$@; echo "};" >>$@
-- 
2.1.4

  parent reply	other threads:[~2017-03-06 14:41 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-06 14:27 [PATCH 0/2] Documentation/EDID fixes Javi Merino
2017-03-06 14:27 ` [PATCH 1/2] drm: use .hword to represent 16-bit numbers Javi Merino
2017-03-06 14:27 ` Javi Merino [this message]
2017-03-07 16:16 ` [PATCH 0/2] Documentation/EDID fixes Jani Nikula
2017-03-07 16:16   ` Jani Nikula
2017-03-07 16:33   ` Javi Merino
2017-03-08  8:11     ` Jani Nikula
2017-03-08  8:11       ` Jani Nikula

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=1488810456-4583-3-git-send-email-javi.merino@kernel.org \
    --to=javi.merino@kernel.org \
    --cc=C.Emde@osadl.org \
    --cc=airlied@linux.ie \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@lists.codethink.co.uk \
    --cc=linux-kernel@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.