From fd30e99f93313bec0af3ff5ec3735d90dd025dce Mon Sep 17 00:00:00 2001 From: Kimplul Date: Fri, 24 May 2024 14:04:49 +0300 Subject: fix bmake compilation --- Makefile | 73 +++++++++++++++++++++++++++------------------------------------- 1 file changed, 31 insertions(+), 42 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index a2c18cd..9bd13a7 100644 --- a/Makefile +++ b/Makefile @@ -1,67 +1,56 @@ -DO != echo -n > deps.mk - -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 = - -all: ek - -# default values -CROSS_COMPILE ?= - -# common programs -CC = gcc - -SOURCES := +.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: +setup: + @echo -n > deps.mk + @./scripts/gen-deps -p EK -c COMPILE_EK -b ek "$(EK_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 -- cgit v1.3