aboutsummaryrefslogtreecommitdiff
path: root/src/build.mk
diff options
context:
space:
mode:
authoraqua <aqua@iserlohn-fortress.net>2023-06-11 23:11:25 +0300
committeraqua <aqua@iserlohn-fortress.net>2023-06-11 23:11:25 +0300
commitcb6aa7dd9703eb3dba275905f98de682b57d3a78 (patch)
tree4b2b6ff65c148c5e9fe035e621496fcb2302dfb8 /src/build.mk
parentMake code ANSI C compatible (diff)
downloadkernel-cb6aa7dd9703eb3dba275905f98de682b57d3a78.tar.xz
Rework leaf makefiles to be included from top-level
- remove Makefile.all
Diffstat (limited to 'src/build.mk')
-rwxr-xr-xsrc/build.mk29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/build.mk b/src/build.mk
new file mode 100755
index 0000000..bdc1e3b
--- /dev/null
+++ b/src/build.mk
@@ -0,0 +1,29 @@
+#!../mach
+
+INCLUDES := -isystem${ROOTDIR}grub -I${ROOTDIR}${ARCH} -I${ROOTDIR}devices
+${ARCH}_CFLAGS += ${INCLUDES}
+${ARCH}_CXXFLAGS += ${INCLUDES}
+${ARCH}_LDFLAGS += -T ${ROOTDIR}${ARCH}/linker.ld
+
+TARGETBIN += glitch
+glitch.OBJS += ${ROOTDIR}${ARCH}/arch.a kernel.a ${ROOTDIR}devices/devs.a ${ROOTDIR}lib/libk.a
+
+TARGETLIB += kernel
+kernel.SRCS := multiboot2.c mmap.c kernel.cpp mem/vmm.c
+
+HOSTTARGETBIN += sched/test_taskqueue
+sched/test_taskqueue.SRCS = sched/test_taskqueue.cc
+
+HOSTTARGETBIN += sched/test_roundrobin
+sched/test_roundrobin.SRCS = sched/test_roundrobin.cc
+
+TESTS += \
+ sched/test_taskqueue sched/test_roundrobin
+
+kernel.c: conf.h
+conf.h: conf.h.in
+ @echo ' GEN $@'
+ @cp conf.h.in conf.h
+ @sed -i 's/@VERSION@/$(shell git describe)/' conf.h
+ @sed -i 's/@CC@/${${ARCH}_CCID}/' conf.h
+