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
|
|
|
|
2008-10-27 21:47:58 +01:00
|
|
|
CFLAGS = -c -O2 -I $(INCLUDE) -fomit-frame-pointer -fno-builtin-printf
|
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:= \
|
|
|
|
kernel.asm \
|
2008-09-15 17:25:03 +02: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 \
|
2008-09-11 22:26:49 +02:00
|
|
|
core/dll.inc \
|
2008-09-15 17:25:03 +02:00
|
|
|
core/exports.inc \
|
|
|
|
fs/ntfs.inc \
|
|
|
|
gui/event.inc \
|
|
|
|
video/cursors.inc
|
|
|
|
|
2008-08-10 07:23:24 +02:00
|
|
|
|
2008-09-10 15:04:24 +02:00
|
|
|
PE_SRC:= \
|
2008-08-13 21:13:40 +02:00
|
|
|
init.c \
|
|
|
|
mm.c \
|
2008-09-10 15:04:24 +02:00
|
|
|
slab.c \
|
|
|
|
heap.c \
|
|
|
|
spinlock.c \
|
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
|
|
|
|
|
|
|
#include <types.h>
|
|
|
|
#include <core.h>
|
|
|
|
#include <spinlock.h>
|
|
|
|
#include <link.h>
|
|
|
|
#include <mm.h>
|
|
|
|
#include <slab.h>
|
2008-08-10 07:23:24 +02: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 \
|
|
|
|
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-09-10 15:04:24 +02:00
|
|
|
kernel.mnt: kernel.obj $(PE_OBJS) Makefile ld.x
|
|
|
|
ld $(LDFLAGS) -T ld.x -o $@ kernel.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-08-10 07:23:24 +02:00
|
|
|
|
|
|
|
bin/%.obj: %.asm
|
|
|
|
$(FASM) $< $@
|
|
|
|
|
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
|