Commit 331b45fb70e6c2355a28f1a11d63075a873bb1d5

Authored by Masahiro Yamada
Committed by Tom Rini
1 parent 0d1e8aacb8

kbuild: Fix a false error of generic board support

Before this commit, make terminated with an error
where is shouldn't under some condition.

This bug happened when we built a board unsupporting
generic board right after building with generic board.

For example, the following sequence failed.
(harmony uses generic board but microblaze-generic does not
support it)

  $ make harmony_config
  Configuring for harmony board...
  $ make CROSS_COMPILE=arm-linux-gnueabi-
    [ Build succeed ]
  $ make microblaze-generic_config
  Configuring for microblaze-generic board...
  $ make CROSS_COMPILE=microblaze-linux-
  Makefile:488: *** Your architecture does not support generic board.
  Please undefined CONFIG_SYS_GENERIC_BOARD in your board config file.  Stop.

We had to do "make clean" before building the microblaze board.

This commit fixes this unconvenience.

Move generic board sanity check to "prepare1" target,
which is run after generation of include/autoconf.mk.

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

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

... ... @@ -485,13 +485,6 @@
485 485 $(error "System not configured - see README")
486 486 endif
487 487  
488   -ifeq ($(__HAVE_ARCH_GENERIC_BOARD),)
489   -ifneq ($(CONFIG_SYS_GENERIC_BOARD),)
490   -$(error Your architecture does not support generic board. \
491   -Please undefined CONFIG_SYS_GENERIC_BOARD in your board config file)
492   -endif
493   -endif
494   -
495 488 # If board code explicitly specified LDSCRIPT or CONFIG_SYS_LDSCRIPT, use
496 489 # that (or fail if absent). Otherwise, search for a linker script in a
497 490 # standard location.
... ... @@ -996,7 +989,13 @@
996 989 prepare2: prepare3 outputmakefile
997 990  
998 991 prepare1: prepare2 $(version_h) $(timestamp_h)
999   - @:
  992 +ifeq ($(__HAVE_ARCH_GENERIC_BOARD),)
  993 +ifeq ($(CONFIG_SYS_GENERIC_BOARD),y)
  994 + @echo >&2 " Your architecture does not support generic board."
  995 + @echo >&2 " Please undefine CONFIG_SYS_GENERIC_BOARD in your board config file."
  996 + @/bin/false
  997 +endif
  998 +endif
1000 999  
1001 1000 archprepare: prepare1 scripts_basic
1002 1001