2020-09-30 01:31:42 +03:00
|
|
|
TARGET := test.elf
|
|
|
|
|
|
|
|
CC = cc
|
|
|
|
CFLAGS = -O2
|
|
|
|
LD = ld
|
|
|
|
QEMU = qemu-system-x86_64
|
|
|
|
QEMUFLAGS = -m 1G -enable-kvm -cpu host
|
2020-12-28 00:10:20 +03:00
|
|
|
LDINTERNALFLAGS := -Tlinker.ld -nostdlib -pie -z max-page-size=0x1000
|
2020-09-30 01:31:42 +03:00
|
|
|
INTERNALCFLAGS := -I../stivale -I. -ffreestanding -fno-stack-protector \
|
2020-12-28 00:10:20 +03:00
|
|
|
-fpic -fpie -fomit-frame-pointer -mno-red-zone -mno-80387 -mno-mmx -mno-3dnow -mno-sse \
|
|
|
|
-mno-sse2 -masm=intel
|
2020-09-30 01:31:42 +03:00
|
|
|
|
|
|
|
all: $(TARGET)
|
|
|
|
|
|
|
|
$(TARGET): stivale.o stivale2.o e9print.o
|
|
|
|
$(LD) $(LDINTERNALFLAGS) stivale.o stivale2.o e9print.o -o $@
|
|
|
|
|
|
|
|
%.o: %.c
|
|
|
|
$(CC) $(CFLAGS) $(INTERNALCFLAGS) -c $< -o $@
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -rf $(TARGET) stivale.o stivale2.o e9print.o
|