1
0
Fork 0
mirror of https://github.com/tailix/kernel.git synced 2025-02-17 15:45:37 -05:00

Build kernel in right place

This commit is contained in:
Braiden Vasco 2017-11-09 10:04:51 +00:00
parent d3674d1b15
commit d3e25bf3a3
4 changed files with 7 additions and 19 deletions

1
.gitignore vendored
View file

@ -5,4 +5,3 @@
*.iso
/config.mk
/arch/*/kernelmq

View file

@ -16,24 +16,15 @@ SUBDIRS = arch libk src
IMAGE = $(shell pwd)/image.iso
run: all-kernel
run: all-arch
grub-file --is-x86-multiboot2 $(KERNEL)
grub-mkrescue rootfs -o $(IMAGE)
qemu-system-i386 -cdrom $(IMAGE)
all: all-kernel
all: all-arch
clean: clean-kernel $(addprefix clean-, $(SUBDIRS))
clean: $(addprefix clean-, $(SUBDIRS))
rm -f $(IMAGE)
##########
# Kernel #
##########
all-kernel: all-arch
cp arch/$(ARCH)/kernelmq $(KERNEL)
clean-kernel:
rm -f $(KERNEL)
#######

View file

@ -1,5 +1,3 @@
export OUTPUT = kernelmq
SUBDIRS = x86
all:

View file

@ -28,13 +28,13 @@ OBJS += exception.c.o
OBJS += hwint.c.o
OBJS += syscall.c.o
all: $(OUTPUT)
all: $(KERNEL)
clean:
rm -f $(OUTPUT) $(OBJS)
rm -f $(OBJS)
$(OUTPUT): $(OBJS)
$(CC) -T linker.ld -o $(OUTPUT) -ffreestanding -nostdlib -lgcc $(OBJS) $(LIBSRC) $(LIBK)
$(KERNEL): $(OBJS)
$(CC) -T linker.ld -o $(KERNEL) -ffreestanding -nostdlib -lgcc $(OBJS) $(LIBSRC) $(LIBK)
%.c.o: %.c
$(CC) -c $< -o $@ $(CFLAGS)