1
0
Fork 0
mirror of https://github.com/tailix/kernel.git synced 2024-11-20 11:16:10 -05:00

Move "arch" to "."

This commit is contained in:
Braiden Vasco 2017-11-09 15:52:58 +00:00
parent 8562967013
commit 8bfe30ce96
49 changed files with 53 additions and 69 deletions

View file

@ -1,4 +1,3 @@
export ARCH = x86
export CCPREFIX = i686-elf-
export AR = $(CCPREFIX)ar
@ -10,27 +9,68 @@ export KERNEL = $(shell pwd)/rootfs/boot/kernelmq.multiboot2
export CFLAGS = -std=gnu99 -ffreestanding -nostdinc -fno-builtin -fno-stack-protector -Wall -Wextra -I $(INCLUDE)
SUBDIRS = arch
IMAGE = $(shell pwd)/image.iso
run: all-arch
# Architecture-dependent
OBJS = start.s.o
OBJS += main.c.o
OBJS += init.c.o
OBJS += multiboot.c.o
OBJS += panic.c.o panic.asm.cpp.o
OBJS += pfa.c.o
OBJS += paging.c.o paging.asm.cpp.o
OBJS += pagedir.c.o
# Architecture-independent
OBJS += info.c.o
OBJS += memset.c.o
OBJS += strlen.c.o
OBJS += itoa.c.o
OBJS += strncpy.c.o
# Built-in drivers
OBJS += console.c.o
OBJS += pic.c.o
OBJS += timer.c.o
OBJS += keyboard.c.o
# For debugging
OBJS += logger.c.o
OBJS += protected.c.o protected.asm.cpp.o
OBJS += tss.c.o tss.asm.cpp.o
OBJS += tasks.asm.cpp.o
OBJS += interrupt.asm.cpp.o
OBJS += exception.c.o
OBJS += hwint.c.o
OBJS += syscall.c.o
run: $(KERNEL)
grub-file --is-x86-multiboot2 $(KERNEL)
grub-mkrescue rootfs -o $(IMAGE)
qemu-system-i386 -cdrom $(IMAGE)
all: all-arch
all: $(KERNEL)
clean: $(addprefix clean-, $(SUBDIRS))
clean:
rm -f $(OBJS)
rm -f $(IMAGE)
rm -f $(KERNEL)
########
# arch #
########
$(KERNEL): $(OBJS)
$(CC) -T linker.ld -o $(KERNEL) -ffreestanding -nostdlib -lgcc $(OBJS)
all-arch:
make all -C arch
%.c.o: %.c
$(CC) -c $< -o $@ $(CFLAGS)
clean-arch:
make clean -C arch
%.s.o: %.s
$(AS) $< -o $@
%.asm.cpp.o: %.asm.cpp
nasm -felf32 -o $@ $<
%.asm.cpp: %.asm
cpp -P $< $@

View file

@ -1,56 +0,0 @@
# Architecture-dependent
OBJS = start.s.o
OBJS += main.c.o
OBJS += init.c.o
OBJS += multiboot.c.o
OBJS += panic.c.o panic.asm.cpp.o
OBJS += pfa.c.o
OBJS += paging.c.o paging.asm.cpp.o
OBJS += pagedir.c.o
# Architecture-independent
OBJS += info.c.o
OBJS += memset.c.o
OBJS += strlen.c.o
OBJS += itoa.c.o
OBJS += strncpy.c.o
# Built-in drivers
OBJS += console.c.o
OBJS += pic.c.o
OBJS += timer.c.o
OBJS += keyboard.c.o
# For debugging
OBJS += logger.c.o
OBJS += protected.c.o protected.asm.cpp.o
OBJS += tss.c.o tss.asm.cpp.o
OBJS += tasks.asm.cpp.o
OBJS += interrupt.asm.cpp.o
OBJS += exception.c.o
OBJS += hwint.c.o
OBJS += syscall.c.o
all: $(KERNEL)
clean:
rm -f $(OBJS)
$(KERNEL): $(OBJS)
$(CC) -T linker.ld -o $(KERNEL) -ffreestanding -nostdlib -lgcc $(OBJS)
%.c.o: %.c
$(CC) -c $< -o $@ $(CFLAGS)
%.s.o: %.s
$(AS) $< -o $@
%.asm.cpp.o: %.asm.cpp
nasm -felf32 -o $@ $<
%.asm.cpp: %.asm
cpp -P $< $@

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file