2020-09-30 01:31:42 +03:00
|
|
|
CC = cc
|
|
|
|
CFLAGS = -O2
|
2021-03-02 20:39:39 +03:00
|
|
|
LD = cc
|
2020-09-30 01:31:42 +03:00
|
|
|
QEMU = qemu-system-x86_64
|
|
|
|
QEMUFLAGS = -m 1G -enable-kvm -cpu host
|
2021-07-02 20:05:30 +03:00
|
|
|
LDINTERNALFLAGS := -Tlinker.ld -nostdlib -fno-pic -fpie -z max-page-size=0x1000 \
|
|
|
|
-Wl,-static,-pie,--no-dynamic-linker,-ztext -static-pie
|
|
|
|
INTERNALCFLAGS := -I../stivale -I. -ffreestanding -fno-stack-protector \
|
|
|
|
-fno-pic -fpie -mno-red-zone -mno-80387 -mno-mmx -mno-3dnow -mno-sse -mno-sse2
|
2020-09-30 01:31:42 +03:00
|
|
|
|
2021-03-02 20:39:39 +03:00
|
|
|
all: test.elf
|
2020-09-30 01:31:42 +03:00
|
|
|
|
2021-07-02 20:05:30 +03:00
|
|
|
test.elf: stivale.o stivale2.o e9print.o memory.o
|
|
|
|
$(LD) $(LDINTERNALFLAGS) $^ -o test.elf
|
2020-09-30 01:31:42 +03:00
|
|
|
|
|
|
|
%.o: %.c
|
|
|
|
$(CC) $(CFLAGS) $(INTERNALCFLAGS) -c $< -o $@
|
|
|
|
|
|
|
|
clean:
|
2021-07-02 20:05:30 +03:00
|
|
|
rm -rf test.elf stivale.o stivale2.o e9print.o memory.o
|