2008-08-10 07:23:24 +02:00
|
|
|
|
|
|
|
CC = gcc
|
|
|
|
FASM = fasm.exe
|
|
|
|
|
2008-08-13 21:13:40 +02:00
|
|
|
INCLUDE = include/
|
2008-08-10 07:23:24 +02:00
|
|
|
|
2008-09-10 15:04:24 +02:00
|
|
|
DEFS = -DUSE_SMP -DCONFIG_DEBUG
|
2008-08-13 21:13:40 +02:00
|
|
|
|
2009-01-17 17:04:50 +01:00
|
|
|
CFLAGS = -c -O2 -DCONFIG_DEBUG -I $(INCLUDE) -fomit-frame-pointer -fno-builtin
|
2008-08-10 07:23:24 +02:00
|
|
|
LDFLAGS = -shared -s -Map kernel.map --image-base 0x100000 --file-alignment 32
|
|
|
|
|
2008-09-10 15:04:24 +02:00
|
|
|
KERNEL_SRC:= \
|
2008-11-05 08:10:14 +01:00
|
|
|
kernel.asm \
|
2009-01-17 17:04:50 +01:00
|
|
|
const.inc \
|
2008-11-05 08:10:14 +01:00
|
|
|
data32.inc \
|
2008-09-10 15:04:24 +02:00
|
|
|
core/memory.inc \
|
|
|
|
core/heap.inc \
|
2008-09-15 17:25:03 +02:00
|
|
|
core/malloc.inc \
|
2008-09-10 15:04:24 +02:00
|
|
|
core/taskman.inc \
|
2008-09-15 17:25:03 +02:00
|
|
|
core/v86.inc \
|
2008-09-10 15:04:24 +02:00
|
|
|
core/sys32.inc \
|
2009-01-17 17:04:50 +01:00
|
|
|
core/syscall.inc \
|
2008-09-11 22:26:49 +02:00
|
|
|
core/dll.inc \
|
2008-09-15 17:25:03 +02:00
|
|
|
core/exports.inc \
|
2008-11-05 08:10:14 +01:00
|
|
|
fs/ntfs.inc \
|
|
|
|
gui/window.inc \
|
2008-09-15 17:25:03 +02:00
|
|
|
gui/event.inc \
|
2008-11-05 08:10:14 +01:00
|
|
|
video/vesa20.inc \
|
2009-01-17 17:04:50 +01:00
|
|
|
video/cursors.inc \
|
|
|
|
hid/mousedrv.inc
|
2008-09-15 17:25:03 +02:00
|
|
|
|
2008-08-10 07:23:24 +02:00
|
|
|
|
2008-09-10 15:04:24 +02:00
|
|
|
PE_SRC:= \
|
2008-11-22 13:57:25 +01:00
|
|
|
init.asm \
|
|
|
|
mbi.c \
|
2008-08-13 21:13:40 +02:00
|
|
|
mm.c \
|
2008-09-10 15:04:24 +02:00
|
|
|
slab.c \
|
|
|
|
heap.c \
|
2008-11-01 02:25:51 +01:00
|
|
|
pe.c \
|
2008-10-30 07:30:13 +01:00
|
|
|
dll.c \
|
2008-09-10 15:04:24 +02:00
|
|
|
spinlock.c \
|
2008-11-22 13:57:25 +01:00
|
|
|
thread.c \
|
|
|
|
syscall.asm \
|
2008-08-10 07:23:24 +02:00
|
|
|
boot/boot.asm \
|
2008-08-13 21:13:40 +02:00
|
|
|
boot/start.asm
|
2008-09-12 12:56:47 +02:00
|
|
|
|
2008-10-30 20:23:42 +01:00
|
|
|
|
2008-09-12 12:56:47 +02:00
|
|
|
H_SRC:= \
|
|
|
|
include/types.h \
|
|
|
|
include/atomic.h \
|
|
|
|
include/spinlock.h \
|
|
|
|
include/link.h \
|
|
|
|
include/core.h \
|
|
|
|
include/mm.h \
|
2008-11-07 05:10:42 +01:00
|
|
|
include/pe.h \
|
2008-09-12 12:56:47 +02:00
|
|
|
include/slab.h
|
2008-08-10 07:23:24 +02:00
|
|
|
|
2008-09-10 15:04:24 +02:00
|
|
|
PE_OBJS = $(patsubst %.s, bin/%.obj, $(patsubst %.asm, bin/%.obj,\
|
|
|
|
$(patsubst %.c, bin/%.obj, $(PE_SRC))))
|
2008-08-10 07:23:24 +02:00
|
|
|
|
|
|
|
|
|
|
|
all: kernel.gz
|
|
|
|
|
|
|
|
kernel.gz :kernel.mnt
|
|
|
|
7z a -tgzip kernel.gz kernel.mnt
|
|
|
|
|
2008-10-30 20:23:42 +01:00
|
|
|
kernel.mnt: kernel.obj bin/export.obj $(PE_OBJS) Makefile ld.x
|
|
|
|
ld $(LDFLAGS) -T ld.x -o $@ kernel.obj bin/export.obj $(PE_OBJS)
|
2008-08-13 21:13:40 +02:00
|
|
|
|
2008-09-12 12:56:47 +02:00
|
|
|
bin/%.obj : core/%.c $(H_SRC) Makefile
|
2008-08-13 21:13:40 +02:00
|
|
|
$(CC) $(CFLAGS) -o $@ $<
|
2008-11-22 13:57:25 +01:00
|
|
|
|
|
|
|
bin/%.obj: core/%.asm Makefile
|
|
|
|
$(FASM) $< $@
|
2008-08-10 07:23:24 +02:00
|
|
|
|
|
|
|
bin/%.obj: %.asm
|
|
|
|
$(FASM) $< $@
|
|
|
|
|
2008-10-30 20:23:42 +01:00
|
|
|
bin/export.obj: core/export.asm
|
|
|
|
as -o $@ $<
|
|
|
|
|
2008-09-10 15:04:24 +02:00
|
|
|
kernel.obj: $(KERNEL_SRC)
|
|
|
|
$(FASM) kernel.asm
|
|
|
|
|
2008-08-10 07:23:24 +02:00
|
|
|
all: $(SUBDIRS)
|
|
|
|
|
|
|
|
.PHONY: all
|