Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754316AbdCFOlc (ORCPT ); Mon, 6 Mar 2017 09:41:32 -0500 Received: from mail-wr0-f195.google.com ([209.85.128.195]:34003 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932449AbdCFOfd (ORCPT ); Mon, 6 Mar 2017 09:35:33 -0500 From: Javi Merino 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 Subject: [PATCH 2/2] drm: Add O= support Date: Mon, 6 Mar 2017 14:27:36 +0000 Message-Id: <1488810456-4583-3-git-send-email-javi.merino@kernel.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1488810456-4583-1-git-send-email-javi.merino@kernel.org> References: <1488810456-4583-1-git-send-email-javi.merino@kernel.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1356 Lines: 55 Add an option to put all output files in a given directory, similar to what kbuild does. Cc: Carsten Emde Cc: David Airlie Signed-off-by: Javi Merino --- 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