did some restructuring, got multitasking almost working
This commit is contained in:
7
makefile
7
makefile
@@ -6,8 +6,7 @@ OSNAME := rockos
|
||||
C_SOURCES := $(shell find kernel -type f -name '*.c')
|
||||
S_SOURCES := $(shell find kernel -type f -name '*.S')
|
||||
|
||||
# This correctly generates paths like obj/kernel/main.o
|
||||
OBJECTS := $(patsubst %.c, obj/%.o, $(C_SOURCES)) $(patsubst %.S, obj/%.o, $(S_SOURCES))
|
||||
OBJECTS := $(patsubst %, obj/%.o, $(C_SOURCES) $(S_SOURCES))
|
||||
|
||||
CFLAGS := -ffreestanding -O2 -Wall -Wextra -Ikernel
|
||||
LDFLAGS := -T kernel/linker.ld
|
||||
@@ -25,11 +24,11 @@ $(OSNAME).iso: $(OSNAME).bin grub.cfg
|
||||
cp grub.cfg isodir/boot/grub/grub.cfg
|
||||
grub-mkrescue -o $(OSNAME).iso isodir
|
||||
|
||||
obj/kernel/%.o: kernel/%.c
|
||||
obj/%.c.o: %.c
|
||||
@mkdir -p $(dir $@)
|
||||
$(CC) -c $< -o $@ $(CFLAGS)
|
||||
|
||||
obj/kernel/%.o: kernel/%.S
|
||||
obj/%.S.o: %.S
|
||||
@mkdir -p $(dir $@)
|
||||
$(CC) -c $< -o $@ $(CFLAGS)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user