aboutsummaryrefslogtreecommitdiff
path: root/kernel/Makefile
diff options
context:
space:
mode:
authorAlex Auvolat <alex.auvolat@ens.fr>2014-11-30 18:53:31 +0100
committerAlex Auvolat <alex.auvolat@ens.fr>2014-11-30 18:53:31 +0100
commitbee97e0b630976b96798246a3ef4eea8964099cf (patch)
tree797be16f6e2ac129c37fe6c7527444cc34658180 /kernel/Makefile
downloadmacroscope-bee97e0b630976b96798246a3ef4eea8964099cf.tar.gz
macroscope-bee97e0b630976b96798246a3ef4eea8964099cf.zip
Bare bones.
Diffstat (limited to 'kernel/Makefile')
-rw-r--r--kernel/Makefile21
1 files changed, 21 insertions, 0 deletions
diff --git a/kernel/Makefile b/kernel/Makefile
new file mode 100644
index 0000000..7a29c9e
--- /dev/null
+++ b/kernel/Makefile
@@ -0,0 +1,21 @@
+
+AS = nasm
+ASFLAGS = -felf
+
+CC = i586-elf-gcc
+CFLAGS = -ffreestanding -O2 -std=gnu99 -Wall -Wextra -I ./include
+LD = i586-elf-gcc
+LDFLAGS = -T linker.ld -ffreestanding -O2 -nostdlib -lgcc
+
+OBJ = l0/loader.o l0/kmain.o
+
+all: kernel.bin
+
+kernel.bin: $(OBJ)
+ $(LD) $(LDFLAGS) -o $@ $^
+
+%.o: %.s
+ $(AS) $(ASFLAGS) -o $@ $<
+
+%.o: %.c
+ $(CC) -c $< -o $@ $(CFLAGS)