2022-07-05 09:14:48 +02:00
|
|
|
include $(CROSS_FILE)
|
2022-06-15 07:16:41 +02:00
|
|
|
|
2022-01-02 12:45:15 +01:00
|
|
|
TARGET ?=
|
|
|
|
BUILDDIR ?=
|
2021-03-08 03:05:39 +01:00
|
|
|
|
2022-01-22 03:10:25 +01:00
|
|
|
override SRCDIR := $(shell pwd -P)
|
2021-11-28 19:00:49 +01:00
|
|
|
|
2021-12-08 17:41:19 +01:00
|
|
|
override SPACE := $(subst ,, )
|
2021-11-28 19:00:49 +01:00
|
|
|
|
2021-11-28 19:14:34 +01:00
|
|
|
MKESCAPE = $(subst $(SPACE),\ ,$(1))
|
2021-11-28 19:00:49 +01:00
|
|
|
SHESCAPE = $(subst ','\'',$(1))
|
|
|
|
OBJESCAPE = $(subst .a ,.a' ',$(subst .o ,.o' ',$(call SHESCAPE,$(1))))
|
|
|
|
|
|
|
|
ifeq ($(call MKESCAPE,$(BUILDDIR)), )
|
2021-12-08 17:41:19 +01:00
|
|
|
$(error BUILDDIR not specified)
|
2021-03-08 03:05:39 +01:00
|
|
|
endif
|
2021-03-02 10:23:43 +01:00
|
|
|
|
|
|
|
ifeq ($(TARGET), bios)
|
2021-12-08 17:41:19 +01:00
|
|
|
override OBJCOPY_ARCH := elf32-i386
|
2022-06-15 03:25:36 +02:00
|
|
|
else ifeq ($(TARGET), uefi-x86-64)
|
2021-12-08 17:41:19 +01:00
|
|
|
override OBJCOPY_ARCH := elf64-x86-64
|
2022-06-15 03:25:36 +02:00
|
|
|
else ifeq ($(TARGET), uefi-ia32)
|
2021-12-08 17:41:19 +01:00
|
|
|
override OBJCOPY_ARCH := elf32-i386
|
2021-03-02 10:23:43 +01:00
|
|
|
else
|
2021-12-08 17:41:19 +01:00
|
|
|
$(error Invalid target)
|
2021-03-02 10:23:43 +01:00
|
|
|
endif
|
|
|
|
|
2022-02-01 08:04:55 +01:00
|
|
|
COM_OUTPUT ?= false
|
|
|
|
E9_OUTPUT ?= false
|
2021-02-26 01:30:27 +01:00
|
|
|
|
2022-07-05 09:14:48 +02:00
|
|
|
override S2CFLAGS := $(CROSS_CFLAGS) -Os
|
2020-09-13 14:36:18 +02:00
|
|
|
|
2021-12-08 17:41:19 +01:00
|
|
|
override INTERNAL_CFLAGS := \
|
2022-01-16 22:41:37 +01:00
|
|
|
-g \
|
|
|
|
$(WERROR) \
|
2020-09-17 14:37:22 +02:00
|
|
|
-std=gnu11 \
|
2020-01-21 23:45:13 +01:00
|
|
|
-ffreestanding \
|
2020-09-13 14:36:18 +02:00
|
|
|
-fno-stack-protector \
|
2022-02-21 16:27:52 +01:00
|
|
|
-fno-stack-check \
|
2020-11-15 17:56:10 +01:00
|
|
|
-fno-omit-frame-pointer \
|
2022-01-25 09:16:26 +01:00
|
|
|
-fno-strict-aliasing \
|
2021-03-02 10:23:43 +01:00
|
|
|
-fno-lto \
|
2022-01-20 05:17:45 +01:00
|
|
|
-nostdinc \
|
2020-09-21 12:46:42 +02:00
|
|
|
-Wno-address-of-packed-member \
|
2021-07-06 05:17:18 +02:00
|
|
|
-Wshadow \
|
2022-02-18 01:09:51 +01:00
|
|
|
-Wvla \
|
2021-05-22 10:26:56 +02:00
|
|
|
-mno-80387 \
|
|
|
|
-mno-mmx \
|
|
|
|
-mno-sse \
|
|
|
|
-mno-sse2 \
|
2020-09-21 12:46:42 +02:00
|
|
|
-MMD \
|
2021-02-26 01:30:27 +01:00
|
|
|
-DCOM_OUTPUT=$(COM_OUTPUT) \
|
|
|
|
-DE9_OUTPUT=$(E9_OUTPUT) \
|
2022-06-30 07:48:42 +02:00
|
|
|
-I../freestanding-headers \
|
2022-02-21 00:40:15 +01:00
|
|
|
-I'$(call SHESCAPE,$(BUILDDIR))/..' \
|
2020-04-29 16:53:05 +02:00
|
|
|
-I. \
|
2022-03-26 01:31:38 +01:00
|
|
|
-I.. \
|
2021-11-28 19:00:49 +01:00
|
|
|
-I'$(call SHESCAPE,$(BUILDDIR))/tinf'
|
2020-01-21 23:45:13 +01:00
|
|
|
|
2021-03-04 05:15:20 +01:00
|
|
|
ifeq ($(TARGET), bios)
|
2021-12-08 17:41:19 +01:00
|
|
|
override INTERNAL_CFLAGS += \
|
2021-07-15 10:03:47 +02:00
|
|
|
-Dbios=1 \
|
|
|
|
-Duefi=0 \
|
2021-04-03 00:48:38 +02:00
|
|
|
-m32 \
|
2021-11-10 13:18:08 +01:00
|
|
|
-march=i686 \
|
2021-10-11 21:35:23 +02:00
|
|
|
-mtune=generic \
|
2021-07-31 21:28:06 +02:00
|
|
|
-mabi=sysv \
|
2022-08-09 15:22:15 +02:00
|
|
|
-fno-pie \
|
|
|
|
-fno-pic
|
2021-03-04 05:15:20 +01:00
|
|
|
endif
|
|
|
|
|
2022-06-15 03:25:36 +02:00
|
|
|
ifeq ($(TARGET), uefi-x86-64)
|
2021-12-08 17:41:19 +01:00
|
|
|
override INTERNAL_CFLAGS32 := \
|
2021-05-03 01:08:31 +02:00
|
|
|
$(INTERNAL_CFLAGS) \
|
2021-07-15 10:03:47 +02:00
|
|
|
-Dbios=0 \
|
|
|
|
-Duefi=1 \
|
2021-05-03 01:08:31 +02:00
|
|
|
-m32 \
|
2021-11-10 13:18:08 +01:00
|
|
|
-march=i686 \
|
2021-10-11 21:35:23 +02:00
|
|
|
-mtune=generic \
|
2021-07-31 21:28:06 +02:00
|
|
|
-mabi=sysv \
|
2021-08-25 22:03:00 +02:00
|
|
|
-DGNU_EFI_USE_MS_ABI \
|
2021-05-03 01:08:31 +02:00
|
|
|
-fpie
|
|
|
|
|
2021-12-08 17:41:19 +01:00
|
|
|
override INTERNAL_CFLAGS += \
|
2021-07-15 10:03:47 +02:00
|
|
|
-Dbios=0 \
|
|
|
|
-Duefi=1 \
|
2021-04-03 00:48:38 +02:00
|
|
|
-m64 \
|
|
|
|
-march=x86-64 \
|
2021-10-11 21:35:23 +02:00
|
|
|
-mtune=generic \
|
2021-07-31 21:28:06 +02:00
|
|
|
-mabi=sysv \
|
2021-08-25 22:03:00 +02:00
|
|
|
-DGNU_EFI_USE_MS_ABI \
|
2022-06-14 05:58:34 +02:00
|
|
|
-I'$(call SHESCAPE,$(BUILDDIR))/limine-efi/inc' \
|
|
|
|
-I'$(call SHESCAPE,$(BUILDDIR))/limine-efi/inc/x86_64' \
|
2021-04-02 16:45:14 +02:00
|
|
|
-fpie \
|
2021-03-04 05:15:20 +01:00
|
|
|
-mno-red-zone
|
2021-03-02 10:23:43 +01:00
|
|
|
endif
|
|
|
|
|
2022-06-15 03:25:36 +02:00
|
|
|
ifeq ($(TARGET), uefi-ia32)
|
2021-12-08 17:41:19 +01:00
|
|
|
override INTERNAL_CFLAGS += \
|
2021-07-20 13:35:43 +02:00
|
|
|
-Dbios=0 \
|
|
|
|
-Duefi=1 \
|
|
|
|
-m32 \
|
2021-11-10 13:18:08 +01:00
|
|
|
-march=i686 \
|
2021-10-11 21:35:23 +02:00
|
|
|
-mtune=generic \
|
2021-07-31 21:28:06 +02:00
|
|
|
-mabi=sysv \
|
2021-08-25 22:03:00 +02:00
|
|
|
-DGNU_EFI_USE_MS_ABI \
|
2022-06-14 05:58:34 +02:00
|
|
|
-I'$(call SHESCAPE,$(BUILDDIR))/limine-efi/inc' \
|
|
|
|
-I'$(call SHESCAPE,$(BUILDDIR))/limine-efi/inc/ia32' \
|
2021-07-20 13:35:43 +02:00
|
|
|
-fpie
|
|
|
|
endif
|
|
|
|
|
2021-12-08 17:41:19 +01:00
|
|
|
override INTERNAL_LDFLAGS := \
|
2020-01-21 23:45:13 +01:00
|
|
|
-nostdlib \
|
2021-03-02 10:23:43 +01:00
|
|
|
-z max-page-size=0x1000
|
|
|
|
|
|
|
|
ifeq ($(TARGET), bios)
|
2021-12-08 17:41:19 +01:00
|
|
|
override INTERNAL_LDFLAGS += \
|
2021-05-31 00:32:43 +02:00
|
|
|
-melf_i386 \
|
2021-11-08 09:42:41 +01:00
|
|
|
-static \
|
|
|
|
--build-id=sha1
|
2021-03-02 10:23:43 +01:00
|
|
|
endif
|
2020-01-21 23:45:13 +01:00
|
|
|
|
2022-06-15 03:25:36 +02:00
|
|
|
ifeq ($(TARGET), uefi-x86-64)
|
2021-12-08 17:41:19 +01:00
|
|
|
override INTERNAL_LDFLAGS += \
|
2021-05-31 00:32:43 +02:00
|
|
|
-melf_x86_64 \
|
|
|
|
-static \
|
|
|
|
-pie \
|
|
|
|
--no-dynamic-linker \
|
|
|
|
-ztext
|
2021-04-02 16:45:14 +02:00
|
|
|
endif
|
|
|
|
|
2022-06-15 03:25:36 +02:00
|
|
|
ifeq ($(TARGET), uefi-ia32)
|
2021-12-08 17:41:19 +01:00
|
|
|
override INTERNAL_LDFLAGS += \
|
2021-07-20 13:35:43 +02:00
|
|
|
-melf_i386 \
|
|
|
|
-static \
|
|
|
|
-pie \
|
|
|
|
--no-dynamic-linker \
|
|
|
|
-ztext
|
|
|
|
endif
|
|
|
|
|
2022-06-15 07:16:41 +02:00
|
|
|
.PHONY: all
|
2020-01-21 23:45:13 +01:00
|
|
|
|
2022-01-22 03:10:25 +01:00
|
|
|
override C_FILES := $(shell find ./ -type f -name '*.c')
|
2021-03-02 10:23:43 +01:00
|
|
|
ifeq ($(TARGET), bios)
|
2022-06-28 08:47:40 +02:00
|
|
|
override ASMX86_FILES := $(shell find ./ -type f -name '*.asm_x86')
|
2022-06-15 03:25:36 +02:00
|
|
|
override ASM32_FILES := $(shell find ./ -type f -name '*.asm_ia32')
|
|
|
|
override ASMB_FILES := $(shell find ./ -type f -name '*.asm_bios_ia32')
|
2021-10-22 15:45:47 +02:00
|
|
|
|
2022-06-28 08:47:40 +02:00
|
|
|
override OBJ := $(addprefix $(call MKESCAPE,$(BUILDDIR))/, $(C_FILES:.c=.o) $(ASM32_FILES:.asm_ia32=.o) $(ASMB_FILES:.asm_bios_ia32=.o) $(ASMX86_FILES:.asm_x86=.o))
|
2022-07-18 21:02:44 +02:00
|
|
|
override OBJ_S2 := $(filter %.s2.o,$(OBJ))
|
2021-03-02 10:23:43 +01:00
|
|
|
endif
|
2022-06-15 03:25:36 +02:00
|
|
|
ifeq ($(TARGET), uefi-x86-64)
|
2022-06-28 08:47:40 +02:00
|
|
|
override ASMX86_FILES := $(shell find ./ -type f -name '*.asm_x86')
|
2022-06-15 03:25:36 +02:00
|
|
|
override ASM64_FILES := $(shell find ./ -type f -name '*.asm_x86_64')
|
|
|
|
override ASM64U_FILES := $(shell find ./ -type f -name '*.asm_uefi_x86_64')
|
2021-10-22 15:45:47 +02:00
|
|
|
|
2022-06-28 08:47:40 +02:00
|
|
|
override OBJ := $(addprefix $(call MKESCAPE,$(BUILDDIR))/, $(C_FILES:.c=.o) $(ASM64_FILES:.asm_x86_64=.o) $(ASM64U_FILES:.asm_uefi_x86_64=.o) $(ASMX86_FILES:.asm_x86=.o))
|
2021-03-07 00:52:25 +01:00
|
|
|
endif
|
2022-06-15 03:25:36 +02:00
|
|
|
ifeq ($(TARGET), uefi-ia32)
|
2022-06-28 08:47:40 +02:00
|
|
|
override ASMX86_FILES := $(shell find ./ -type f -name '*.asm_x86')
|
2022-06-15 03:25:36 +02:00
|
|
|
override ASM32_FILES := $(shell find ./ -type f -name '*.asm_ia32')
|
|
|
|
override ASM32U_FILES := $(shell find ./ -type f -name '*.asm_uefi_ia32')
|
2021-10-22 15:45:47 +02:00
|
|
|
|
2022-06-28 08:47:40 +02:00
|
|
|
override OBJ := $(addprefix $(call MKESCAPE,$(BUILDDIR))/, $(C_FILES:.c=.o) $(ASM32_FILES:.asm_ia32=.o) $(ASM32U_FILES:.asm_uefi_ia32=.o) $(ASMX86_FILES:.asm_x86=.o))
|
2021-07-20 13:35:43 +02:00
|
|
|
endif
|
2021-12-08 17:41:19 +01:00
|
|
|
override HEADER_DEPS := $(addprefix $(call MKESCAPE,$(BUILDDIR))/, $(C_FILES:.c=.d))
|
2020-01-21 23:45:13 +01:00
|
|
|
|
2021-03-02 10:23:43 +01:00
|
|
|
ifeq ($(TARGET), bios)
|
2022-05-20 05:48:59 +02:00
|
|
|
all: $(call MKESCAPE,$(BUILDDIR))/limine.sys $(call MKESCAPE,$(BUILDDIR))/stage2.bin.gz
|
2022-06-15 03:25:36 +02:00
|
|
|
else ifeq ($(TARGET), uefi-x86-64)
|
2021-12-08 17:41:19 +01:00
|
|
|
all: $(call MKESCAPE,$(BUILDDIR))/BOOTX64.EFI
|
2022-06-15 03:25:36 +02:00
|
|
|
else ifeq ($(TARGET), uefi-ia32)
|
2021-12-08 17:41:19 +01:00
|
|
|
all: $(call MKESCAPE,$(BUILDDIR))/BOOTIA32.EFI
|
2021-03-02 10:23:43 +01:00
|
|
|
endif
|
|
|
|
|
2021-11-28 19:00:49 +01:00
|
|
|
$(call MKESCAPE,$(BUILDDIR))/font.o: font.bin
|
2022-08-08 22:00:25 +02:00
|
|
|
$(MKDIR_P) "$$(dirname '$(call SHESCAPE,$@)')"
|
2022-07-05 09:14:48 +02:00
|
|
|
$(CROSS_OBJCOPY) -B i8086 -I binary -O $(OBJCOPY_ARCH) font.bin '$(call SHESCAPE,$@)'
|
2021-03-08 00:50:23 +01:00
|
|
|
|
2021-11-28 19:00:49 +01:00
|
|
|
$(call MKESCAPE,$(BUILDDIR))/tinf-copied: ../tinf/*
|
|
|
|
rm -rf '$(call SHESCAPE,$(BUILDDIR))/tinf'
|
2022-08-08 22:00:25 +02:00
|
|
|
$(MKDIR_P) '$(call SHESCAPE,$(BUILDDIR))'
|
2021-11-28 19:00:49 +01:00
|
|
|
cp -r ../tinf '$(call SHESCAPE,$(BUILDDIR))/'
|
|
|
|
touch '$(call SHESCAPE,$(BUILDDIR))/tinf-copied'
|
2021-10-22 20:08:11 +02:00
|
|
|
|
2022-01-17 22:13:19 +01:00
|
|
|
$(call MKESCAPE,$(BUILDDIR))/tinf/tinfgzip.o: $(call MKESCAPE,$(BUILDDIR))/tinf-copied
|
2022-08-08 22:00:25 +02:00
|
|
|
$(MKDIR_P) "$$(dirname '$(call SHESCAPE,$@)')"
|
2022-07-05 09:14:48 +02:00
|
|
|
$(CROSS_CC) $(CROSS_CFLAGS) $(INTERNAL_CFLAGS) -c '$(call SHESCAPE,$(@:.o=.c))' -o '$(call SHESCAPE,$@)'
|
2022-01-17 22:13:19 +01:00
|
|
|
|
|
|
|
$(call MKESCAPE,$(BUILDDIR))/tinf/tinflate.o: $(call MKESCAPE,$(BUILDDIR))/tinf-copied
|
2022-08-08 22:00:25 +02:00
|
|
|
$(MKDIR_P) "$$(dirname '$(call SHESCAPE,$@)')"
|
2022-07-05 09:14:48 +02:00
|
|
|
$(CROSS_CC) $(CROSS_CFLAGS) $(INTERNAL_CFLAGS) -c '$(call SHESCAPE,$(@:.o=.c))' -o '$(call SHESCAPE,$@)'
|
2021-10-22 20:08:11 +02:00
|
|
|
|
2021-03-08 00:50:23 +01:00
|
|
|
ifeq ($(TARGET), bios)
|
|
|
|
|
2021-11-28 19:00:49 +01:00
|
|
|
$(call MKESCAPE,$(BUILDDIR))/stage2.bin.gz: $(call MKESCAPE,$(BUILDDIR))/stage2.bin
|
|
|
|
gzip -n -9 < '$(call SHESCAPE,$<)' > '$(call SHESCAPE,$@)'
|
2021-02-20 23:04:06 +01:00
|
|
|
|
2021-11-28 19:00:49 +01:00
|
|
|
$(call MKESCAPE,$(BUILDDIR))/stage2.bin: $(call MKESCAPE,$(BUILDDIR))/limine.sys
|
2022-07-05 09:14:48 +02:00
|
|
|
dd if='$(call SHESCAPE,$<)' bs=$$(( 0x$$("$(CROSS_READELF)" -S '$(call SHESCAPE,$(BUILDDIR))/limine.elf' | $(GREP) .text.stage3 | $(SED) 's/^.*] //' | $(AWK) '{print $$3}' | $(SED) 's/^0*//') - 0x8000 )) count=1 of='$(call SHESCAPE,$@)' 2>/dev/null
|
2021-02-20 23:04:06 +01:00
|
|
|
|
2021-11-28 19:00:49 +01:00
|
|
|
$(call MKESCAPE,$(BUILDDIR))/stage2.map.o: $(call MKESCAPE,$(BUILDDIR))/limine_stage2only.elf
|
|
|
|
cd '$(call SHESCAPE,$(BUILDDIR))' && \
|
2022-04-20 04:00:00 +02:00
|
|
|
'$(call SHESCAPE,$(SRCDIR))/gensyms.sh' '$(call SHESCAPE,$<)' stage2 32 '\.text'
|
2022-08-13 20:32:06 +02:00
|
|
|
$(CROSS_CC) $(CROSS_CFLAGS) $(INTERNAL_CFLAGS) -c '$(call SHESCAPE,$(BUILDDIR))/stage2.map.S' -o '$(call SHESCAPE,$@)'
|
|
|
|
rm -f '$(call SHESCAPE,$(BUILDDIR))/stage2.map.S' '$(call SHESCAPE,$(BUILDDIR))/stage2.map.d'
|
2021-03-12 05:19:56 +01:00
|
|
|
|
2021-11-28 19:00:49 +01:00
|
|
|
$(call MKESCAPE,$(BUILDDIR))/full.map.o: $(call MKESCAPE,$(BUILDDIR))/limine_nomap.elf
|
|
|
|
cd '$(call SHESCAPE,$(BUILDDIR))' && \
|
2022-04-20 04:00:00 +02:00
|
|
|
'$(call SHESCAPE,$(SRCDIR))/gensyms.sh' '$(call SHESCAPE,$<)' full 32 '\.text'
|
2022-08-13 20:32:06 +02:00
|
|
|
$(CROSS_CC) $(CROSS_CFLAGS) $(INTERNAL_CFLAGS) -c '$(call SHESCAPE,$(BUILDDIR))/full.map.S' -o '$(call SHESCAPE,$@)'
|
|
|
|
rm -f '$(call SHESCAPE,$(BUILDDIR))/full.map.S' '$(call SHESCAPE,$(BUILDDIR))/full.map.d'
|
2020-01-21 23:45:13 +01:00
|
|
|
|
2021-11-28 19:00:49 +01:00
|
|
|
$(call MKESCAPE,$(BUILDDIR))/limine.sys: $(call MKESCAPE,$(BUILDDIR))/limine.elf
|
2022-07-05 09:14:48 +02:00
|
|
|
$(CROSS_OBJCOPY) -O binary '$(call SHESCAPE,$<)' '$(call SHESCAPE,$@)'
|
2020-11-15 17:56:10 +01:00
|
|
|
|
2022-02-02 18:18:49 +01:00
|
|
|
$(call MKESCAPE,$(BUILDDIR))/linker_stage2only.ld: linker_bios.ld.in
|
2022-08-08 22:00:25 +02:00
|
|
|
$(MKDIR_P) '$(call SHESCAPE,$(BUILDDIR))'
|
2022-07-05 09:14:48 +02:00
|
|
|
$(CROSS_CC) -x c -E -P -undef -DLINKER_STAGE2ONLY linker_bios.ld.in -o '$(call SHESCAPE,$(BUILDDIR))/linker_stage2only.ld'
|
2022-02-02 18:18:49 +01:00
|
|
|
|
2022-07-18 21:02:44 +02:00
|
|
|
$(call MKESCAPE,$(BUILDDIR))/limine_stage2only.elf: $(OBJ_S2) ../libgcc-binaries/libgcc-i686.a
|
2022-02-02 18:18:49 +01:00
|
|
|
$(MAKE) '$(call SHESCAPE,$(BUILDDIR))/linker_stage2only.ld'
|
2022-07-05 09:14:48 +02:00
|
|
|
$(CROSS_LD) '$(call OBJESCAPE,$^)' $(CROSS_LDFLAGS) $(INTERNAL_LDFLAGS) -T'$(call SHESCAPE,$(BUILDDIR))/linker_stage2only.ld' -o '$(call SHESCAPE,$@)' || \
|
2021-05-04 13:56:00 +02:00
|
|
|
( echo "This error may mean that stage 2 was trying to use stage 3 symbols before loading stage 3" && \
|
2021-02-25 11:28:14 +01:00
|
|
|
false )
|
2021-02-25 01:24:54 +01:00
|
|
|
|
2022-02-02 18:18:49 +01:00
|
|
|
$(call MKESCAPE,$(BUILDDIR))/linker_nomap.ld: linker_bios.ld.in
|
2022-08-08 22:00:25 +02:00
|
|
|
$(MKDIR_P) '$(call SHESCAPE,$(BUILDDIR))'
|
2022-07-05 09:14:48 +02:00
|
|
|
$(CROSS_CC) -x c -E -P -undef -DLINKER_NOMAP linker_bios.ld.in -o '$(call SHESCAPE,$(BUILDDIR))/linker_nomap.ld'
|
2022-02-02 18:18:49 +01:00
|
|
|
|
2022-07-28 09:35:59 +02:00
|
|
|
$(call MKESCAPE,$(BUILDDIR))/limine_nomap.elf: $(OBJ) ../libgcc-binaries/libgcc-i686.a $(call MKESCAPE,$(BUILDDIR))/tinf/tinfgzip.o $(call MKESCAPE,$(BUILDDIR))/tinf/tinflate.o $(call MKESCAPE,$(BUILDDIR))/font.o $(call MKESCAPE,$(BUILDDIR))/stage2.map.o
|
2022-02-02 18:18:49 +01:00
|
|
|
$(MAKE) '$(call SHESCAPE,$(BUILDDIR))/linker_nomap.ld'
|
2022-07-05 09:14:48 +02:00
|
|
|
$(CROSS_LD) '$(call OBJESCAPE,$^)' $(CROSS_LDFLAGS) $(INTERNAL_LDFLAGS) -T'$(call SHESCAPE,$(BUILDDIR))/linker_nomap.ld' -o '$(call SHESCAPE,$@)'
|
|
|
|
$(CROSS_OBJCOPY) -O binary --only-section=.note.gnu.build-id '$(call SHESCAPE,$@)' '$(call SHESCAPE,$(BUILDDIR))/build-id.s2.bin'
|
2022-05-20 20:02:14 +02:00
|
|
|
cd '$(call SHESCAPE,$(BUILDDIR))' && \
|
2022-07-05 09:14:48 +02:00
|
|
|
$(CROSS_OBJCOPY) -B i8086 -I binary -O $(OBJCOPY_ARCH) build-id.s2.bin build-id.s2.o
|
|
|
|
$(CROSS_OBJCOPY) -O binary --only-section=.note.gnu.build-id '$(call SHESCAPE,$@)' '$(call SHESCAPE,$(BUILDDIR))/build-id.s3.bin'
|
2022-05-20 20:02:14 +02:00
|
|
|
cd '$(call SHESCAPE,$(BUILDDIR))' && \
|
2022-07-05 09:14:48 +02:00
|
|
|
$(CROSS_OBJCOPY) -B i8086 -I binary -O $(OBJCOPY_ARCH) build-id.s3.bin build-id.s3.o
|
|
|
|
$(CROSS_LD) '$(call OBJESCAPE,$^)' '$(call SHESCAPE,$(BUILDDIR))/build-id.s2.o' '$(call SHESCAPE,$(BUILDDIR))/build-id.s3.o' $(CROSS_LDFLAGS) $(INTERNAL_LDFLAGS) -T'$(call SHESCAPE,$(BUILDDIR))/linker_nomap.ld' -o '$(call SHESCAPE,$@)'
|
2022-02-02 18:18:49 +01:00
|
|
|
|
|
|
|
$(call MKESCAPE,$(BUILDDIR))/linker.ld: linker_bios.ld.in
|
2022-08-08 22:00:25 +02:00
|
|
|
$(MKDIR_P) '$(call SHESCAPE,$(BUILDDIR))'
|
2022-07-05 09:14:48 +02:00
|
|
|
$(CROSS_CC) -x c -E -P -undef linker_bios.ld.in -o '$(call SHESCAPE,$(BUILDDIR))/linker.ld'
|
2021-03-12 05:19:56 +01:00
|
|
|
|
2022-07-28 09:35:59 +02:00
|
|
|
$(call MKESCAPE,$(BUILDDIR))/limine.elf: $(OBJ) ../libgcc-binaries/libgcc-i686.a $(call MKESCAPE,$(BUILDDIR))/tinf/tinfgzip.o $(call MKESCAPE,$(BUILDDIR))/tinf/tinflate.o $(call MKESCAPE,$(BUILDDIR))/font.o $(call MKESCAPE,$(BUILDDIR))/stage2.map.o $(call MKESCAPE,$(BUILDDIR))/full.map.o
|
2022-02-02 18:18:49 +01:00
|
|
|
$(MAKE) '$(call SHESCAPE,$(BUILDDIR))/linker.ld'
|
2022-07-05 09:14:48 +02:00
|
|
|
$(CROSS_LD) '$(call OBJESCAPE,$^)' $(CROSS_LDFLAGS) $(INTERNAL_LDFLAGS) -T'$(call SHESCAPE,$(BUILDDIR))/linker.ld' -o '$(call SHESCAPE,$@)'
|
|
|
|
$(CROSS_OBJCOPY) -O binary --only-section=.note.gnu.build-id '$(call SHESCAPE,$@)' '$(call SHESCAPE,$(BUILDDIR))/build-id.s2.bin'
|
2021-11-28 19:00:49 +01:00
|
|
|
cd '$(call SHESCAPE,$(BUILDDIR))' && \
|
2022-07-05 09:14:48 +02:00
|
|
|
$(CROSS_OBJCOPY) -B i8086 -I binary -O $(OBJCOPY_ARCH) build-id.s2.bin build-id.s2.o
|
|
|
|
$(CROSS_OBJCOPY) -O binary --only-section=.note.gnu.build-id '$(call SHESCAPE,$@)' '$(call SHESCAPE,$(BUILDDIR))/build-id.s3.bin'
|
2021-11-28 19:00:49 +01:00
|
|
|
cd '$(call SHESCAPE,$(BUILDDIR))' && \
|
2022-07-05 09:14:48 +02:00
|
|
|
$(CROSS_OBJCOPY) -B i8086 -I binary -O $(OBJCOPY_ARCH) build-id.s3.bin build-id.s3.o
|
|
|
|
$(CROSS_LD) '$(call OBJESCAPE,$^)' '$(call SHESCAPE,$(BUILDDIR))/build-id.s2.o' '$(call SHESCAPE,$(BUILDDIR))/build-id.s3.o' $(CROSS_LDFLAGS) $(INTERNAL_LDFLAGS) -T'$(call SHESCAPE,$(BUILDDIR))/linker.ld' -o '$(call SHESCAPE,$@)'
|
2022-02-02 18:18:49 +01:00
|
|
|
|
2021-03-08 00:50:23 +01:00
|
|
|
endif
|
2021-03-03 21:40:55 +01:00
|
|
|
|
2022-06-14 05:58:34 +02:00
|
|
|
$(call MKESCAPE,$(BUILDDIR))/limine-efi: ../limine-efi/*
|
2022-08-08 22:00:25 +02:00
|
|
|
$(MKDIR_P) '$(call SHESCAPE,$(BUILDDIR))'
|
2022-06-14 05:58:34 +02:00
|
|
|
cp -r ../limine-efi '$(call SHESCAPE,$(BUILDDIR))/'
|
2021-07-20 13:35:43 +02:00
|
|
|
|
2022-06-15 03:25:36 +02:00
|
|
|
ifeq ($(TARGET), uefi-x86-64)
|
2021-03-02 06:05:14 +01:00
|
|
|
|
2022-02-03 10:38:43 +01:00
|
|
|
$(call MKESCAPE,$(BUILDDIR))/full.map.o: $(call MKESCAPE,$(BUILDDIR))/limine_nomap.elf
|
2021-11-28 19:00:49 +01:00
|
|
|
cd '$(call SHESCAPE,$(BUILDDIR))' && \
|
2022-04-24 23:30:28 +02:00
|
|
|
'$(call SHESCAPE,$(SRCDIR))/gensyms.sh' '$(call SHESCAPE,$<)' full 64 '\.text'
|
2022-08-13 20:32:06 +02:00
|
|
|
$(CROSS_CC) $(CROSS_CFLAGS) $(INTERNAL_CFLAGS) -c '$(call SHESCAPE,$(BUILDDIR))/full.map.S' -o '$(call SHESCAPE,$@)'
|
|
|
|
rm -f '$(call SHESCAPE,$(BUILDDIR))/full.map.S' '$(call SHESCAPE,$(BUILDDIR))/full.map.d'
|
2021-04-08 01:15:35 +02:00
|
|
|
|
2022-02-03 10:38:43 +01:00
|
|
|
$(call MKESCAPE,$(BUILDDIR))/BOOTX64.EFI: $(call MKESCAPE,$(BUILDDIR))/limine.elf
|
2022-07-05 09:14:48 +02:00
|
|
|
$(CROSS_OBJCOPY) -O binary '$(call SHESCAPE,$<)' '$(call SHESCAPE,$@)'
|
2021-03-04 05:15:20 +01:00
|
|
|
|
2022-07-18 20:48:09 +02:00
|
|
|
$(call MKESCAPE,$(BUILDDIR))/limine-efi/gnuefi/crt0-efi-x86_64.o $(call MKESCAPE,$(BUILDDIR))/limine-efi/gnuefi/reloc_x86_64.o: $(call MKESCAPE,$(BUILDDIR))/limine-efi
|
2022-06-22 21:56:41 +02:00
|
|
|
unset CPPFLAGS; \
|
2022-06-14 05:58:34 +02:00
|
|
|
$(MAKE) -C '$(call SHESCAPE,$(BUILDDIR))/limine-efi/gnuefi' \
|
2022-07-05 09:14:48 +02:00
|
|
|
CC="$(CROSS_CC) -m64 -march=x86-64 -mtune=generic" \
|
2022-02-21 16:27:52 +01:00
|
|
|
CFLAGS='-nostdinc' \
|
2022-06-30 07:48:42 +02:00
|
|
|
INCDIR='-I$(call SHESCAPE,$(SRCDIR))/../freestanding-headers' \
|
2022-01-17 00:20:59 +01:00
|
|
|
ARCH=x86_64
|
2021-06-30 21:58:11 +02:00
|
|
|
|
2022-06-15 03:25:36 +02:00
|
|
|
$(call MKESCAPE,$(BUILDDIR))/linker_nomap.ld: linker_uefi_x86_64.ld.in
|
2022-08-08 22:00:25 +02:00
|
|
|
$(MKDIR_P) '$(call SHESCAPE,$(BUILDDIR))'
|
2022-07-05 09:14:48 +02:00
|
|
|
$(CROSS_CC) -x c -E -P -undef -DLINKER_NOMAP linker_uefi_x86_64.ld.in -o '$(call SHESCAPE,$(BUILDDIR))/linker_nomap.ld'
|
2022-02-02 18:18:49 +01:00
|
|
|
|
2022-07-28 09:35:59 +02:00
|
|
|
$(call MKESCAPE,$(BUILDDIR))/limine_nomap.elf: $(call MKESCAPE,$(BUILDDIR))/limine-efi/gnuefi/crt0-efi-x86_64.o $(call MKESCAPE,$(BUILDDIR))/limine-efi/gnuefi/reloc_x86_64.o $(OBJ) ../libgcc-binaries/libgcc-x86_64-no-red-zone.a $(call MKESCAPE,$(BUILDDIR))/tinf/tinfgzip.o $(call MKESCAPE,$(BUILDDIR))/tinf/tinflate.o $(call MKESCAPE,$(BUILDDIR))/font.o
|
2022-02-02 18:18:49 +01:00
|
|
|
$(MAKE) '$(call SHESCAPE,$(BUILDDIR))/linker_nomap.ld'
|
2022-07-05 09:14:48 +02:00
|
|
|
$(CROSS_LD) \
|
2022-02-02 18:18:49 +01:00
|
|
|
-T'$(call SHESCAPE,$(BUILDDIR))/linker_nomap.ld' \
|
2022-07-05 09:14:48 +02:00
|
|
|
'$(call OBJESCAPE,$^)' $(CROSS_LDFLAGS) $(INTERNAL_LDFLAGS) -o '$(call SHESCAPE,$@)'
|
2021-04-08 01:15:35 +02:00
|
|
|
|
2022-06-15 03:25:36 +02:00
|
|
|
$(call MKESCAPE,$(BUILDDIR))/linker.ld: linker_uefi_x86_64.ld.in
|
2022-08-08 22:00:25 +02:00
|
|
|
$(MKDIR_P) '$(call SHESCAPE,$(BUILDDIR))'
|
2022-07-05 09:14:48 +02:00
|
|
|
$(CROSS_CC) -x c -E -P -undef linker_uefi_x86_64.ld.in -o '$(call SHESCAPE,$(BUILDDIR))/linker.ld'
|
2022-02-02 18:18:49 +01:00
|
|
|
|
2022-07-28 09:35:59 +02:00
|
|
|
$(call MKESCAPE,$(BUILDDIR))/limine.elf: $(call MKESCAPE,$(BUILDDIR))/limine-efi/gnuefi/crt0-efi-x86_64.o $(call MKESCAPE,$(BUILDDIR))/limine-efi/gnuefi/reloc_x86_64.o $(OBJ) ../libgcc-binaries/libgcc-x86_64-no-red-zone.a $(call MKESCAPE,$(BUILDDIR))/tinf/tinfgzip.o $(call MKESCAPE,$(BUILDDIR))/tinf/tinflate.o $(call MKESCAPE,$(BUILDDIR))/font.o $(call MKESCAPE,$(BUILDDIR))/full.map.o
|
2022-02-02 18:18:49 +01:00
|
|
|
$(MAKE) '$(call SHESCAPE,$(BUILDDIR))/linker.ld'
|
2022-07-05 09:14:48 +02:00
|
|
|
$(CROSS_LD) \
|
2022-02-02 18:18:49 +01:00
|
|
|
-T'$(call SHESCAPE,$(BUILDDIR))/linker.ld' \
|
2022-07-05 09:14:48 +02:00
|
|
|
'$(call OBJESCAPE,$^)' $(CROSS_LDFLAGS) $(INTERNAL_LDFLAGS) -o '$(call SHESCAPE,$@)'
|
2021-03-08 00:50:23 +01:00
|
|
|
|
|
|
|
endif
|
2020-01-21 23:45:13 +01:00
|
|
|
|
2022-06-15 03:25:36 +02:00
|
|
|
ifeq ($(TARGET), uefi-ia32)
|
2021-07-20 13:35:43 +02:00
|
|
|
|
2022-02-03 10:38:43 +01:00
|
|
|
$(call MKESCAPE,$(BUILDDIR))/full.map.o: $(call MKESCAPE,$(BUILDDIR))/limine_nomap.elf
|
2021-11-28 19:00:49 +01:00
|
|
|
cd '$(call SHESCAPE,$(BUILDDIR))' && \
|
2022-04-24 23:30:28 +02:00
|
|
|
'$(call SHESCAPE,$(SRCDIR))/gensyms.sh' '$(call SHESCAPE,$<)' full 32 '\.text'
|
2022-08-13 20:32:06 +02:00
|
|
|
$(CROSS_CC) $(CROSS_CFLAGS) $(INTERNAL_CFLAGS) -c '$(call SHESCAPE,$(BUILDDIR))/full.map.S' -o '$(call SHESCAPE,$@)'
|
|
|
|
rm -f '$(call SHESCAPE,$(BUILDDIR))/full.map.S' '$(call SHESCAPE,$(BUILDDIR))/full.map.d'
|
2021-07-20 13:35:43 +02:00
|
|
|
|
2022-02-03 10:38:43 +01:00
|
|
|
$(call MKESCAPE,$(BUILDDIR))/BOOTIA32.EFI: $(call MKESCAPE,$(BUILDDIR))/limine.elf
|
2022-07-05 09:14:48 +02:00
|
|
|
$(CROSS_OBJCOPY) -O binary '$(call SHESCAPE,$<)' '$(call SHESCAPE,$@)'
|
2021-07-20 13:35:43 +02:00
|
|
|
|
2022-07-18 20:48:09 +02:00
|
|
|
$(call MKESCAPE,$(BUILDDIR))/limine-efi/gnuefi/crt0-efi-ia32.o $(call MKESCAPE,$(BUILDDIR))/limine-efi/gnuefi/reloc_ia32.o: $(call MKESCAPE,$(BUILDDIR))/limine-efi
|
2022-06-22 21:56:41 +02:00
|
|
|
unset CPPFLAGS; \
|
2022-06-14 05:58:34 +02:00
|
|
|
$(MAKE) -C '$(call SHESCAPE,$(BUILDDIR))/limine-efi/gnuefi' \
|
2022-07-05 09:14:48 +02:00
|
|
|
CC="$(CROSS_CC) -m32 -march=i686 -mtune=generic" \
|
2022-02-21 16:27:52 +01:00
|
|
|
CFLAGS='-nostdinc' \
|
2022-06-30 07:48:42 +02:00
|
|
|
INCDIR='-I$(call SHESCAPE,$(SRCDIR))/../freestanding-headers' \
|
2022-01-17 00:20:59 +01:00
|
|
|
ARCH=ia32
|
2021-07-20 13:35:43 +02:00
|
|
|
|
2022-06-15 03:25:36 +02:00
|
|
|
$(call MKESCAPE,$(BUILDDIR))/linker_nomap.ld: linker_uefi_ia32.ld.in
|
2022-08-08 22:00:25 +02:00
|
|
|
$(MKDIR_P) '$(call SHESCAPE,$(BUILDDIR))'
|
2022-07-05 09:14:48 +02:00
|
|
|
$(CROSS_CC) -x c -E -P -undef -DLINKER_NOMAP linker_uefi_ia32.ld.in -o '$(call SHESCAPE,$(BUILDDIR))/linker_nomap.ld'
|
2022-02-02 18:18:49 +01:00
|
|
|
|
2022-07-28 09:35:59 +02:00
|
|
|
$(call MKESCAPE,$(BUILDDIR))/limine_nomap.elf: $(call MKESCAPE,$(BUILDDIR))/limine-efi/gnuefi/crt0-efi-ia32.o $(call MKESCAPE,$(BUILDDIR))/limine-efi/gnuefi/reloc_ia32.o $(OBJ) ../libgcc-binaries/libgcc-i686.a $(call MKESCAPE,$(BUILDDIR))/tinf/tinfgzip.o $(call MKESCAPE,$(BUILDDIR))/tinf/tinflate.o $(call MKESCAPE,$(BUILDDIR))/font.o
|
2022-02-02 18:18:49 +01:00
|
|
|
$(MAKE) '$(call SHESCAPE,$(BUILDDIR))/linker_nomap.ld'
|
2022-07-05 09:14:48 +02:00
|
|
|
$(CROSS_LD) \
|
2022-02-02 18:18:49 +01:00
|
|
|
-T'$(call SHESCAPE,$(BUILDDIR))/linker_nomap.ld' \
|
2022-07-05 09:14:48 +02:00
|
|
|
'$(call OBJESCAPE,$^)' $(CROSS_LDFLAGS) $(INTERNAL_LDFLAGS) -o '$(call SHESCAPE,$@)'
|
2021-07-20 13:35:43 +02:00
|
|
|
|
2022-06-15 03:25:36 +02:00
|
|
|
$(call MKESCAPE,$(BUILDDIR))/linker.ld: linker_uefi_ia32.ld.in
|
2022-08-08 22:00:25 +02:00
|
|
|
$(MKDIR_P) '$(call SHESCAPE,$(BUILDDIR))'
|
2022-07-05 09:14:48 +02:00
|
|
|
$(CROSS_CC) -x c -E -P -undef linker_uefi_ia32.ld.in -o '$(call SHESCAPE,$(BUILDDIR))/linker.ld'
|
2022-02-02 18:18:49 +01:00
|
|
|
|
2022-07-28 09:35:59 +02:00
|
|
|
$(call MKESCAPE,$(BUILDDIR))/limine.elf: $(call MKESCAPE,$(BUILDDIR))/limine-efi/gnuefi/crt0-efi-ia32.o $(call MKESCAPE,$(BUILDDIR))/limine-efi/gnuefi/reloc_ia32.o $(OBJ) ../libgcc-binaries/libgcc-i686.a $(call MKESCAPE,$(BUILDDIR))/tinf/tinfgzip.o $(call MKESCAPE,$(BUILDDIR))/tinf/tinflate.o $(call MKESCAPE,$(BUILDDIR))/font.o $(call MKESCAPE,$(BUILDDIR))/full.map.o
|
2022-02-02 18:18:49 +01:00
|
|
|
$(MAKE) '$(call SHESCAPE,$(BUILDDIR))/linker.ld'
|
2022-07-05 09:14:48 +02:00
|
|
|
$(CROSS_LD) \
|
2022-02-02 18:18:49 +01:00
|
|
|
-T'$(call SHESCAPE,$(BUILDDIR))/linker.ld' \
|
2022-07-05 09:14:48 +02:00
|
|
|
'$(call OBJESCAPE,$^)' $(CROSS_LDFLAGS) $(INTERNAL_LDFLAGS) -o '$(call SHESCAPE,$@)'
|
2021-07-20 13:35:43 +02:00
|
|
|
|
|
|
|
endif
|
|
|
|
|
2020-09-21 12:46:42 +02:00
|
|
|
-include $(HEADER_DEPS)
|
|
|
|
|
2022-06-15 03:25:36 +02:00
|
|
|
ifeq ($(TARGET), uefi-x86-64)
|
2022-06-14 05:58:34 +02:00
|
|
|
$(call MKESCAPE,$(BUILDDIR))/%.o: %.c $(call MKESCAPE,$(BUILDDIR))/tinf-copied $(call MKESCAPE,$(BUILDDIR))/limine-efi
|
2022-08-08 22:00:25 +02:00
|
|
|
$(MKDIR_P) "$$(dirname '$(call SHESCAPE,$@)')"
|
2022-07-05 09:14:48 +02:00
|
|
|
$(CROSS_CC) $(CROSS_CFLAGS) $(INTERNAL_CFLAGS) -c '$(call SHESCAPE,$<)' -o '$(call SHESCAPE,$@)'
|
2021-09-21 15:02:37 +02:00
|
|
|
endif
|
|
|
|
|
2022-06-15 03:25:36 +02:00
|
|
|
ifeq ($(TARGET), uefi-ia32)
|
2022-06-14 05:58:34 +02:00
|
|
|
$(call MKESCAPE,$(BUILDDIR))/%.o: %.c $(call MKESCAPE,$(BUILDDIR))/tinf-copied $(call MKESCAPE,$(BUILDDIR))/limine-efi
|
2022-08-08 22:00:25 +02:00
|
|
|
$(MKDIR_P) "$$(dirname '$(call SHESCAPE,$@)')"
|
2022-07-05 09:14:48 +02:00
|
|
|
$(CROSS_CC) $(CROSS_CFLAGS) $(INTERNAL_CFLAGS) -c '$(call SHESCAPE,$<)' -o '$(call SHESCAPE,$@)'
|
2021-09-21 15:02:37 +02:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(TARGET), bios)
|
2021-11-28 19:00:49 +01:00
|
|
|
$(call MKESCAPE,$(BUILDDIR))/%.o: %.c $(call MKESCAPE,$(BUILDDIR))/tinf-copied
|
2022-08-08 22:00:25 +02:00
|
|
|
$(MKDIR_P) "$$(dirname '$(call SHESCAPE,$@)')"
|
2022-07-05 09:14:48 +02:00
|
|
|
$(CROSS_CC) $(CROSS_CFLAGS) $(INTERNAL_CFLAGS) -c '$(call SHESCAPE,$<)' -o '$(call SHESCAPE,$@)'
|
2021-09-21 15:02:37 +02:00
|
|
|
endif
|
2020-01-21 23:45:13 +01:00
|
|
|
|
2021-03-13 09:48:11 +01:00
|
|
|
-include $(HEADER_DEPS)
|
|
|
|
|
2021-03-04 23:12:40 +01:00
|
|
|
ifeq ($(TARGET), bios)
|
2021-11-28 19:00:49 +01:00
|
|
|
$(call MKESCAPE,$(BUILDDIR))/%.s2.o: %.s2.c
|
2022-08-08 22:00:25 +02:00
|
|
|
$(MKDIR_P) "$$(dirname '$(call SHESCAPE,$@)')"
|
2022-07-05 09:14:48 +02:00
|
|
|
$(CROSS_CC) $(S2CFLAGS) $(INTERNAL_CFLAGS) -c '$(call SHESCAPE,$<)' -o '$(call SHESCAPE,$@)'
|
2021-03-04 23:12:40 +01:00
|
|
|
endif
|
|
|
|
|
2021-03-13 09:48:11 +01:00
|
|
|
-include $(HEADER_DEPS)
|
|
|
|
|
2021-07-05 23:28:04 +02:00
|
|
|
ifeq ($(TARGET), bios)
|
2022-06-15 03:25:36 +02:00
|
|
|
$(call MKESCAPE,$(BUILDDIR))/%.o: %.asm_ia32
|
2022-08-08 22:00:25 +02:00
|
|
|
$(MKDIR_P) "$$(dirname '$(call SHESCAPE,$@)')"
|
2022-01-29 17:23:41 +01:00
|
|
|
nasm '$(call SHESCAPE,$<)' -F dwarf -g $(WERROR) -f elf32 -o '$(call SHESCAPE,$@)'
|
2021-10-22 15:45:47 +02:00
|
|
|
|
2022-06-15 03:25:36 +02:00
|
|
|
$(call MKESCAPE,$(BUILDDIR))/%.o: %.asm_bios_ia32
|
2022-08-08 22:00:25 +02:00
|
|
|
$(MKDIR_P) "$$(dirname '$(call SHESCAPE,$@)')"
|
2022-01-29 17:23:41 +01:00
|
|
|
nasm '$(call SHESCAPE,$<)' -F dwarf -g $(WERROR) -f elf32 -o '$(call SHESCAPE,$@)'
|
2022-06-28 08:47:40 +02:00
|
|
|
|
|
|
|
$(call MKESCAPE,$(BUILDDIR))/%.o: %.asm_x86
|
2022-08-08 22:00:25 +02:00
|
|
|
$(MKDIR_P) "$$(dirname '$(call SHESCAPE,$@)')"
|
2022-06-28 08:47:40 +02:00
|
|
|
nasm '$(call SHESCAPE,$<)' -F dwarf -g $(WERROR) -f elf32 -o '$(call SHESCAPE,$@)'
|
2021-07-05 23:28:04 +02:00
|
|
|
endif
|
2021-03-13 09:48:11 +01:00
|
|
|
|
2022-06-15 03:25:36 +02:00
|
|
|
ifeq ($(TARGET), uefi-x86-64)
|
|
|
|
$(call MKESCAPE,$(BUILDDIR))/%.o: %.asm_x86_64
|
2022-08-08 22:00:25 +02:00
|
|
|
$(MKDIR_P) "$$(dirname '$(call SHESCAPE,$@)')"
|
2022-01-29 17:23:41 +01:00
|
|
|
nasm '$(call SHESCAPE,$<)' -F dwarf -g $(WERROR) -f elf64 -o '$(call SHESCAPE,$@)'
|
2021-10-22 15:45:47 +02:00
|
|
|
|
2022-06-15 03:25:36 +02:00
|
|
|
$(call MKESCAPE,$(BUILDDIR))/%.o: %.asm_uefi_x86_64
|
2022-08-08 22:00:25 +02:00
|
|
|
$(MKDIR_P) "$$(dirname '$(call SHESCAPE,$@)')"
|
2022-01-29 17:23:41 +01:00
|
|
|
nasm '$(call SHESCAPE,$<)' -F dwarf -g $(WERROR) -f elf64 -o '$(call SHESCAPE,$@)'
|
2022-06-28 08:47:40 +02:00
|
|
|
|
|
|
|
$(call MKESCAPE,$(BUILDDIR))/%.o: %.asm_x86
|
2022-08-08 22:00:25 +02:00
|
|
|
$(MKDIR_P) "$$(dirname '$(call SHESCAPE,$@)')"
|
2022-06-28 08:47:40 +02:00
|
|
|
nasm '$(call SHESCAPE,$<)' -F dwarf -g $(WERROR) -f elf64 -o '$(call SHESCAPE,$@)'
|
2021-07-05 23:28:04 +02:00
|
|
|
endif
|
2020-09-04 01:37:24 +02:00
|
|
|
|
2022-06-15 03:25:36 +02:00
|
|
|
ifeq ($(TARGET), uefi-ia32)
|
|
|
|
$(call MKESCAPE,$(BUILDDIR))/%.o: %.asm_ia32
|
2022-08-08 22:00:25 +02:00
|
|
|
$(MKDIR_P) "$$(dirname '$(call SHESCAPE,$@)')"
|
2022-01-29 17:23:41 +01:00
|
|
|
nasm '$(call SHESCAPE,$<)' -F dwarf -g $(WERROR) -f elf32 -o '$(call SHESCAPE,$@)'
|
2021-10-22 15:45:47 +02:00
|
|
|
|
2022-06-15 03:25:36 +02:00
|
|
|
$(call MKESCAPE,$(BUILDDIR))/%.o: %.asm_uefi_ia32
|
2022-08-08 22:00:25 +02:00
|
|
|
$(MKDIR_P) "$$(dirname '$(call SHESCAPE,$@)')"
|
2022-01-29 17:23:41 +01:00
|
|
|
nasm '$(call SHESCAPE,$<)' -F dwarf -g $(WERROR) -f elf32 -o '$(call SHESCAPE,$@)'
|
2022-06-28 08:47:40 +02:00
|
|
|
|
|
|
|
$(call MKESCAPE,$(BUILDDIR))/%.o: %.asm_x86
|
2022-08-08 22:00:25 +02:00
|
|
|
$(MKDIR_P) "$$(dirname '$(call SHESCAPE,$@)')"
|
2022-06-28 08:47:40 +02:00
|
|
|
nasm '$(call SHESCAPE,$<)' -F dwarf -g $(WERROR) -f elf32 -o '$(call SHESCAPE,$@)'
|
2021-07-20 13:35:43 +02:00
|
|
|
endif
|