From a67c2a0dd86430b510a3aec8e9bca8eac2a6930a Mon Sep 17 00:00:00 2001 From: Amin Abdulrahman Date: Tue, 7 Jan 2025 11:02:04 +0100 Subject: [PATCH] Pass device name to the build * Reason: When printing benchmark results, it is practical to automatically add the name of the target the benchmark was run on. This eases further processing. --- envs/common/mps2.mk | 2 +- envs/common/opencm3.mk | 2 +- envs/m55-an547/Makefile | 1 + envs/m85-an555/Makefile | 1 + 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/envs/common/mps2.mk b/envs/common/mps2.mk index 8fb83fa..d96ea48 100644 --- a/envs/common/mps2.mk +++ b/envs/common/mps2.mk @@ -64,7 +64,7 @@ OBJECTS = $(OBJECTS_C) $(OBJECTS_ASM) $(OBJECTS_C): $(BUILD_DIR)/%.o: % mkdir -p $(@D) - $(CC) $(CFLAGS) -c -o $@ $< + $(CC) $(CFLAGS) -DDEVICE=\"$(QEMU_PLATFORM)\" -c -o $@ $< $(OBJECTS_ASM): $(BUILD_DIR)/%.o: % mkdir -p $(@D) diff --git a/envs/common/opencm3.mk b/envs/common/opencm3.mk index 7c4faf7..a585cad 100644 --- a/envs/common/opencm3.mk +++ b/envs/common/opencm3.mk @@ -76,7 +76,7 @@ OBJECTS = $(OBJECTS_C) $(OBJECTS_ASM) $(OBJECTS_C): $(BUILD_DIR)/%.o: % mkdir -p $(@D) - $(CC) $(CFLAGS) -c -o $@ $< + $(CC) $(CFLAGS) -DDEVICE=\"$(DEVICE)\" -c -o $@ $< $(OBJECTS_ASM): $(BUILD_DIR)/%.o: % mkdir -p $(@D) diff --git a/envs/m55-an547/Makefile b/envs/m55-an547/Makefile index b9eb17a..be18466 100644 --- a/envs/m55-an547/Makefile +++ b/envs/m55-an547/Makefile @@ -18,6 +18,7 @@ CFLAGS += \ -ffunction-sections \ -fdata-sections \ --sysroot=$(SYSROOT) \ + -DDEVICE=\"an547\" \ -DARMCM55 \ -I$(COMMON_INC) \ -I$(ENV_INC) \ diff --git a/envs/m85-an555/Makefile b/envs/m85-an555/Makefile index a5e9f4d..9a86a40 100644 --- a/envs/m85-an555/Makefile +++ b/envs/m85-an555/Makefile @@ -19,6 +19,7 @@ CFLAGS += \ -ffunction-sections \ -fdata-sections \ --sysroot=$(SYSROOT) \ + -DDEVICE=\"an547\" \ -DARMCM85 \ -I$(COMMON_INC) \ -I$(ENV_INC) \