summaryrefslogtreecommitdiff
path: root/src/kernel/Makefile
diff options
context:
space:
mode:
authorAlexis211 <alexis211@gmail.com>2010-02-06 20:51:56 +0100
committerAlexis211 <alexis211@gmail.com>2010-02-06 20:51:56 +0100
commit6a52d123672b7a00af6e22b4c138205be2042a94 (patch)
treecd9b0a13490159369a66c850850596fd4b418139 /src/kernel/Makefile
parent3558f18daf50281ee1cd68cca96cd967dbac04ba (diff)
downloadTCE-6a52d123672b7a00af6e22b4c138205be2042a94.tar.gz
TCE-6a52d123672b7a00af6e22b4c138205be2042a94.zip
Reorganisation
Diffstat (limited to 'src/kernel/Makefile')
-rw-r--r--src/kernel/Makefile38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/kernel/Makefile b/src/kernel/Makefile
new file mode 100644
index 0000000..5af7f4b
--- /dev/null
+++ b/src/kernel/Makefile
@@ -0,0 +1,38 @@
+.PHONY: clean, mrproper
+
+CC = gcc
+CFLAGS = -nostdlib -nostartfiles -nodefaultlibs -fno-builtin -fno-stack-protector -Wall -Wextra -I . -I ./lib
+
+LD = ld
+LDFLAGS = -T link.ld
+
+ASM = nasm
+AFLAGS = -f elf
+
+OBJECTS = core/loader_.o core/kmain.o core/sys.o \
+ core/monitor.o task/timer.o \
+ task/idt.o task/idt_.o task/task.o task/task_.o task/syscall.o \
+ lib/stdlib.o lib/bitset.o \
+ mem/mem.o mem/paging.o mem/gdt.o mem/heap.o mem/seg.o \
+ linker/elf.o
+OUT = kernel.elf
+
+all: $(OBJECTS)
+ echo "* Linking $(OUT)..."
+ $(LD) $(LDFLAGS) $(OBJECTS) -o $(OUT) -Map kernel.map
+
+clean:
+ rm $(OBJECTS) || exit 0
+ rm *.o */*.o || exit 0
+ rm *.map || exit 0
+
+mrproper: clean
+ rm $(OUT) || exit 0
+
+%.o: %.asm
+ echo "* Compiling $<..."
+ $(ASM) $(AFLAGS) -o $@ $<
+
+%.o: %.c
+ echo "* Compiling $<..."
+ $(CC) -c $< -o $@ $(CFLAGS)