aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoraqua <aqua@iserlohn-fortress.net>2022-10-29 14:57:25 +0300
committeraqua <aqua@iserlohn-fortress.net>2022-10-29 15:06:41 +0300
commit0fc5be1c91be5a2da53bfba58ebe690993448640 (patch)
tree4f793516fc086e659bfdbc47bfc73610cefc4424 /src
parentmakefile: add devices/devs.a target (diff)
downloadkernel-0fc5be1c91be5a2da53bfba58ebe690993448640.tar.xz
makefile: add src/kernel.a target
Diffstat (limited to 'src')
-rw-r--r--src/Makefile19
-rw-r--r--src/conf.h.in4
2 files changed, 23 insertions, 0 deletions
diff --git a/src/Makefile b/src/Makefile
new file mode 100644
index 0000000..4c47e20
--- /dev/null
+++ b/src/Makefile
@@ -0,0 +1,19 @@
+include ../${ARCH}/toolchain.mk
+include ../rules.mk
+
+CCFLAGS += -I. -I../grub/include -I../${ARCH} -I../lib -I..
+
+all: kernel.a
+
+kernel,SRCS = multiboot2.c mmap.c kernel.c isr.c mem/vmm.c
+kernel,OBJS = $(kernel,SRCS:%.c=%.o)
+kernel.a: conf.h ${kernel,OBJS}
+ @echo ' AR $@'
+ @${AR} ${ARFLAGS} $@ ${kernel,OBJS}
+
+conf.h: conf.h.in
+ cp conf.h.in conf.h
+
+clean:
+ @rm -rf ${kernel,OBJS}
+
diff --git a/src/conf.h.in b/src/conf.h.in
new file mode 100644
index 0000000..9ae9bac
--- /dev/null
+++ b/src/conf.h.in
@@ -0,0 +1,4 @@
+#pragma once
+
+#define VERSION "0.0.0"
+#define CC "gcc xyz"