aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2024-05-24 14:04:49 +0300
committerKimplul <kimi.h.kuparinen@gmail.com>2024-05-24 14:30:57 +0300
commitfd30e99f93313bec0af3ff5ec3735d90dd025dce (patch)
treea6ce5e8e0695bf6e692560713fd2c30a1fdedc3f /Makefile
parent2026bf974cffb5d560287ba8d44ea3ecd9204853 (diff)
downloadek-fd30e99f93313bec0af3ff5ec3735d90dd025dce.tar.gz
ek-fd30e99f93313bec0af3ff5ec3735d90dd025dce.zip
fix bmake compilation
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile67
1 files changed, 28 insertions, 39 deletions
diff --git a/Makefile b/Makefile
index a2c18cd..9bd13a7 100644
--- a/Makefile
+++ b/Makefile
@@ -1,67 +1,56 @@
-DO != echo -n > deps.mk
+.PHONY: all
+all: setup
+ $(MAKE) -f scripts/makefile
-DEBUGFLAGS != [ $(RELEASE) ] && echo "-flto=auto -O2 -DNODEBUG" || echo "-O0 -DDEBUG"
-CFLAGS = -Wall -Wextra -Wconversion -ggdb3
-DEPFLAGS = -MT $@ -MMD -MP -MF $@.d
-LINTFLAGS = -fsyntax-only
-INCLUDEFLAGS = -Iinclude
-COMPILEFLAGS =
-LINKFLAGS =
+# 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 $<
-all: ek
+.PHONY:
+setup:
+ @echo -n > deps.mk
+ @./scripts/gen-deps -p EK -c COMPILE_EK -b ek "$(EK_SOURCES)"
-# default values
-CROSS_COMPILE ?=
-
-# common programs
-CC = gcc
-
-SOURCES :=
+CLEANUP := build deps.mk ek
+CLEANUP_CMD :=
+EK_SOURCES :=
include src/source.mk
-COMPILE = $(CROSS_COMPILE)$(CC) $(DEBUGFLAGS)\
- $(CFLAGS) $(DEPFLAGS) $(COMPILEFLAGS) $(INCLUDEFLAGS)
-
-LINT = $(COMPILE) $(LINTFLAGS)
-
-OBJS != ./scripts/gen-deps --sources "$(SOURCES)"
-
-include deps.mk
-
-.PHONY: lint
-lint: $(OBJS:.o=.o.l)
-
.PHONY: format
format:
- find src include tests -iname '*.[ch]' |\
+ find src include -iname '*.[ch]' |\
xargs uncrustify -c uncrustify.conf --no-backup -F -
.PHONY: license
license:
- find src include tests -iname '*.[ch]' |\
+ find src include -iname '*.[ch]' |\
xargs ./scripts/license
.PHONY: docs
docs:
- find src include -iname '*.[ch]' |\
+ find src include -iname '*.[ch]' -not -path */gen/* |\
xargs ./scripts/warn-undocumented
doxygen docs/doxygen.conf
-.PHONY: check
-check: ek
- ./tests/check.sh
-
-ek: $(OBJS)
- $(COMPILE) $(OBJS) -o $@
+RM = rm
.PHONY: clean
clean:
- $(RM) -r build ek deps.mk
+ $(RM) -rf $(CLEANUP)
.PHONY: clean_docs
clean_docs:
- $(RM) -r docs/output
+ $(RM) -rf docs/output
.PHONY: clean_all
clean_all: clean clean_docs