summaryrefslogtreecommitdiff
path: root/src/kernel/Makefile
diff options
context:
space:
mode:
authorAlexis211 <alexis211@gmail.com>2010-08-10 17:14:38 +0200
committerAlexis211 <alexis211@gmail.com>2010-08-10 17:14:38 +0200
commit0ec0ca40a4fedfe97c49903a329b2a9ad2e22d03 (patch)
treeb9033e69392dd1a7ffe0173ef8db561ecce9b21b /src/kernel/Makefile
parentad27a90fa788a81253b5f2ad621d82ae574ae65d (diff)
downloadTCE-0ec0ca40a4fedfe97c49903a329b2a9ad2e22d03.tar.gz
TCE-0ec0ca40a4fedfe97c49903a329b2a9ad2e22d03.zip
Using a cross-compiler. Better makefile system.
Diffstat (limited to 'src/kernel/Makefile')
-rw-r--r--src/kernel/Makefile46
1 files changed, 11 insertions, 35 deletions
diff --git a/src/kernel/Makefile b/src/kernel/Makefile
index d7a6a57..eb69cfc 100644
--- a/src/kernel/Makefile
+++ b/src/kernel/Makefile
@@ -1,39 +1,15 @@
-.PHONY: clean, mrproper
+Out = kernel.elf
+Obj = 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 lib/mutex.o \
+ mem/mem.o mem/paging.o mem/gdt.o mem/heap.o mem/seg.o \
+ ipc/shm.o ipc/object.o ipc/request.o \
+ linker/elf.o
-CC = gcc
-CFLAGS = -nostdlib -nostartfiles -nodefaultlibs -fno-builtin -fno-stack-protector -Wall -Wextra -I . -I ./lib -g
+include ../common.make
-LD = ld
-LDFLAGS = -T link.ld
+CFLAGS += -I . -I ./lib -g
-ASM = nasm
-AFLAGS = -f elf
+LDFLAGS += -T link.ld -Map kernel.map
-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 lib/mutex.o \
- mem/mem.o mem/paging.o mem/gdt.o mem/heap.o mem/seg.o \
- ipc/shm.o ipc/object.o ipc/request.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)