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