From patchwork Wed Nov 7 05:39:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Popple X-Patchwork-Id: 994112 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42qZz14ZnJz9s8T for ; Wed, 7 Nov 2018 16:41: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 42qZz12kPyzF3Fb for ; Wed, 7 Nov 2018 16:41: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 42qZxX07p4zF3G9 for ; Wed, 7 Nov 2018 16:40:00 +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 42qZxW4TXYz9s8T; Wed, 7 Nov 2018 16:39:59 +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: Wed, 7 Nov 2018 16:39:33 +1100 Message-Id: <20181107053943.4307-7-alistair@popple.id.au> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20181107053943.4307-1-alistair@popple.id.au> References: <20181107053943.4307-1-alistair@popple.id.au> Subject: [Pdbg] [PATCH v2 06/16] 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@ozlabs.org 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 94a112d..ad2bbec 100644 --- a/Makefile.am +++ b/Makefile.am @@ -242,11 +242,11 @@ 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 $@ %.c: %.rl $(RAGEL_V)$(RAGEL) -o $@ $< diff --git a/generate_dt_header.sh b/generate_dt_header.sh index 7f61d1f..b7abfb5 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="_binary_${SYMBOL}_o_end" SYM_SIZE="_binary_${SYMBOL}_o_size" -HEADER="$f.h" cat - <