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

This commit is contained in:
mintsuki 2023-09-11 17:02:57 -05:00
parent 0693d86cb0
commit bd67dfeee9
1 changed files with 5 additions and 5 deletions

View File

@ -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