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:
parent
d3674d1b15
commit
d3e25bf3a3
4 changed files with 7 additions and 19 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -5,4 +5,3 @@
|
|||
*.iso
|
||||
|
||||
/config.mk
|
||||
/arch/*/kernelmq
|
||||
|
|
15
Makefile
15
Makefile
|
@ -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)
|
||||
|
||||
#######
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
export OUTPUT = kernelmq
|
||||
|
||||
SUBDIRS = x86
|
||||
|
||||
all:
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue