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>
			
			
This commit is contained in:
		
							parent
							
								
									0d1e8aacb8
								
							
						
					
					
						commit
						331b45fb70
					
				
							
								
								
									
										15
									
								
								Makefile
								
								
								
								
							
							
						
						
									
										15
									
								
								Makefile
								
								
								
								
							| 
						 | 
					@ -485,13 +485,6 @@ ifeq ($(wildcard include/config.mk),)
 | 
				
			||||||
$(error "System not configured - see README")
 | 
					$(error "System not configured - see README")
 | 
				
			||||||
endif
 | 
					endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
ifeq ($(__HAVE_ARCH_GENERIC_BOARD),)
 | 
					 | 
				
			||||||
ifneq ($(CONFIG_SYS_GENERIC_BOARD),)
 | 
					 | 
				
			||||||
$(error Your architecture does not support generic board. \
 | 
					 | 
				
			||||||
Please undefined CONFIG_SYS_GENERIC_BOARD in your board config file)
 | 
					 | 
				
			||||||
endif
 | 
					 | 
				
			||||||
endif
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# If board code explicitly specified LDSCRIPT or CONFIG_SYS_LDSCRIPT, use
 | 
					# If board code explicitly specified LDSCRIPT or CONFIG_SYS_LDSCRIPT, use
 | 
				
			||||||
# that (or fail if absent).  Otherwise, search for a linker script in a
 | 
					# that (or fail if absent).  Otherwise, search for a linker script in a
 | 
				
			||||||
# standard location.
 | 
					# standard location.
 | 
				
			||||||
| 
						 | 
					@ -996,7 +989,13 @@ endif
 | 
				
			||||||
prepare2: prepare3 outputmakefile
 | 
					prepare2: prepare3 outputmakefile
 | 
				
			||||||
 | 
					
 | 
				
			||||||
prepare1: prepare2 $(version_h) $(timestamp_h)
 | 
					prepare1: prepare2 $(version_h) $(timestamp_h)
 | 
				
			||||||
	@:
 | 
					ifeq ($(__HAVE_ARCH_GENERIC_BOARD),)
 | 
				
			||||||
 | 
					ifeq ($(CONFIG_SYS_GENERIC_BOARD),y)
 | 
				
			||||||
 | 
						@echo >&2 "  Your architecture does not support generic board."
 | 
				
			||||||
 | 
						@echo >&2 "  Please undefine CONFIG_SYS_GENERIC_BOARD in your board config file."
 | 
				
			||||||
 | 
						@/bin/false
 | 
				
			||||||
 | 
					endif
 | 
				
			||||||
 | 
					endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
archprepare: prepare1 scripts_basic
 | 
					archprepare: prepare1 scripts_basic
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue