mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-01 00:58:39 +02:00 
			
		
		
		
	kbuild: add --include-dir flag only for out-of-tree build
The --include-dir flag is used to include check-in Makefiles from $(objtree) without $(srctree)/ prefix. Obviously, this is unneeded for in-tree build. Add the flag just before changing the working directory. This becomes effective after invoking sub-make. Add a little bit comments about it. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
This commit is contained in:
		
							parent
							
								
									00d78ab2ba
								
							
						
					
					
						commit
						80463f1b7b
					
				
					 1 changed files with 10 additions and 4 deletions
				
			
		
							
								
								
									
										14
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										14
									
								
								Makefile
									
									
									
									
									
								
							|  | @ -15,10 +15,9 @@ NAME = Merciless Moray | ||||||
| PHONY := _all | PHONY := _all | ||||||
| _all: | _all: | ||||||
| 
 | 
 | ||||||
| # o Do not use make's built-in rules and variables
 | # Do not use make's built-in rules and variables
 | ||||||
| #   (this increases performance and avoids hard-to-debug behaviour);
 | # (this increases performance and avoids hard-to-debug behaviour)
 | ||||||
| # o Look for make include files relative to root of kernel src
 | MAKEFLAGS += -rR | ||||||
| MAKEFLAGS += -rR --include-dir=$(CURDIR) |  | ||||||
| 
 | 
 | ||||||
| # Avoid funny character set dependencies
 | # Avoid funny character set dependencies
 | ||||||
| unexport LC_ALL | unexport LC_ALL | ||||||
|  | @ -136,6 +135,13 @@ KBUILD_OUTPUT := $(shell mkdir -p $(KBUILD_OUTPUT) && cd $(KBUILD_OUTPUT) \ | ||||||
| $(if $(KBUILD_OUTPUT),, \ | $(if $(KBUILD_OUTPUT),, \ | ||||||
|      $(error failed to create output directory "$(saved-output)")) |      $(error failed to create output directory "$(saved-output)")) | ||||||
| 
 | 
 | ||||||
|  | # Look for make include files relative to root of kernel src
 | ||||||
|  | #
 | ||||||
|  | # This does not become effective immediately because MAKEFLAGS is re-parsed
 | ||||||
|  | # once after the Makefile is read.  It is OK since we are going to invoke
 | ||||||
|  | # 'sub-make' below.
 | ||||||
|  | MAKEFLAGS += --include-dir=$(CURDIR) | ||||||
|  | 
 | ||||||
| PHONY += $(MAKECMDGOALS) sub-make | PHONY += $(MAKECMDGOALS) sub-make | ||||||
| 
 | 
 | ||||||
| $(filter-out _all sub-make $(CURDIR)/Makefile, $(MAKECMDGOALS)) _all: sub-make | $(filter-out _all sub-make $(CURDIR)/Makefile, $(MAKECMDGOALS)) _all: sub-make | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue
	
	 Masahiro Yamada
						Masahiro Yamada