system-arm: Refactor makefile to create targets with functions
authorChun-Chen TK Hsu <chunchenhsu@google.com>
Fri, 9 Aug 2019 10:54:04 +0000 (18:54 +0800)
committerChun-Chen TK Hsu <chunchenhsu@google.com>
Sat, 10 Aug 2019 05:20:31 +0000 (05:20 +0000)
This change simplifies writing targets which has same prefix but
differrent number of CPUs.

Change-Id: I3b7d67a554f5d27714ace6b88c9784ddaa3b34d5
Signed-off-by: Chun-Chen TK Hsu <chunchenhsu@google.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/19989
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

system/arm/dt/Makefile

index 626ff0891f079a4fbca2c1a214680ade744cbcfc..c472a0e09c7a823011e5aa711f5c3fdef30e319b 100644 (file)
@@ -31,24 +31,19 @@ DTC?=dtc
 
 DTC_CPP_FLAGS=-nostdinc -undef
 
+# $(1) is the prefix of DTB files
+NUM_CPUS := 1 2 4 8 16
+CREATE_TARGET=$(foreach n, $(NUM_CPUS), $(1)_$(n)cpu.dtb)
+
+TARGET_PREFIX=\
+       armv7_gem5_v1 \
+       armv8_gem5_v1 \
+       armv8_gem5_v2
+
 TARGETS=\
-       armv7_gem5_v1_1cpu.dtb \
-       armv7_gem5_v1_2cpu.dtb \
-       armv7_gem5_v1_4cpu.dtb \
-       armv7_gem5_v1_8cpu.dtb \
-       armv7_gem5_v1_16cpu.dtb \
-       armv8_gem5_v1_1cpu.dtb \
-       armv8_gem5_v1_2cpu.dtb \
-       armv8_gem5_v1_4cpu.dtb \
-       armv8_gem5_v1_8cpu.dtb \
-       armv8_gem5_v1_16cpu.dtb \
+       $(foreach prefix, $(TARGET_PREFIX), $(call CREATE_TARGET, $(prefix))) \
        armv8_gem5_v1_big_little_2_2.dtb \
-       armv8_gem5_v1_big_little_2_4.dtb \
-       armv8_gem5_v2_1cpu.dtb \
-       armv8_gem5_v2_2cpu.dtb \
-       armv8_gem5_v2_4cpu.dtb \
-       armv8_gem5_v2_8cpu.dtb \
-       armv8_gem5_v2_16cpu.dtb
+       armv8_gem5_v1_big_little_2_4.dtb
 
 VEXPRESS_GEM5_V1_DTSIS=\
        platforms/vexpress_gem5_v1.dtsi \