[make][buildall] add ability to filter buildall by architecture

Clean up make targets list-arch and list-toolchain to be much faster and
work without needing to invoke the archtecture's arch rules.mk. This
should make it work on machines that do not have that particular
toolchain in the path.

This is setting up for using it in the github action script.
This commit is contained in:
Travis Geiselbrecht
2025-07-18 21:32:05 -07:00
parent 50dc95b85e
commit be52909f49
7 changed files with 60 additions and 21 deletions

View File

@@ -183,11 +183,25 @@ include platform/$(PLATFORM)/rules.mk
ifndef ARCH
$(error couldn't find arch or platform doesn't define arch)
endif
# list the architecture specified in the project/target/platform rules.mk and early terminate.
ifeq ($(MAKECMDGOALS), list-arch)
$(info ARCH = $(ARCH))
.PHONY: list-arch
list-arch:
else
include arch/$(ARCH)/rules.mk
ifndef TOOLCHAIN_PREFIX
$(error TOOLCHAIN_PREFIX not set in the arch rules.mk)
endif
ifeq ($(MAKECMDGOALS), list-toolchain)
$(info TOOLCHAIN_PREFIX = $(TOOLCHAIN_PREFIX))
.PHONY: list-toolchain
list-toolchain:
else
# default to no ccache
CCACHE ?=
CC ?= $(CCACHE) $(TOOLCHAIN_PREFIX)gcc
@@ -354,12 +368,6 @@ clean: $(EXTRA_CLEANDEPS)
install: all
scp $(OUTBIN) 192.168.0.4:/tftpboot
list-arch:
@echo ARCH = ${ARCH}
list-toolchain:
@echo TOOLCHAIN_PREFIX = ${TOOLCHAIN_PREFIX}
tags: $(BUILDDIR)/srcfiles.txt $(BUILDDIR)/include_paths.txt
$(info generating tags)
@ctags -L $<
@@ -382,6 +390,10 @@ ifeq ($(filter $(MAKECMDGOALS), clean), )
-include $(DEPS)
endif
endif # ifeq ($(filter $(MAKECMDGOALS), list-toolchain))
endif # ifeq ($(filter $(MAKECMDGOALS), list-arch))
endif # do-nothing = 1
endif # make spotless