1
0
Fork 0
mirror of https://github.com/tailix/kernel.git synced 2025-04-14 17:33:13 -04:00

Export common paths

This commit is contained in:
Braiden Vasco 2017-11-04 07:43:03 +00:00
parent 88c55d2b23
commit a090c16af5
4 changed files with 12 additions and 8 deletions

View file

@ -1,21 +1,25 @@
include config.mk
export INCLUDE = $(shell pwd)/include
export KERNEL = $(shell pwd)/arch/kernel
export LIBK = $(shell pwd)/libk/libk.a
run: run-iso
all: all-kernel all-iso all-libk all-test
clean: clean-kernel clean-iso clean-libk clean-test
all-kernel: all-libk
make all -C arch I=$(shell pwd)/include LIBK=$(shell pwd)/libk/libk.a
make all -C arch
clean-kernel:
make clean -C arch
run-iso: all-kernel
make run -C iso K=$(shell pwd)/arch/kernel
make run -C iso
all-iso: all-kernel
make all -C iso K=$(shell pwd)/arch/kernel
make all -C iso
clean-iso:
make clean -C iso
@ -27,7 +31,7 @@ clean-libk:
make clean -C libk
test-libk: all-libk
make run -C test/libk I=$(shell pwd)/include LIBK=$(shell pwd)/libk/libk.a
make run -C test/libk
clean-test:
make clean -C test/libk

View file

@ -30,7 +30,7 @@ kernel: $(OBJS)
grub-file --is-x86-multiboot2 $@
%.c.o: %.c
$(CC) -c $< -o $@ -std=gnu99 -ffreestanding -nostdinc -fno-builtin -fno-stack-protector -Wall -Wextra -I "$(I)"
$(CC) -c $< -o $@ -std=gnu99 -ffreestanding -nostdinc -fno-builtin -fno-stack-protector -Wall -Wextra -I "$(INCLUDE)"
%.s.o: %.s
$(AS) $< -o $@

View file

@ -2,8 +2,8 @@ run: all
qemu-system-i386 -cdrom image.iso
all:
grub-file --is-x86-multiboot2 "$(K)"
cp "$(K)" rootfs/boot/kernelmq
grub-file --is-x86-multiboot2 "$(KERNEL)"
cp "$(KERNEL)" rootfs/boot/kernelmq
grub-mkrescue rootfs -o image.iso
clean:

View file

@ -15,4 +15,4 @@ run-%.bin: %.bin
@./$< && echo "[ OK ] $*" || echo "[FAIL] $*"
%.bin: %.c
$(CC) $< -o $@ $(CFLAGS) -I "$(I)" "$(LIBK)"
$(CC) $< -o $@ $(CFLAGS) -I "$(INCLUDE)" "$(LIBK)"