summaryrefslogtreecommitdiffstats
path: root/drivers/of/unittest-data
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2018-01-05 20:55:30 +0900
committerRob Herring <robh@kernel.org>2018-01-08 22:08:46 -0600
commitbd6dc70b62bb99d257a3ef39840fd89bf98bc0dd (patch)
tree3903df33a52fc6ef63fba2174b1c87e615176d00 /drivers/of/unittest-data
parent0fa1c579349fdd90173381712ad78aa99c09d38b (diff)
downloadlinux-bd6dc70b62bb99d257a3ef39840fd89bf98bc0dd.tar.bz2
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>
Diffstat (limited to 'drivers/of/unittest-data')
-rw-r--r--drivers/of/unittest-data/Makefile19
1 files changed, 5 insertions, 14 deletions
diff --git a/drivers/of/unittest-data/Makefile b/drivers/of/unittest-data/Makefile
index 32389acfa616..df697976740a 100644
--- a/drivers/of/unittest-data/Makefile
+++ b/drivers/of/unittest-data/Makefile
@@ -2,19 +2,12 @@
DTC_FLAGS_testcases := -Wno-interrupts_property
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 := -@
@@ -22,8 +15,6 @@ DTC_FLAGS_overlay_bad_phandle := -@
DTC_FLAGS_overlay_bad_symbol := -@
DTC_FLAGS_overlay_base := -@
-endif
-
.PRECIOUS: \
$(obj)/%.dtb.S \
$(obj)/%.dtb