Skip to content

Commit

Permalink
improve 'make help' and remove config targets
Browse files Browse the repository at this point in the history
- Put kconfig targets in a new target 'kconfig-help' instead of showing
  it by default.
- Show how the the different boards can be used with make BOARD=<board>

Change-Id: I481d4acaf72b1f05925c6f56e510329681da8e11
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
  • Loading branch information
nashif authored and Gerrit Code Review committed Feb 17, 2016
1 parent b7b0a16 commit a77c7d8
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@ NAME = Zephyr Kernel

export SOURCE_DIR PROJECT MDEF_FILE

ifneq ($(MAKECMDGOALS),help)
ifeq ($(PROJECT),)
ifeq ($(MAKECMDGOALS),)
$(error Invoking make from top-level kernel directory is not supported)
endif
endif

# *DOCUMENTATION*
# To see a list of typical targets execute "make help"
Expand Down Expand Up @@ -450,7 +448,7 @@ endif

version_h := include/generated/version.h

no-dot-config-targets := pristine distclean clean mrproper help \
no-dot-config-targets := pristine distclean clean mrproper help kconfig-help \
cscope gtags TAGS tags help% %docs check% \
$(version_h) headers_% kernelversion %src-pkg

Expand Down Expand Up @@ -1006,6 +1004,12 @@ distclean: mrproper
boards := $(wildcard $(srctree)/boards/*/*_defconfig)
boards := $(sort $(notdir $(boards)))

kconfig-help:
@echo 'Configuration targets:'
@echo ''
@$(MAKE) -f $(srctree)/scripts/kconfig/Makefile help
@echo ''

help:
@echo 'Cleaning targets:'
@echo ' clean - Remove most generated files but keep configuration and backup files'
Expand All @@ -1014,29 +1018,35 @@ help:
@echo ' pristine - Remove the output directory with all generated files'
@echo ''
@echo 'Configuration targets:'
@$(MAKE) -f $(srctree)/scripts/kconfig/Makefile help
@echo ''
@echo ' run <make kconfig-help>'
@echo ''
@echo 'Other generic targets:'
@echo ' all - Build all targets marked with [*]'
@echo '* zephyr - Build a zephyr application'
@echo ' qemu - Build a zephyr application and run it in qemu'
@echo ' flash - Build and flash an application'
@echo ' debug - Build and debug an application using GDB'
@echo ''
@echo 'Supported Boards:'
@echo ''
@echo ' To build an image for one of the supported boards below, run:'
@echo ''
@echo ' make BOARD=<BOARD NAME>'
@echo ' in the application directory.'
@echo ''
@echo ' To flash the image (if supported), run:'
@echo ''
@echo ' make BOARD=<BOARD NAME> flash'
@echo ''
@$(if $(boards), \
$(foreach b, $(boards), \
printf " %-24s - Build for %s\\n" $(b) $(subst _defconfig,,$(b));) \
printf " make BOARD=%-24s - Build for %s\\n" $(subst _defconfig,,$(b)) $(subst _defconfig,,$(b));) \
echo '')

@echo ''
@echo 'Build flags:'
@echo ''
@echo ' make V=0|1 [targets] 0 => quiet build (default), 1 => verbose build'
@echo ' make V=2 [targets] 2 => give reason for rebuild of target'
@echo ' make O=dir [targets] Locate all output files in "dir", including .config'
Expand Down

0 comments on commit a77c7d8

Please sign in to comment.