Building a multiboot 1 compatible executable

This commit is contained in:
2017-10-24 16:04:09 +02:00
parent 0df19ec2b7
commit 39b43d825a
3 changed files with 56 additions and 0 deletions

19
src/kernel/Makefile Normal file
View File

@@ -0,0 +1,19 @@
ifeq ($(MITTOS64),)
$(error Unsupported environment! See README)
endif
CC := x86_64-elf-gcc
SRC := $(wildcard **/*.[cS])
OBJ := $(patsubst %, %.o, $(basename $(SRC)))
CFLAGS ?= -Wall -Wextra
CFLAGS += -ffreestanding
all: kernel
kernel: LDFLAGS += -n -nostdlib -T Link.ld
kernel: $(OBJ)
$(LINK.c) $^ -o $@
mkdir -p /opt/sysroot
cp kernel /opt/sysroot/kernel