Skip to content
This repository has been archived by the owner on May 6, 2020. It is now read-only.

Commit

Permalink
build: Add 'show-arches' target
Browse files Browse the repository at this point in the history
Add a new build target that displays all available
architectures and indicates the default:

```
make show-arches
```

Fixes #1009.

Signed-off-by: James O. D. Hunt <[email protected]>
  • Loading branch information
jodh-intel committed Feb 19, 2018
1 parent 3642602 commit 84104b8
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ endif
ARCH_DIR = arch
ARCH_FILE_SUFFIX = -options.mk
ARCH_FILE = $(ARCH_DIR)/$(ARCH)$(ARCH_FILE_SUFFIX)
ARCH_FILES = $(wildcard arch/*$(ARCH_FILE_SUFFIX))
ALL_ARCHES = $(patsubst $(ARCH_DIR)/%$(ARCH_FILE_SUFFIX),%,$(ARCH_FILES))

# Load architecture-dependent settings
include $(ARCH_FILE)
Expand Down Expand Up @@ -313,6 +315,11 @@ define DIR_EXISTS
$(shell test -d $(1) && echo "$(1)")
endef

# $1: name of architecture to display
define SHOW_ARCH
$(shell printf "\\t%s%s\\\n" "$(1)" $(if $(filter $(ARCH),$(1))," (default)",""))
endef

# Only install git hooks if working in a git clone
ifneq (,$(call DIR_EXISTS,.git))
HANDLE_GIT_HOOKS = install-git-hooks
Expand Down Expand Up @@ -538,6 +545,7 @@ show-usage: show-header
@printf "\tinstall : install files [2].\n"
@printf "\tinstall-$(CC_TYPE)-system : install using standard $(CC_PROJECT_NAME) system paths.\n"
@printf "\tinstall-$(KATA_TYPE)-system : install using standard $(KATA_PROJECT_NAME) system paths.\n"
@printf "\tshow-arches : show supported architectures (ARCH variable values).\n"
@printf "\tshow-summary : show install locations.\n"
@printf "\n"
@printf " Notes:\n"
Expand Down Expand Up @@ -567,6 +575,11 @@ show-variables:
show-header:
@printf "%s - version %s (commit %s)\n\n" $(TARGET) $(VERSION) $(COMMIT)

show-arches: show-header
@printf "Supported architectures (possible values for ARCH variable):\n\n"
@printf \
"$(foreach v,$(ALL_ARCHES),$(call SHOW_ARCH,$(v)))\n"

show-footer:
@printf "• Project:\n"
@printf "\tHome: $(PROJECT_URL)\n"
Expand Down

0 comments on commit 84104b8

Please sign in to comment.