2023-01-15 19:25:25 +00:00
|
|
|
include kernel/drivers/build.mk
|
|
|
|
|
2023-01-20 13:17:11 +00:00
|
|
|
KERNEL_SRCS = head.s gdt.s pic.s isr.s idt.s pmm.s paging.s lib/log.s
|
2023-01-15 19:25:25 +00:00
|
|
|
KERNEL_OBJS = $(addprefix kernel/, $(KERNEL_SRCS:.s=.o) $(DRIVERS_OBJS))
|
2023-01-17 10:35:11 +00:00
|
|
|
KERNEL_BIN = vmstupid
|
|
|
|
KERNEL_DUMP = $(KERNEL_BIN).dump
|
2023-01-15 19:25:25 +00:00
|
|
|
|
2023-01-20 13:17:11 +00:00
|
|
|
KERNEL_ASFLAGS = $(ASFLAGS) -D__KERNEL__ -Ikernel
|
2023-01-15 19:25:25 +00:00
|
|
|
|
|
|
|
GARBADGE += $(KERNEL_OBJS) $(KERNEL_BIN) $(KERNEL_DUMP)
|
|
|
|
|
|
|
|
$(KERNEL_BIN): $(KERNEL_OBJS)
|
|
|
|
$(LD) -T $(KERNEL_DIR)/linker.ld -nostdlib -o $@ $^
|
|
|
|
|
2023-01-17 10:35:11 +00:00
|
|
|
$(KERNEL_DUMP): $(KERNEL_BIN)
|
|
|
|
$(OBJDUMP) -D $^ > $@
|
|
|
|
|
2023-01-15 19:25:25 +00:00
|
|
|
kernel/lib/%.o: lib/base/%.s
|
2023-01-17 10:35:11 +00:00
|
|
|
@$(MKCWD)
|
2023-01-15 19:25:25 +00:00
|
|
|
$(AS) -felf -o $@ $< $(KERNEL_ASFLAGS)
|
|
|
|
|
|
|
|
kernel/%.o: kernel/%.s
|
|
|
|
$(AS) -felf -o $@ $< $(KERNEL_ASFLAGS)
|
|
|
|
|