GNUmakefile: bandaid solution to fallback sysexits.h not working with Rust
This commit is contained in:
		
							parent
							
								
									9ed70e9648
								
							
						
					
					
						commit
						5df9c33d70
					
				
							
								
								
									
										10
									
								
								GNUmakefile
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								GNUmakefile
									
									
									
									
									
								
							| @ -40,7 +40,9 @@ endif | ||||
| build: build_dir false intcmp scrut str strcmp true | ||||
| 
 | ||||
| build_dir: | ||||
| 	mkdir -p build/bin build/lib build/o | ||||
| 	# keep build/include until bindgen(1) has stdin support | ||||
| 	# https://github.com/rust-lang/rust-bindgen/issues/2703 | ||||
| 	mkdir -p build/bin build/include build/lib build/o | ||||
| 
 | ||||
| clean: | ||||
| 	rm -rf build/ | ||||
| @ -58,8 +60,12 @@ test: build | ||||
| 	tests/posix-compat.sh | ||||
| 
 | ||||
| sysexits: build_dir | ||||
| 	# bandage solution until bindgen(1) gets stdin support | ||||
| 	printf '#define EXIT_FAILURE 1\n' | cat - include/sysexits.h \
 | ||||
| 		> build/include/sysexits.h  | ||||
| 	bindgen --default-macro-constant-type signed --use-core \
 | ||||
| 		"$$(printf '#include <sysexits.h>\n' | cpp -M -idirafter include - \
 | ||||
| 		"$$(printf '#include <sysexits.h>\n' \
 | ||||
| 		| cpp -M -idirafter "$$PWD/build/include" - \
 | ||||
| 		| sed 's/ /\n/g' | grep sysexits.h)" \
 | ||||
| 		| $(RUSTC) $(RUSTCFLAGS) --crate-type lib -o build/o/libsysexits.rlib - | ||||
| 
 | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user