build: Do as much as possible inside of the SDK container.

Parts of the rules, including the magical ones created via
make/rules-*.mk, are executed inside of the container via SHELL
override, and parts are executed on the host side.

This makes reasoning about and debugging the rules much harder than it
should be. It also requirs the users to have certain programs installed
on the host in addition to docker/podman.

With this change `make` will act as a simple pass through to inside of
the container for the most part.

One notable exception is installation which still happens the host side.
This commit is contained in:
Arkadiusz Hiler 2023-01-13 13:48:41 +02:00
parent 9f8a37c0c1
commit 692ef0aa1f
11 changed files with 320 additions and 394 deletions

View file

@ -15,7 +15,6 @@
define create-rules-source
$(2)_SRC = $$(OBJ)/src-$(1)
ifeq ($(CONTAINER),)
$(1)-rebuild:
.PHONY: $(1)-rebuild
@ -29,7 +28,6 @@ $$(OBJ)/.$(1)-source: $$(shell echo -n 'syncing $(1)... ' >&2 && \
touch $$@
$$(OBJ)/.$(1)-post-source: $$(OBJ)/.$(1)-source
container-build: $$(OBJ)/.$(1)-post-source
$(1)-source: $$(OBJ)/.$(1)-post-source
.PHONY: $(1)-source
@ -47,7 +45,6 @@ $(1)-distclean::
clean: $(1)-clean
distclean: $(1)-distclean
.PHONY: clean distclean
endif
endef
rules-source = $(call create-rules-source,$(1),$(call toupper,$(1)),$(2))