Commit ed1ca528aae1f3ae7400c5816e6d2cdb082ee785

Authored by Masahiro Yamada
Committed by Tom Rini
1 parent 886d86e87d

kbuild: add misc targets, help, ubootrelease, ubootversion

"help" target has been copied from Linux 3.13 and adjusted
for U-Boot.
Unlike Linux, cleaning is done on 4 levels:
clean, clobber, mrproper, distclean.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>

Showing 1 changed file with 58 additions and 7 deletions Side-by-side Diff

... ... @@ -415,7 +415,7 @@
415 415  
416 416 no-dot-config-targets := clean clobber mrproper distclean \
417 417 help %docs check% coccicheck \
418   - backup
  418 + ubootversion backup
419 419  
420 420 config-targets := 0
421 421 mixed-targets := 0
... ... @@ -1081,12 +1081,6 @@
1081 1081 FIND := find
1082 1082 FINDFLAGS := -L
1083 1083  
1084   -PHONY += checkstack
1085   -
1086   -checkstack:
1087   - $(OBJDUMP) -d u-boot $$(find . -name u-boot-spl) | \
1088   - $(PERL) $(src)/scripts/checkstack.pl $(ARCH)
1089   -
1090 1084 tags ctags:
1091 1085 ctags -w -o ctags `$(FIND) $(FINDFLAGS) $(TAG_SUBDIRS) \
1092 1086 -name '*.[chS]' -print`
1093 1087  
... ... @@ -1252,7 +1246,52 @@
1252 1246 F=`basename $(TOPDIR)` ; cd .. ; \
1253 1247 gtar --force-local -zcvf `LC_ALL=C date "+$$F-%Y-%m-%d-%T.tar.gz"` $$F
1254 1248  
  1249 +help:
  1250 + @echo 'Cleaning targets:'
  1251 + @echo ' clean - Remove most generated files but keep the config and'
  1252 + @echo ' necessities for testing u-boot'
  1253 + @echo ' clobber - Remove most generated files but keep the config'
  1254 + @echo ' mrproper - Remove all generated files + config + various backup files'
  1255 + @echo ' distclean - mrproper + remove editor backup and patch files'
  1256 + @echo ''
  1257 +# uncomment after adding Kconfig feature
  1258 +# @echo 'Configuration targets:'
  1259 +# @$(MAKE) -f $(srctree)/scripts/kconfig/Makefile help
  1260 +# @echo ''
  1261 + @echo 'Other generic targets:'
  1262 + @echo ' all - Build all necessary images depending on configuration'
  1263 + @echo ' u-boot - Build the bare u-boot'
  1264 + @echo ' dir/ - Build all files in dir and below'
  1265 + @echo ' dir/file.[oisS] - Build specified target only'
  1266 + @echo ' dir/file.lst - Build specified mixed source/assembly target only'
  1267 + @echo ' (requires a recent binutils and recent build (System.map))'
  1268 + @echo ' tags/TAGS - Generate tags file for editors'
  1269 + @echo ' cscope - Generate cscope index'
  1270 + @echo ' ubootrelease - Output the release version string'
  1271 + @echo ' ubootversion - Output the version stored in Makefile'
  1272 + @echo ''
  1273 + @echo 'Static analysers'
  1274 + @echo ' checkstack - Generate a list of stack hogs'
  1275 + @echo ''
  1276 + @echo 'Documentation targets:'
  1277 + @$(MAKE) -f $(srctree)/doc/DocBook/Makefile dochelp
  1278 + @echo ''
  1279 + @echo ' make V=0|1 [targets] 0 => quiet build (default), 1 => verbose build'
  1280 + @echo ' make V=2 [targets] 2 => give reason for rebuild of target'
  1281 + @echo ' make O=dir [targets] Locate all output files in "dir", including .config'
  1282 + @echo ' make C=1 [targets] Check all c source with $$CHECK (sparse by default)'
  1283 + @echo ' make C=2 [targets] Force check of all c source with $$CHECK'
  1284 + @echo ' make RECORDMCOUNT_WARN=1 [targets] Warn about ignored mcount sections'
  1285 + @echo ' make W=n [targets] Enable extra gcc checks, n=1,2,3 where'
  1286 + @echo ' 1: warnings which may be relevant and do not occur too often'
  1287 + @echo ' 2: warnings which occur quite often but may still be relevant'
  1288 + @echo ' 3: more obscure warnings, can most likely be ignored'
  1289 + @echo ' Multiple levels can be combined with W=12 or W=123'
  1290 + @echo ''
  1291 + @echo 'Execute "make" or "make all" to build all targets marked with [*] '
  1292 + @echo 'For further info see the ./README file'
1255 1293  
  1294 +
1256 1295 # Documentation targets
1257 1296 # ---------------------------------------------------------------------------
1258 1297 %docs: scripts_basic FORCE
... ... @@ -1266,6 +1305,18 @@
1266 1305  
1267 1306 endif #ifeq ($(config-targets),1)
1268 1307 endif #ifeq ($(mixed-targets),1)
  1308 +
  1309 +PHONY += checkstack ubootrelease ubootversion
  1310 +
  1311 +checkstack:
  1312 + $(OBJDUMP) -d u-boot $$(find . -name u-boot-spl) | \
  1313 + $(PERL) $(src)/scripts/checkstack.pl $(ARCH)
  1314 +
  1315 +ubootrelease:
  1316 + @echo "$(UBOOTVERSION)$$($(CONFIG_SHELL) $(srctree)/scripts/setlocalversion $(srctree))"
  1317 +
  1318 +ubootversion:
  1319 + @echo $(UBOOTVERSION)
1269 1320  
1270 1321 # Single targets
1271 1322 # ---------------------------------------------------------------------------