Improve prefix generation and fix build
This commit is contained in:
		
							parent
							
								
									0918ceb842
								
							
						
					
					
						commit
						bd4a3ef82a
					
				
					 3 changed files with 28 additions and 16 deletions
				
			
		|  | @ -4,7 +4,7 @@ ARCH?=x86_64 | |||
| ## Flags to pass to the installer (empty to download binary packages)
 | ||||
| INSTALLER_FLAGS?=--cookbook=cookbook | ||||
| ## Enabled to use binary prefix (much faster)
 | ||||
| PREFIX_BINARY?=1 | ||||
| PREFIX_BINARY?=0 | ||||
| ## Enabled to build custom rustc
 | ||||
| PREFIX_RUSTC?=1 | ||||
| ## Filesystem size in MB (256 is the default)
 | ||||
|  |  | |||
|  | @ -26,9 +26,7 @@ build/coreboot.elf: bootloader-coreboot/build/bootloader | |||
| 	cp -v $< $@ | ||||
| 
 | ||||
| bootloader-efi/build/$(EFI_TARGET)/boot.efi: FORCE | ||||
| 	unset XARGO_HOME XARGO_RUST_SRC && \
 | ||||
| 	cd bootloader-efi && \
 | ||||
| 	rustup component add rust-src && \
 | ||||
| 	$(MAKE) build/$(EFI_TARGET)/boot.efi TARGET=$(EFI_TARGET) | ||||
| 
 | ||||
| build/bootloader.efi: bootloader-efi/build/$(EFI_TARGET)/boot.efi | ||||
|  | @ -36,7 +34,7 @@ build/bootloader.efi: bootloader-efi/build/$(EFI_TARGET)/boot.efi | |||
| 	cp -v $< $@ | ||||
| 
 | ||||
| build/harddrive-efi.bin: build/bootloader.efi build/filesystem.bin | ||||
| 	dd if=/dev/zero of=$@.partial bs=1048576 count=$$(du -m $< | cut -f1) | ||||
| 	dd if=/dev/zero of=$@.partial bs=1048576 count=$$(expr $$(du -m $< | cut -f1) + 1) | ||||
| 	mkfs.vfat $@.partial | ||||
| 	mmd -i $@.partial efi | ||||
| 	mmd -i $@.partial efi/boot | ||||
|  |  | |||
							
								
								
									
										38
									
								
								mk/prefix.mk
									
										
									
									
									
								
							
							
						
						
									
										38
									
								
								mk/prefix.mk
									
										
									
									
									
								
							|  | @ -54,6 +54,32 @@ $(PREFIX)/relibc-install.tar.gz: $(PREFIX)/relibc-install | |||
| 		--directory="$<" \
 | ||||
| 		. | ||||
| 
 | ||||
| $(PREFIX)/rust-install: $(ROOT)/rust | $(PREFIX)/relibc-install | ||||
| 	rm -rf "$(PREFIX)/rust-build" "$@.partial" "$@" | ||||
| 	mkdir -p "$(PREFIX)/rust-build" | ||||
| 	cp -r "$(PREFIX)/relibc-install" "$@.partial" | ||||
| 	cd "$(PREFIX)/rust-build" && \
 | ||||
| 	export PATH="$(ROOT)/$@.partial/bin:$$PATH" && \
 | ||||
| 	"$</configure" \
 | ||||
| 		--prefix="/" \
 | ||||
| 		--disable-docs \
 | ||||
| 		--target="$(TARGET)" \
 | ||||
| 		&& \
 | ||||
| 	make -j `$(NPROC)` && \
 | ||||
| 	make -j `$(NPROC)` install DESTDIR="$(ROOT)/$@.partial" | ||||
| 	rm -rf "$(PREFIX)/rust-build" | ||||
| 	mkdir -p "$@.partial/lib/rustlib/x86_64-unknown-linux-gnu/bin" | ||||
| 	cd "$@.partial" && $(PREFIX_STRIP) | ||||
| 	touch "$@.partial" | ||||
| 	mv "$@.partial" "$@" | ||||
| 
 | ||||
| $(PREFIX)/rust-install.tar.gz: $(PREFIX)/rust-install | ||||
| 	tar \
 | ||||
| 		--create \
 | ||||
| 		--gzip \
 | ||||
| 		--file "$@" \
 | ||||
| 		--directory="$<" \
 | ||||
| 		. | ||||
| ifeq ($(PREFIX_BINARY),1) | ||||
| 
 | ||||
| $(PREFIX)/gcc-install.tar.gz: | ||||
|  | @ -200,16 +226,4 @@ $(PREFIX)/gcc-install.tar.gz: $(PREFIX)/gcc-install | |||
| 		--file "$@" \
 | ||||
| 		--directory="$<" \
 | ||||
| 		. | ||||
| 
 | ||||
| # Building full rustc may not be required
 | ||||
| # $(PREFIX)/rust-install: $(ROOT)/rust | $(PREFIX)/gcc-install
 | ||||
| # 	rm -rf "$(PREFIX)/rust-build" "$@"
 | ||||
| # 	mkdir -p "$(PREFIX)/rust-build" "$@"
 | ||||
| # 	cd "$(PREFIX)/rust-build" && \
 | ||||
| # 	export PATH="$(PREFIX_PATH):$$PATH" && \
 | ||||
| # 	"$</configure" --target="$(TARGET)" --prefix="$@" --disable-docs && \
 | ||||
| # 	make -j `$(NPROC)` && \
 | ||||
| # 	make -j `$(NPROC)` install
 | ||||
| # 	touch "$@"
 | ||||
| 
 | ||||
| endif | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Jeremy Soller
						Jeremy Soller