build: Increase portability of Makefile targets

This commit is contained in:
mintsuki 2022-06-15 03:25:36 +02:00
parent dcd59daaca
commit 1fc8247a86
20 changed files with 96 additions and 114 deletions

View File

@ -82,7 +82,7 @@ export USING_CLANG
override STAGE1_FILES := $(shell find '$(call SHESCAPE,$(SRCDIR))/stage1' -type f -name '*.asm')
.PHONY: all
all: @BUILD_UEFI@ @BUILD_BIOS@
all: @BUILD_UEFI_X86_64@ @BUILD_UEFI_IA32@ @BUILD_BIOS@
$(call MKESCAPE,$(BINDIR))/limine-deploy: $(call MKESCAPE,$(SRCDIR))/limine-deploy/limine-deploy.c $(call MKESCAPE,$(BINDIR))/limine-hdd.bin
mkdir -p '$(call SHESCAPE,$(BINDIR))'
@ -95,7 +95,7 @@ limine-deploy:
$(MAKE) '$(call SHESCAPE,$(BINDIR))/limine-deploy'
.PHONY: clean
clean: limine-bios-clean limine-uefi32-clean limine-uefi64-clean
clean: limine-bios-clean limine-uefi-ia32-clean limine-uefi-x86-64-clean
rm -rf '$(call SHESCAPE,$(BINDIR))' '$(call SHESCAPE,$(BUILDDIR))/stage1.stamp'
.PHONY: install-data
@ -146,7 +146,7 @@ ifneq ($(BUILD_LIMINE_DEPLOY), no)
$(MAKE) limine-deploy
endif
$(call MKESCAPE,$(BINDIR))/limine-cd-efi.bin: $(if @BUILD_UEFI32@, $(call MKESCAPE,$(BUILDDIR))/common-uefi32/BOOTIA32.EFI) $(if @BUILD_UEFI64@, $(call MKESCAPE,$(BUILDDIR))/common-uefi64/BOOTX64.EFI)
$(call MKESCAPE,$(BINDIR))/limine-cd-efi.bin: $(if @BUILD_UEFI_IA32@, $(call MKESCAPE,$(BUILDDIR))/common-uefi-ia32/BOOTIA32.EFI) $(if @BUILD_UEFI_X86_64@, $(call MKESCAPE,$(BUILDDIR))/common-uefi-x86-64/BOOTX64.EFI)
ifneq ($(BUILD_CD_EFI), no)
mkdir -p '$(call SHESCAPE,$(BINDIR))'
rm -f '$(call SHESCAPE,$(BINDIR))/limine-cd-efi.bin'
@ -154,10 +154,10 @@ ifneq ($(BUILD_CD_EFI), no)
( mformat -i '$(call SHESCAPE,$(BINDIR))/limine-cd-efi.bin' -f 1440 :: && \
mmd -D s -i '$(call SHESCAPE,$(BINDIR))/limine-cd-efi.bin' ::/EFI && \
mmd -D s -i '$(call SHESCAPE,$(BINDIR))/limine-cd-efi.bin' ::/EFI/BOOT && \
( ( [ -f '$(call SHESCAPE,$(BUILDDIR))/common-uefi64/BOOTX64.EFI' ] && \
mcopy -D o -i '$(call SHESCAPE,$(BINDIR))/limine-cd-efi.bin' '$(call SHESCAPE,$(BUILDDIR))/common-uefi64/BOOTX64.EFI' ::/EFI/BOOT ) || true ) && \
( ( [ -f '$(call SHESCAPE,$(BUILDDIR))/common-uefi32/BOOTIA32.EFI' ] && \
mcopy -D o -i '$(call SHESCAPE,$(BINDIR))/limine-cd-efi.bin' '$(call SHESCAPE,$(BUILDDIR))/common-uefi32/BOOTIA32.EFI' ::/EFI/BOOT ) || true ) \
( ( [ -f '$(call SHESCAPE,$(BUILDDIR))/common-uefi-x86-64/BOOTX64.EFI' ] && \
mcopy -D o -i '$(call SHESCAPE,$(BINDIR))/limine-cd-efi.bin' '$(call SHESCAPE,$(BUILDDIR))/common-uefi-x86-64/BOOTX64.EFI' ::/EFI/BOOT ) || true ) && \
( ( [ -f '$(call SHESCAPE,$(BUILDDIR))/common-uefi-ia32/BOOTIA32.EFI' ] && \
mcopy -D o -i '$(call SHESCAPE,$(BINDIR))/limine-cd-efi.bin' '$(call SHESCAPE,$(BUILDDIR))/common-uefi-ia32/BOOTIA32.EFI' ::/EFI/BOOT ) || true ) \
) || rm -f '$(call SHESCAPE,$(BINDIR))/limine-cd-efi.bin'
endif
@ -165,30 +165,26 @@ endif
limine-cd-efi:
$(MAKE) '$(call SHESCAPE,$(BINDIR))/limine-cd-efi.bin'
.PHONY: limine-uefi
limine-uefi: @BUILD_UEFI32@ @BUILD_UEFI64@
$(MAKE) limine-cd-efi
.PHONY: limine-uefi64
limine-uefi64: $(call MKESCAPE,$(SRCDIR))/limine-efi
$(MAKE) common-uefi64
.PHONY: limine-uefi-x86-64
limine-uefi-x86-64: $(call MKESCAPE,$(SRCDIR))/limine-efi
$(MAKE) common-uefi-x86-64
mkdir -p '$(call SHESCAPE,$(BINDIR))'
cp '$(call SHESCAPE,$(BUILDDIR))/common-uefi64/BOOTX64.EFI' '$(call SHESCAPE,$(BINDIR))/'
cp '$(call SHESCAPE,$(BUILDDIR))/common-uefi-x86-64/BOOTX64.EFI' '$(call SHESCAPE,$(BINDIR))/'
.PHONY: limine-uefi32
limine-uefi32: $(call MKESCAPE,$(SRCDIR))/limine-efi
$(MAKE) common-uefi32
.PHONY: limine-uefi-ia32
limine-uefi-ia32: $(call MKESCAPE,$(SRCDIR))/limine-efi
$(MAKE) common-uefi-ia32
mkdir -p '$(call SHESCAPE,$(BINDIR))'
cp '$(call SHESCAPE,$(BUILDDIR))/common-uefi32/BOOTIA32.EFI' '$(call SHESCAPE,$(BINDIR))/'
cp '$(call SHESCAPE,$(BUILDDIR))/common-uefi-ia32/BOOTIA32.EFI' '$(call SHESCAPE,$(BINDIR))/'
.PHONY: limine-bios-clean
limine-bios-clean: common-bios-clean decompressor-clean
.PHONY: limine-uefi64-clean
limine-uefi64-clean: common-uefi64-clean
.PHONY: limine-uefi-x86-64-clean
limine-uefi-x86-64-clean: common-uefi-x86-64-clean
.PHONY: limine-uefi32-clean
limine-uefi32-clean: common-uefi32-clean
.PHONY: limine-uefi-ia32-clean
limine-uefi-ia32-clean: common-uefi-ia32-clean
.PHONY: dist
dist:
@ -216,21 +212,21 @@ distclean: clean
maintainer-clean: distclean
cd '$(call SHESCAPE,$(SRCDIR))' && rm -rf freestanding_headers limine-efi configure build-aux *'~' autom4te.cache *.tar.xz *.tar.gz
.PHONY: common-uefi64
common-uefi64:
$(MAKE) -C '$(call SHESCAPE,$(SRCDIR))/common' all TARGET=uefi64 BUILDDIR='$(call SHESCAPE,$(BUILDDIR))/common-uefi64'
.PHONY: common-uefi-x86-64
common-uefi-x86-64:
$(MAKE) -C '$(call SHESCAPE,$(SRCDIR))/common' all TARGET=uefi-x86-64 BUILDDIR='$(call SHESCAPE,$(BUILDDIR))/common-uefi-x86-64'
.PHONY: common-uefi64-clean
common-uefi64-clean:
$(MAKE) -C '$(call SHESCAPE,$(SRCDIR))/common' clean TARGET=uefi64 BUILDDIR='$(call SHESCAPE,$(BUILDDIR))/common-uefi64'
.PHONY: common-uefi-x86-64-clean
common-uefi-x86-64-clean:
$(MAKE) -C '$(call SHESCAPE,$(SRCDIR))/common' clean TARGET=uefi-x86-64 BUILDDIR='$(call SHESCAPE,$(BUILDDIR))/common-uefi-x86-64'
.PHONY: common-uefi32
common-uefi32:
$(MAKE) -C '$(call SHESCAPE,$(SRCDIR))/common' all TARGET=uefi32 BUILDDIR='$(call SHESCAPE,$(BUILDDIR))/common-uefi32'
.PHONY: common-uefi-ia32
common-uefi-ia32:
$(MAKE) -C '$(call SHESCAPE,$(SRCDIR))/common' all TARGET=uefi-ia32 BUILDDIR='$(call SHESCAPE,$(BUILDDIR))/common-uefi-ia32'
.PHONY: common-uefi32-clean
common-uefi32-clean:
$(MAKE) -C '$(call SHESCAPE,$(SRCDIR))/common' clean TARGET=uefi32 BUILDDIR='$(call SHESCAPE,$(BUILDDIR))/common-uefi32'
.PHONY: common-uefi-ia32-clean
common-uefi-ia32-clean:
$(MAKE) -C '$(call SHESCAPE,$(SRCDIR))/common' clean TARGET=uefi-ia32 BUILDDIR='$(call SHESCAPE,$(BUILDDIR))/common-uefi-ia32'
.PHONY: common-bios
common-bios:
@ -486,7 +482,7 @@ uefi-test:
$(MAKE) ovmf-x64
$(MAKE) test-clean
$(MAKE) test.hdd
$(MAKE) limine-uefi64
$(MAKE) limine-uefi-x86-64
$(MAKE) -C test
rm -rf test_image/
mkdir test_image
@ -505,12 +501,12 @@ uefi-test:
rm -rf test_image loopback_dev
qemu-system-x86_64 -m 512M -M q35 -L ovmf -bios ovmf-x64/OVMF.fd -net none -smp 4 -hda test.hdd -debugcon stdio
.PHONY: uefi32-test
uefi32-test:
.PHONY: uefi-ia32-test
uefi-ia32-test:
$(MAKE) ovmf-ia32
$(MAKE) test-clean
$(MAKE) test.hdd
$(MAKE) limine-uefi32
$(MAKE) limine-uefi-ia32
$(MAKE) -C test
rm -rf test_image/
mkdir test_image

View File

@ -16,9 +16,9 @@ endif
ifeq ($(TARGET), bios)
override OBJCOPY_ARCH := elf32-i386
else ifeq ($(TARGET), uefi64)
else ifeq ($(TARGET), uefi-x86-64)
override OBJCOPY_ARCH := elf64-x86-64
else ifeq ($(TARGET), uefi32)
else ifeq ($(TARGET), uefi-ia32)
override OBJCOPY_ARCH := elf32-i386
else
$(error Invalid target)
@ -28,10 +28,10 @@ ifeq ($(USING_CLANG), 1)
ifeq ($(TARGET), bios)
override LIMINE_CC += --target=i686-elf
endif
ifeq ($(TARGET), uefi64)
ifeq ($(TARGET), uefi-x86-64)
override LIMINE_CC += --target=x86_64-elf
endif
ifeq ($(TARGET), uefi32)
ifeq ($(TARGET), uefi-ia32)
override LIMINE_CC += --target=i686-elf
endif
endif
@ -81,7 +81,7 @@ override INTERNAL_CFLAGS += \
-fno-pie
endif
ifeq ($(TARGET), uefi64)
ifeq ($(TARGET), uefi-x86-64)
override INTERNAL_CFLAGS32 := \
$(INTERNAL_CFLAGS) \
-Dbios=0 \
@ -107,7 +107,7 @@ override INTERNAL_CFLAGS += \
-mno-red-zone
endif
ifeq ($(TARGET), uefi32)
ifeq ($(TARGET), uefi-ia32)
override INTERNAL_CFLAGS += \
-Dbios=0 \
-Duefi=1 \
@ -132,7 +132,7 @@ override INTERNAL_LDFLAGS += \
--build-id=sha1
endif
ifeq ($(TARGET), uefi64)
ifeq ($(TARGET), uefi-x86-64)
override INTERNAL_LDFLAGS += \
-melf_x86_64 \
-static \
@ -141,7 +141,7 @@ override INTERNAL_LDFLAGS += \
-ztext
endif
ifeq ($(TARGET), uefi32)
ifeq ($(TARGET), uefi-ia32)
override INTERNAL_LDFLAGS += \
-melf_i386 \
-static \
@ -154,30 +154,30 @@ endif
override C_FILES := $(shell find ./ -type f -name '*.c')
ifeq ($(TARGET), bios)
override ASM32_FILES := $(shell find ./ -type f -name '*.asm32')
override ASMB_FILES := $(shell find ./ -type f -name '*.asmb')
override ASM32_FILES := $(shell find ./ -type f -name '*.asm_ia32')
override ASMB_FILES := $(shell find ./ -type f -name '*.asm_bios_ia32')
override OBJ := $(addprefix $(call MKESCAPE,$(BUILDDIR))/, $(C_FILES:.c=.o) $(ASM32_FILES:.asm32=.o) $(ASMB_FILES:.asmb=.o))
override OBJ := $(addprefix $(call MKESCAPE,$(BUILDDIR))/, $(C_FILES:.c=.o) $(ASM32_FILES:.asm_ia32=.o) $(ASMB_FILES:.asm_bios_ia32=.o))
endif
ifeq ($(TARGET), uefi64)
override ASM64_FILES := $(shell find ./ -type f -name '*.asm64')
override ASM64U_FILES := $(shell find ./ -type f -name '*.asm64u')
ifeq ($(TARGET), uefi-x86-64)
override ASM64_FILES := $(shell find ./ -type f -name '*.asm_x86_64')
override ASM64U_FILES := $(shell find ./ -type f -name '*.asm_uefi_x86_64')
override OBJ := $(addprefix $(call MKESCAPE,$(BUILDDIR))/, $(C_FILES:.c=.o) $(ASM64_FILES:.asm64=.o) $(ASM64U_FILES:.asm64u=.o))
override OBJ := $(addprefix $(call MKESCAPE,$(BUILDDIR))/, $(C_FILES:.c=.o) $(ASM64_FILES:.asm_x86_64=.o) $(ASM64U_FILES:.asm_uefi_x86_64=.o))
endif
ifeq ($(TARGET), uefi32)
override ASM32_FILES := $(shell find ./ -type f -name '*.asm32')
override ASM32U_FILES := $(shell find ./ -type f -name '*.asm32u')
ifeq ($(TARGET), uefi-ia32)
override ASM32_FILES := $(shell find ./ -type f -name '*.asm_ia32')
override ASM32U_FILES := $(shell find ./ -type f -name '*.asm_uefi_ia32')
override OBJ := $(addprefix $(call MKESCAPE,$(BUILDDIR))/, $(C_FILES:.c=.o) $(ASM32_FILES:.asm32=.o) $(ASM32U_FILES:.asm32u=.o))
override OBJ := $(addprefix $(call MKESCAPE,$(BUILDDIR))/, $(C_FILES:.c=.o) $(ASM32_FILES:.asm_ia32=.o) $(ASM32U_FILES:.asm_uefi_ia32=.o))
endif
override HEADER_DEPS := $(addprefix $(call MKESCAPE,$(BUILDDIR))/, $(C_FILES:.c=.d))
ifeq ($(TARGET), bios)
all: $(call MKESCAPE,$(BUILDDIR))/limine.sys $(call MKESCAPE,$(BUILDDIR))/stage2.bin.gz
else ifeq ($(TARGET), uefi64)
else ifeq ($(TARGET), uefi-x86-64)
all: $(call MKESCAPE,$(BUILDDIR))/BOOTX64.EFI
else ifeq ($(TARGET), uefi32)
else ifeq ($(TARGET), uefi-ia32)
all: $(call MKESCAPE,$(BUILDDIR))/BOOTIA32.EFI
endif
@ -277,7 +277,7 @@ $(call MKESCAPE,$(BUILDDIR))/limine-efi: ../limine-efi/*
mkdir -p '$(call SHESCAPE,$(BUILDDIR))/'
cp -r ../limine-efi '$(call SHESCAPE,$(BUILDDIR))/'
ifeq ($(TARGET), uefi64)
ifeq ($(TARGET), uefi-x86-64)
$(call MKESCAPE,$(BUILDDIR))/full.map.o: $(call MKESCAPE,$(BUILDDIR))/limine_nomap.elf
cd '$(call SHESCAPE,$(BUILDDIR))' && \
@ -304,9 +304,9 @@ limine-efi: $(call MKESCAPE,$(BUILDDIR))/limine-efi
AR="$(LIMINE_AR)" \
ARCH=x86_64
$(call MKESCAPE,$(BUILDDIR))/linker_nomap.ld: linker_uefi64.ld.in
$(call MKESCAPE,$(BUILDDIR))/linker_nomap.ld: linker_uefi_x86_64.ld.in
mkdir -p '$(call SHESCAPE,$(BUILDDIR))'
$(LIMINE_CC) -x c -E -P -undef -DLINKER_NOMAP linker_uefi64.ld.in -o '$(call SHESCAPE,$(BUILDDIR))/linker_nomap.ld'
$(LIMINE_CC) -x c -E -P -undef -DLINKER_NOMAP linker_uefi_x86_64.ld.in -o '$(call SHESCAPE,$(BUILDDIR))/linker_nomap.ld'
$(call MKESCAPE,$(BUILDDIR))/limine_nomap.elf: $(call MKESCAPE,$(BUILDDIR))/limine-efi/gnuefi/crt0-efi-x86_64.o $(call MKESCAPE,$(BUILDDIR))/limine-efi/gnuefi/libgnuefi.a $(OBJ) $(call MKESCAPE,$(BUILDDIR))/tinf/tinfgzip.o $(call MKESCAPE,$(BUILDDIR))/tinf/tinflate.o $(call MKESCAPE,$(BUILDDIR))/font.o $(call MKESCAPE,$(BUILDDIR))/sys/smp_trampoline.o
$(MAKE) '$(call SHESCAPE,$(BUILDDIR))/linker_nomap.ld'
@ -314,9 +314,9 @@ $(call MKESCAPE,$(BUILDDIR))/limine_nomap.elf: $(call MKESCAPE,$(BUILDDIR))/limi
-T'$(call SHESCAPE,$(BUILDDIR))/linker_nomap.ld' \
'$(call OBJESCAPE,$^)' $(LIMINE_LDFLAGS) $(INTERNAL_LDFLAGS) -o '$(call SHESCAPE,$@)'
$(call MKESCAPE,$(BUILDDIR))/linker.ld: linker_uefi64.ld.in
$(call MKESCAPE,$(BUILDDIR))/linker.ld: linker_uefi_x86_64.ld.in
mkdir -p '$(call SHESCAPE,$(BUILDDIR))'
$(LIMINE_CC) -x c -E -P -undef linker_uefi64.ld.in -o '$(call SHESCAPE,$(BUILDDIR))/linker.ld'
$(LIMINE_CC) -x c -E -P -undef linker_uefi_x86_64.ld.in -o '$(call SHESCAPE,$(BUILDDIR))/linker.ld'
$(call MKESCAPE,$(BUILDDIR))/limine.elf: $(call MKESCAPE,$(BUILDDIR))/limine-efi/gnuefi/crt0-efi-x86_64.o $(call MKESCAPE,$(BUILDDIR))/limine-efi/gnuefi/libgnuefi.a $(OBJ) $(call MKESCAPE,$(BUILDDIR))/tinf/tinfgzip.o $(call MKESCAPE,$(BUILDDIR))/tinf/tinflate.o $(call MKESCAPE,$(BUILDDIR))/font.o $(call MKESCAPE,$(BUILDDIR))/sys/smp_trampoline.o $(call MKESCAPE,$(BUILDDIR))/full.map.o
$(MAKE) '$(call SHESCAPE,$(BUILDDIR))/linker.ld'
@ -326,7 +326,7 @@ $(call MKESCAPE,$(BUILDDIR))/limine.elf: $(call MKESCAPE,$(BUILDDIR))/limine-efi
endif
ifeq ($(TARGET), uefi32)
ifeq ($(TARGET), uefi-ia32)
$(call MKESCAPE,$(BUILDDIR))/full.map.o: $(call MKESCAPE,$(BUILDDIR))/limine_nomap.elf
cd '$(call SHESCAPE,$(BUILDDIR))' && \
@ -353,9 +353,9 @@ limine-efi: $(call MKESCAPE,$(BUILDDIR))/limine-efi
AR="$(LIMINE_AR)" \
ARCH=ia32
$(call MKESCAPE,$(BUILDDIR))/linker_nomap.ld: linker_uefi32.ld.in
$(call MKESCAPE,$(BUILDDIR))/linker_nomap.ld: linker_uefi_ia32.ld.in
mkdir -p '$(call SHESCAPE,$(BUILDDIR))'
$(LIMINE_CC) -x c -E -P -undef -DLINKER_NOMAP linker_uefi32.ld.in -o '$(call SHESCAPE,$(BUILDDIR))/linker_nomap.ld'
$(LIMINE_CC) -x c -E -P -undef -DLINKER_NOMAP linker_uefi_ia32.ld.in -o '$(call SHESCAPE,$(BUILDDIR))/linker_nomap.ld'
$(call MKESCAPE,$(BUILDDIR))/limine_nomap.elf: $(call MKESCAPE,$(BUILDDIR))/limine-efi/gnuefi/crt0-efi-ia32.o $(call MKESCAPE,$(BUILDDIR))/limine-efi/gnuefi/libgnuefi.a $(OBJ) $(call MKESCAPE,$(BUILDDIR))/tinf/tinfgzip.o $(call MKESCAPE,$(BUILDDIR))/tinf/tinflate.o $(call MKESCAPE,$(BUILDDIR))/font.o $(call MKESCAPE,$(BUILDDIR))/sys/smp_trampoline.o
$(MAKE) '$(call SHESCAPE,$(BUILDDIR))/linker_nomap.ld'
@ -363,9 +363,9 @@ $(call MKESCAPE,$(BUILDDIR))/limine_nomap.elf: $(call MKESCAPE,$(BUILDDIR))/limi
-T'$(call SHESCAPE,$(BUILDDIR))/linker_nomap.ld' \
'$(call OBJESCAPE,$^)' $(LIMINE_LDFLAGS) $(INTERNAL_LDFLAGS) -o '$(call SHESCAPE,$@)'
$(call MKESCAPE,$(BUILDDIR))/linker.ld: linker_uefi32.ld.in
$(call MKESCAPE,$(BUILDDIR))/linker.ld: linker_uefi_ia32.ld.in
mkdir -p '$(call SHESCAPE,$(BUILDDIR))'
$(LIMINE_CC) -x c -E -P -undef linker_uefi32.ld.in -o '$(call SHESCAPE,$(BUILDDIR))/linker.ld'
$(LIMINE_CC) -x c -E -P -undef linker_uefi_ia32.ld.in -o '$(call SHESCAPE,$(BUILDDIR))/linker.ld'
$(call MKESCAPE,$(BUILDDIR))/limine.elf: $(call MKESCAPE,$(BUILDDIR))/limine-efi/gnuefi/crt0-efi-ia32.o $(call MKESCAPE,$(BUILDDIR))/limine-efi/gnuefi/libgnuefi.a $(OBJ) $(call MKESCAPE,$(BUILDDIR))/tinf/tinfgzip.o $(call MKESCAPE,$(BUILDDIR))/tinf/tinflate.o $(call MKESCAPE,$(BUILDDIR))/font.o $(call MKESCAPE,$(BUILDDIR))/sys/smp_trampoline.o $(call MKESCAPE,$(BUILDDIR))/full.map.o
$(MAKE) '$(call SHESCAPE,$(BUILDDIR))/linker.ld'
@ -377,13 +377,13 @@ endif
-include $(HEADER_DEPS)
ifeq ($(TARGET), uefi64)
ifeq ($(TARGET), uefi-x86-64)
$(call MKESCAPE,$(BUILDDIR))/%.o: %.c $(call MKESCAPE,$(BUILDDIR))/tinf-copied $(call MKESCAPE,$(BUILDDIR))/limine-efi
mkdir -p "$$(dirname '$(call SHESCAPE,$@)')"
$(LIMINE_CC) $(LIMINE_CFLAGS) $(INTERNAL_CFLAGS) -c '$(call SHESCAPE,$<)' -o '$(call SHESCAPE,$@)'
endif
ifeq ($(TARGET), uefi32)
ifeq ($(TARGET), uefi-ia32)
$(call MKESCAPE,$(BUILDDIR))/%.o: %.c $(call MKESCAPE,$(BUILDDIR))/tinf-copied $(call MKESCAPE,$(BUILDDIR))/limine-efi
mkdir -p "$$(dirname '$(call SHESCAPE,$@)')"
$(LIMINE_CC) $(LIMINE_CFLAGS) $(INTERNAL_CFLAGS) -c '$(call SHESCAPE,$<)' -o '$(call SHESCAPE,$@)'
@ -405,7 +405,7 @@ endif
-include $(HEADER_DEPS)
ifeq ($(TARGET), uefi64)
ifeq ($(TARGET), uefi-x86-64)
$(call MKESCAPE,$(BUILDDIR))/%.32.o: %.32.c $(call MKESCAPE,$(BUILDDIR))/limine-efi
mkdir -p "$$(dirname '$(call SHESCAPE,$@)')"
$(LIMINE_CC) $(LIMINE_CFLAGS) $(INTERNAL_CFLAGS32) -c '$(call SHESCAPE,$<)' -o '$(call SHESCAPE,$@).32'
@ -414,31 +414,31 @@ $(call MKESCAPE,$(BUILDDIR))/%.32.o: %.32.c $(call MKESCAPE,$(BUILDDIR))/limine-
endif
ifeq ($(TARGET), bios)
$(call MKESCAPE,$(BUILDDIR))/%.o: %.asm32
$(call MKESCAPE,$(BUILDDIR))/%.o: %.asm_ia32
mkdir -p "$$(dirname '$(call SHESCAPE,$@)')"
nasm '$(call SHESCAPE,$<)' -F dwarf -g $(WERROR) -f elf32 -o '$(call SHESCAPE,$@)'
$(call MKESCAPE,$(BUILDDIR))/%.o: %.asmb
$(call MKESCAPE,$(BUILDDIR))/%.o: %.asm_bios_ia32
mkdir -p "$$(dirname '$(call SHESCAPE,$@)')"
nasm '$(call SHESCAPE,$<)' -F dwarf -g $(WERROR) -f elf32 -o '$(call SHESCAPE,$@)'
endif
ifeq ($(TARGET), uefi64)
$(call MKESCAPE,$(BUILDDIR))/%.o: %.asm64
ifeq ($(TARGET), uefi-x86-64)
$(call MKESCAPE,$(BUILDDIR))/%.o: %.asm_x86_64
mkdir -p "$$(dirname '$(call SHESCAPE,$@)')"
nasm '$(call SHESCAPE,$<)' -F dwarf -g $(WERROR) -f elf64 -o '$(call SHESCAPE,$@)'
$(call MKESCAPE,$(BUILDDIR))/%.o: %.asm64u
$(call MKESCAPE,$(BUILDDIR))/%.o: %.asm_uefi_x86_64
mkdir -p "$$(dirname '$(call SHESCAPE,$@)')"
nasm '$(call SHESCAPE,$<)' -F dwarf -g $(WERROR) -f elf64 -o '$(call SHESCAPE,$@)'
endif
ifeq ($(TARGET), uefi32)
$(call MKESCAPE,$(BUILDDIR))/%.o: %.asm32
ifeq ($(TARGET), uefi-ia32)
$(call MKESCAPE,$(BUILDDIR))/%.o: %.asm_ia32
mkdir -p "$$(dirname '$(call SHESCAPE,$@)')"
nasm '$(call SHESCAPE,$<)' -F dwarf -g $(WERROR) -f elf32 -o '$(call SHESCAPE,$@)'
$(call MKESCAPE,$(BUILDDIR))/%.o: %.asm32u
$(call MKESCAPE,$(BUILDDIR))/%.o: %.asm_uefi_ia32
mkdir -p "$$(dirname '$(call SHESCAPE,$@)')"
nasm '$(call SHESCAPE,$<)' -F dwarf -g $(WERROR) -f elf32 -o '$(call SHESCAPE,$@)'
endif

View File

@ -49,7 +49,7 @@ fi
BUILD_BIOS="default"
AC_ARG_ENABLE([bios],
AS_HELP_STRING([--disable-bios], [disable building the BIOS port]),
AS_HELP_STRING([--disable-bios], [disable building the x86 BIOS port]),
BUILD_BIOS="$enableval")
if test "x$BUILD_BIOS" = "xno"; then
@ -71,7 +71,7 @@ AC_SUBST(BUILD_LIMINE_DEPLOY, [$BUILD_LIMINE_DEPLOY])
BUILD_CD="default"
AC_ARG_ENABLE([bios-cd],
AS_HELP_STRING([--disable-bios-cd], [disable building the BIOS CD image]),
AS_HELP_STRING([--disable-bios-cd], [disable building the x86 BIOS CD image]),
BUILD_CD="$enableval")
AC_SUBST(BUILD_CD, [$BUILD_CD])
@ -79,52 +79,38 @@ AC_SUBST(BUILD_CD, [$BUILD_CD])
BUILD_PXE="default"
AC_ARG_ENABLE([bios-pxe],
AS_HELP_STRING([--disable-bios-pxe], [disable building the BIOS PXE image]),
AS_HELP_STRING([--disable-bios-pxe], [disable building the x86 BIOS PXE image]),
BUILD_PXE="$enableval")
AC_SUBST(BUILD_PXE, [$BUILD_PXE])
BUILD_UEFI="default"
BUILD_UEFI_IA32="default"
AC_ARG_ENABLE([uefi],
AS_HELP_STRING([--disable-uefi], [disable building both UEFI ports]),
BUILD_UEFI="$enableval")
AC_ARG_ENABLE([uefi-ia32],
AS_HELP_STRING([--disable-uefi-ia32], [disable building the IA-32 UEFI port]),
BUILD_UEFI_IA32="$enableval")
if test "x$BUILD_UEFI" = "xno"; then
BUILD_UEFI=""
if test "x$BUILD_UEFI_IA32" = "xno"; then
BUILD_UEFI_IA32=""
else
BUILD_UEFI="limine-uefi"
BUILD_UEFI_IA32="limine-uefi-ia32"
fi
AC_SUBST(BUILD_UEFI, [$BUILD_UEFI])
AC_SUBST(BUILD_UEFI_IA32, [$BUILD_UEFI_IA32])
BUILD_UEFI32="default"
BUILD_UEFI_X86_64="default"
AC_ARG_ENABLE([uefi32],
AS_HELP_STRING([--disable-uefi32], [disable building the 32-bit UEFI port]),
BUILD_UEFI32="$enableval")
AC_ARG_ENABLE([uefi-x86-64],
AS_HELP_STRING([--disable-uefi-x86_64], [disable building the x86_64 UEFI port]),
BUILD_UEFI_X86_64="$enableval")
if test "x$BUILD_UEFI32" = "xno"; then
BUILD_UEFI32=""
if test "x$BUILD_UEFI_X86_64" = "xno"; then
BUILD_UEFI_X86_64=""
else
BUILD_UEFI32="limine-uefi32"
BUILD_UEFI_X86_64="limine-uefi-x86-64"
fi
AC_SUBST(BUILD_UEFI32, [$BUILD_UEFI32])
BUILD_UEFI64="default"
AC_ARG_ENABLE([uefi64],
AS_HELP_STRING([--disable-uefi64], [disable building the 64-bit UEFI port]),
BUILD_UEFI64="$enableval")
if test "x$BUILD_UEFI64" = "xno"; then
BUILD_UEFI64=""
else
BUILD_UEFI64="limine-uefi64"
fi
AC_SUBST(BUILD_UEFI64, [$BUILD_UEFI64])
AC_SUBST(BUILD_UEFI_X86_64, [$BUILD_UEFI_X86_64])
BUILD_CD_EFI="default"