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