:: commit bd67dfeee9d3935ed0217452a4f04d4d4cf8a4a7

mintsuki <mintsuki@protonmail.com> — 2023-09-11 22:02

parents: 0693d86cb0

test: Use -dumpmachine to find architecture instead of expecting -target

diff --git a/test/GNUmakefile b/test/GNUmakefile
index d4d7b855..fc9cf160 100644
--- a/test/GNUmakefile
+++ b/test/GNUmakefile
@@ -12,11 +12,11 @@ override LD := $(LD_FOR_TARGET)
 override QEMU := qemu-system-x86_64
 QEMUFLAGS = -m 1G -enable-kvm -cpu host
 
-ifneq ($(findstring x86_64,$(CC_FOR_TARGET)),)
+ifneq ($(findstring x86_64,$(shell $(CC_FOR_TARGET) -dumpmachine)),)
 override LDFLAGS += \
     -m elf_x86_64
 endif
-ifneq ($(findstring aarch64,$(CC_FOR_TARGET)),)
+ifneq ($(findstring aarch64,$(shell $(CC_FOR_TARGET) -dumpmachine)),)
 override LDFLAGS += \
     -m aarch64elf
 endif
@@ -56,7 +56,7 @@ override CFLAGS += \
     -I. \
     -D_LIMINE_PROTO
 
-ifneq ($(findstring x86_64,$(CC_FOR_TARGET)),)
+ifneq ($(findstring x86_64,$(shell $(CC_FOR_TARGET) -dumpmachine)),)
 override CFLAGS += \
     -m64 \
     -march=x86-64 \
@@ -64,7 +64,7 @@ override CFLAGS += \
     -mno-red-zone
 endif
 
-ifneq ($(findstring aarch64,$(CC_FOR_TARGET)),)
+ifneq ($(findstring aarch64,$(shell $(CC_FOR_TARGET) -dumpmachine)),)
 override CFLAGS += \
     -mgeneral-regs-only
 endif
@@ -85,7 +85,7 @@ override CFLAGS_MB := \
     -I. \
     -I../common/protos
 
-ifneq ($(findstring 86,$(CC_FOR_TARGET)),)
+ifneq ($(findstring 86,$(shell $(CC_FOR_TARGET) -dumpmachine)),)
 all: test.elf multiboot2.elf multiboot.elf
 else
 all: test.elf
tab: 248 wrap: offon