From patchwork Tue Oct 23 03:35:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Popple X-Patchwork-Id: 988013 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42fJvj4B38z9sN6 for ; Tue, 23 Oct 2018 14:36:17 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=popple.id.au Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 42fJvj09ZhzDsFP for ; Tue, 23 Oct 2018 14:36:17 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=popple.id.au X-Original-To: pdbg@lists.ozlabs.org Delivered-To: pdbg@lists.ozlabs.org Received: from ozlabs.org (bilbo.ozlabs.org [IPv6:2401:3900:2:1::2]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 42fJty3YMxzDrq6 for ; Tue, 23 Oct 2018 14:35:38 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=popple.id.au Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPSA id 42fJtx6Xgvz9sDb; Tue, 23 Oct 2018 14:35:37 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=popple.id.au From: Alistair Popple To: pdbg@lists.ozlabs.org Date: Tue, 23 Oct 2018 14:35:28 +1100 Message-Id: <20181023033528.31256-10-alistair@popple.id.au> X-Mailer: git-send-email 2.11.0 Subject: [Pdbg] [PATCH] build: Allow device tree headers to be generated in subdirs X-BeenThere: pdbg@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "mailing list for https://github.com/open-power/pdbg development" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Amitay Isaacs MIME-Version: 1.0 Errors-To: pdbg-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Pdbg" From: Amitay Isaacs Using dts avoids unnecessary prefixes in case building device tree headers in subdirs. Signed-off-by: Amitay Isaacs --- Makefile.am | 4 ++-- generate_dt_header.sh | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Makefile.am b/Makefile.am index 1bed1c2..4e5968f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -209,10 +209,10 @@ p9z-fsi.dts: p9z-fsi.dts.m4 p9-fsi.dtsi %.dtb: %.dts $(DTC_V)$(DTC) -i$(dir $@) -I dts $< -O dtb > $@ -%.dt.h: %.dtb +%.dt.h: %.dts $(GEN_V)$(srcdir)/generate_dt_header.sh $< > $@ %.dtb.o: %.dtb - $(AM_V_CC)$(CC) -c $(srcdir)/template.S -DSYMBOL_PREFIX=$(shell echo $@ | tr '.-' '_') -DFILENAME=\"$<\" -o $@ + $(AM_V_CC)$(CC) -c $(srcdir)/template.S -DSYMBOL_PREFIX=$(shell basename $@ | tr '.-' '_') -DFILENAME=\"$<\" -o $@ MOSTLYCLEANFILES = *.dtb *.dts *.dt.h p9-fsi.dtsi diff --git a/generate_dt_header.sh b/generate_dt_header.sh index 75350d4..4609d60 100755 --- a/generate_dt_header.sh +++ b/generate_dt_header.sh @@ -1,15 +1,14 @@ #!/bin/sh if [ $# -ne 1 ] ; then - echo "Usage: $0 " + echo "Usage: $0 " exit 1 fi -SYMBOL=$(echo "$1" | tr '.-' '_') +SYMBOL=$(basename "$1" | sed 's/dts/dtb/' | tr '.-' '_') SYM_START="_binary_${SYMBOL}_o_start" SYM_END="_biary_${SYMBOL}_o_end" SYM_SIZE="_biary_${SYMBOL}_o_size" -HEADER="$f.h" cat - <