skiboot's Makefile always executes $(CC) to determine whether its clang
or GCC and not setting CROSS for clean target results in this annoying
output (assuming `powerpc64-linux-gcc` isn't available):
    make[2]: powerpc64-linux-gcc: No such file or directory
Change-Id: I242b2d7c1bdf1bbd70fd4e4e0605341fe8301ca5
Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/67053
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Krystian Hebel <krystian.hebel@3mdeb.com>
		
	
		
			
				
	
	
		
			38 lines
		
	
	
		
			1.0 KiB
		
	
	
	
		
			Makefile
		
	
	
	
	
	
			
		
		
	
	
			38 lines
		
	
	
		
			1.0 KiB
		
	
	
	
		
			Makefile
		
	
	
	
	
	
| ## SPDX-License-Identifier: GPL-2.0-only
 | |
| 
 | |
| build_dir=$(CURDIR)/build
 | |
| skiboot_dir=$(CURDIR)/skiboot
 | |
| skiboot_git_repo=$(CONFIG_SKIBOOT_GIT_REPO)
 | |
| skiboot_revision=$(CONFIG_SKIBOOT_REVISION)
 | |
| skiboot_elf=$(build_dir)/skiboot.elf
 | |
| skiboot_cross=$(or $(CROSS),powerpc64-linux-gnu-)
 | |
| 
 | |
| unexport $(COREBOOT_EXPORTS)
 | |
| 
 | |
| .PHONY: all clean distclean
 | |
| 
 | |
| all: $(skiboot_elf)
 | |
| 
 | |
| $(skiboot_elf): | $(skiboot_dir) $(build_dir)
 | |
| 	+$(MAKE) -C $(skiboot_dir) CROSS="$(skiboot_cross)"
 | |
| 	cp $(skiboot_dir)/skiboot.elf $@
 | |
| 	# skiboot is always built with debug information due to unconditional -ggdb
 | |
| 	$(skiboot_cross)strip $@
 | |
| 
 | |
| $(skiboot_dir):
 | |
| 	git clone $(skiboot_git_repo) $(skiboot_dir)
 | |
| 	git -C $(skiboot_dir) checkout $(skiboot_revision)
 | |
| 
 | |
| $(build_dir):
 | |
| 	mkdir -p $(build_dir)
 | |
| 
 | |
| distclean: clean
 | |
| 	rm -rf $(skiboot_dir)
 | |
| 
 | |
| clean:
 | |
| 	# Redefine RM because it's used like `$(RM) non-existent-file`
 | |
| 	# Also ignore useless messages about removing test files
 | |
| 	[ ! -d $(skiboot_dir) ] || \
 | |
| 	        $(MAKE) -C $(skiboot_dir) RM="rm -rf" CROSS="$(skiboot_cross)" clean > /dev/null
 | |
| 	rm -rf $(build_dir)
 |