blob: 728a1503de7c3cb2f16596497aaf672fe7c1bec9 [file] [log] [blame]
From c0ee7d8abea05b07a0f3217d003bc6f406d1c080 Mon Sep 17 00:00:00 2001
From: Masahiro Yamada <yamada.masahiro@socionext.com>
Date: Fri, 5 Jan 2018 20:55:30 +0900
Subject: [PATCH 0933/1795] of: unittest: refactor Makefile
Some cleanups:
- use obj-$(CONFIG_OF_OVERLAY) instead of ifdef ... endif
- compute targets from obj-y
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Rob Herring <robh@kernel.org>
(cherry picked from commit bd6dc70b62bb99d257a3ef39840fd89bf98bc0dd)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
drivers/of/unittest-data/Makefile | 19 +++++--------------
1 file changed, 5 insertions(+), 14 deletions(-)
diff --git a/drivers/of/unittest-data/Makefile b/drivers/of/unittest-data/Makefile
index 3031fc2f18f6..8a723c37a33d 100644
--- a/drivers/of/unittest-data/Makefile
+++ b/drivers/of/unittest-data/Makefile
@@ -1,19 +1,12 @@
# SPDX-License-Identifier: GPL-2.0
obj-y += testcases.dtb.o
-targets += testcases.dtb testcases.dtb.S
+obj-$(CONFIG_OF_OVERLAY) += overlay.dtb.o \
+ overlay_bad_phandle.dtb.o \
+ overlay_bad_symbol.dtb.o \
+ overlay_base.dtb.o
-ifdef CONFIG_OF_OVERLAY
-
-obj-y += overlay.dtb.o
-obj-y += overlay_bad_phandle.dtb.o
-obj-y += overlay_bad_symbol.dtb.o
-obj-y += overlay_base.dtb.o
-
-targets += overlay.dtb overlay.dtb.S
-targets += overlay_bad_phandle.dtb overlay_bad_phandle.dtb.S
-targets += overlay_bad_symbol.dtb overlay_bad_symbol.dtb.S
-targets += overlay_base.dtb overlay_base.dtb.S
+targets += $(foreach suffix, dtb dtb.S, $(patsubst %.dtb.o,%.$(suffix),$(obj-y)))
# enable creation of __symbols__ node
DTC_FLAGS_overlay := -@
@@ -21,8 +14,6 @@ DTC_FLAGS_overlay_bad_phandle := -@
DTC_FLAGS_overlay_bad_symbol := -@
DTC_FLAGS_overlay_base := -@
-endif
-
.PRECIOUS: \
$(obj)/%.dtb.S \
$(obj)/%.dtb
--
2.19.0