mirror of
https://github.com/tailix/kernel.git
synced 2025-02-10 15:36:37 -05:00
Improve makefiles
This commit is contained in:
parent
5f6add8289
commit
e0730adae2
3 changed files with 4 additions and 15 deletions
4
Makefile
4
Makefile
|
@ -8,7 +8,7 @@ all-kernel:
|
|||
make all -C arch I=$(shell pwd)/include
|
||||
|
||||
clean-kernel:
|
||||
make clean -C arch I=$(shell pwd)/include
|
||||
make clean -C arch
|
||||
|
||||
run-iso: all-kernel
|
||||
make run -C iso K=$(shell pwd)/arch/kernel
|
||||
|
@ -17,4 +17,4 @@ all-iso: all-kernel
|
|||
make all -C iso K=$(shell pwd)/arch/kernel
|
||||
|
||||
clean-iso:
|
||||
make clean -C iso K=$(shell pwd)/arch/kernel
|
||||
make clean -C iso
|
||||
|
|
|
@ -1,7 +1,3 @@
|
|||
ifneq (ok, $(shell test -d '$(I)' && echo 'ok'))
|
||||
$(error 'Include directory "$(I)" does not exist')
|
||||
endif
|
||||
|
||||
CCPREFIX = i686-elf-
|
||||
|
||||
AS = $(CCPREFIX)as
|
||||
|
@ -19,7 +15,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 "$(I)"
|
||||
|
||||
%.s.o: %.s
|
||||
$(AS) $< -o $@
|
||||
|
|
|
@ -1,15 +1,8 @@
|
|||
ifneq (ok, $(shell test -f '$(K)' && echo 'ok'))
|
||||
$(error 'Kernel "$(K)" does not exist')
|
||||
endif
|
||||
|
||||
ifneq (ok, $(shell grub-file --is-x86-multiboot2 '$(K)' && echo 'ok'))
|
||||
$(error 'Kernel "$(K)" is not compliant with Multiboot 2')
|
||||
endif
|
||||
|
||||
run: all
|
||||
qemu-system-i386 -cdrom image.iso
|
||||
|
||||
all:
|
||||
grub-file --is-x86-multiboot2 "$(K)"
|
||||
cp "$(K)" rootfs/boot/kernelmq
|
||||
grub-mkrescue rootfs -o image.iso
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue