18 lines
489 B
Makefile
18 lines
489 B
Makefile
CC := x86_64-elf-gcc
|
|
CC_FLAGS := -ffreestanding -nostdlib -fno-pic -mno-red-zone -Ilibc
|
|
|
|
LD := x86_64-elf-ld
|
|
|
|
BUILDDIR := ../build
|
|
LIBDIR := libc
|
|
|
|
all: pedicel apex
|
|
|
|
pedicel:
|
|
nasm -f bin pedicel.S -o $(BUILDDIR)/pedicel.raw
|
|
|
|
apex:
|
|
$(CC) $(CC_FLAGS) -c apex.c -o $(BUILDDIR)/apex.o
|
|
nasm -f elf64 $(LIBDIR)/crt0.S -o $(BUILDDIR)/crt0.o
|
|
$(LD) -T $(LIBDIR)/linker.ld $(BUILDDIR)/crt0.o $(BUILDDIR)/apex.o -o $(BUILDDIR)/apex.elf
|
|
objcopy -O binary $(BUILDDIR)/apex.elf $(BUILDDIR)/apex.raw
|