aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2024-05-24 14:32:35 +0300
committerKimplul <kimi.h.kuparinen@gmail.com>2024-05-24 14:39:31 +0300
commit123860bc029465ff88c3bf82165a89170fa41153 (patch)
tree7218306027a61d5e9c1dc1107aeef09eb153ec1b /Makefile
parent9f261587a75d5fa21ef63fd9a38e0f7851180adf (diff)
downloadqbt-123860bc029465ff88c3bf82165a89170fa41153.tar.gz
qbt-123860bc029465ff88c3bf82165a89170fa41153.zip
fix bmake compilation
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile71
1 files changed, 30 insertions, 41 deletions
diff --git a/Makefile b/Makefile
index e89237d..a75b0ab 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 -g
-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: qbt
+.PHONY:
+setup:
+ @echo -n > deps.mk
+ @./scripts/gen-deps -p QBT -c COMPILE_QBT -b qbt "$(QBT_SOURCES)"
-# default values
-CROSS_COMPILE ?=
-
-# common programs
-CC = gcc
-
-SOURCES :=
+CLEANUP := build deps.mk qbt
+CLEANUP_CMD :=
+QBT_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]' |\
- xargs -n 10 -P 0 uncrustify -c uncrustify.conf --no-backup -F -
+ find src include -iname '*.[ch]' |\
+ xargs uncrustify -c uncrustify.conf --no-backup -F -
.PHONY: license
license:
- find src include tests -iname '*.[ch]' |\
- xargs -n 10 -P 0 ./scripts/license
+ 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
-
-qbt: $(OBJS)
- $(COMPILE) $(OBJS) -o $@
+RM = rm
.PHONY: clean
clean:
- $(RM) -r build qbt 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