summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2025-05-18 17:15:57 +0300
committerKimplul <kimi.h.kuparinen@gmail.com>2025-05-18 17:15:57 +0300
commit0e6bc60ceb3d2676fae166308668680a2f675d17 (patch)
tree0f7ebe21dafb8f7546e36b91645e4e5281fff856 /Makefile
downloadberg-0e6bc60ceb3d2676fae166308668680a2f675d17.tar.gz
berg-0e6bc60ceb3d2676fae166308668680a2f675d17.zip
initial rough skeleton
+ Naive/fast allocation hashmap + Stores/loads are currently all checked, the idea about static analysis to skip checks is still TODO
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile65
1 files changed, 65 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..14e9aea
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,65 @@
+.PHONY: all
+all: setup
+ $(MAKE) -f scripts/makefile
+
+# this kicks all unrecognised targets to the client script.
+# note that trying to compile individual files, e.g.
+#
+# make kernel.elf
+#
+# will not work, you would need
+#
+# make -f scripts/makefile kernel.elf
+#
+# instead
+.DEFAULT: setup
+ $(MAKE) -f scripts/makefile $<
+
+.PHONY: analyze
+analyze: setup
+ CC='gcc -fanalyzer' SKIP_ANALYZER='-fno-analyzer' $(MAKE) CROSS_COMPILE=
+
+.PHONY: setup
+setup: deps
+ @echo -n > deps.mk
+ @./scripts/gen-deps -p BERG -c COMPILE_BERG -b berg "$(BERG_SOURCES)"
+
+CLEANUP := build deps.mk fwd
+CLEANUP_CMD :=
+BERG_SOURCES :=
+
+include src/source.mk
+
+.PHONY: format
+format:
+ find src include -iname '*.[ch]' |\
+ xargs uncrustify -c uncrustify.conf --no-backup -F -
+
+.PHONY: license
+license:
+ find src include -iname '*.[ch]' |\
+ xargs ./scripts/license
+
+.PHONY: docs
+docs:
+ find src include -iname '*.[ch]' -not -path */gen/* |\
+ xargs ./scripts/warn-undocumented
+ doxygen docs/doxygen.conf
+
+RM = rm
+
+.PHONY: clean
+clean:
+ $(RM) -rf $(CLEANUP)
+ $(MAKE) -C deps/ejit clean
+
+.PHONY: clean_docs
+clean_docs:
+ $(RM) -rf docs/output
+
+.PHONY: clean_all
+clean_all: clean clean_docs
+
+.PHONY: deps
+deps:
+ $(MAKE) -C deps/ejit