kernel/Makefile

37 lines
692 B
Makefile
Raw Normal View History

2017-11-09 15:37:11 +00:00
export ARCH = x86
export CCPREFIX = i686-elf-
2017-11-04 06:09:14 +00:00
2017-11-08 09:38:55 +00:00
export AR = $(CCPREFIX)ar
export AS = $(CCPREFIX)as
export CC = $(CCPREFIX)gcc
2017-11-04 07:43:03 +00:00
export INCLUDE = $(shell pwd)/include
2017-11-09 09:58:39 +00:00
export KERNEL = $(shell pwd)/rootfs/boot/kernelmq.multiboot2
export CFLAGS = -std=gnu99 -ffreestanding -nostdinc -fno-builtin -fno-stack-protector -Wall -Wextra -I $(INCLUDE)
2017-11-09 15:46:35 +00:00
SUBDIRS = arch
2017-11-09 06:01:31 +00:00
2017-11-09 09:58:39 +00:00
IMAGE = $(shell pwd)/image.iso
2017-11-09 10:04:51 +00:00
run: all-arch
2017-11-09 09:58:39 +00:00
grub-file --is-x86-multiboot2 $(KERNEL)
grub-mkrescue rootfs -o $(IMAGE)
qemu-system-i386 -cdrom $(IMAGE)
2017-11-01 05:03:52 +00:00
2017-11-09 10:04:51 +00:00
all: all-arch
2017-11-08 11:06:18 +00:00
2017-11-09 10:04:51 +00:00
clean: $(addprefix clean-, $(SUBDIRS))
2017-11-09 09:58:39 +00:00
rm -f $(IMAGE)
2017-11-08 09:38:55 +00:00
rm -f $(KERNEL)
########
# arch #
########
2017-11-09 15:46:35 +00:00
all-arch:
2017-11-08 09:38:55 +00:00
make all -C arch
clean-arch:
2017-11-08 08:58:02 +00:00
make clean -C arch