Makefile: updates to use new POSIX 2024 standard features!
This commit is contained in:
		
							parent
							
								
									314254b32f
								
							
						
					
					
						commit
						d201f9228c
					
				
							
								
								
									
										11
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								Makefile
									
									
									
									
									
								
							@ -11,8 +11,7 @@
 | 
			
		||||
.POSIX:
 | 
			
		||||
 | 
			
		||||
# if using BSD make(1), remove these pragmas because they break it
 | 
			
		||||
.PRAGMA: posix_202x # future POSIX standard support à la pdpmake(1)
 | 
			
		||||
.PRAGMA: command_comment # breaks without this?
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
DESTDIR ?= dist
 | 
			
		||||
PREFIX ?= /usr/local
 | 
			
		||||
@ -32,9 +31,9 @@ CFLAGS += -I$(SYSEXITS)
 | 
			
		||||
.PHONY: all
 | 
			
		||||
all: dj false fop hru intcmp mm npc rpn scrut str strcmp swab true
 | 
			
		||||
 | 
			
		||||
# keep build/include until bindgen(1) has stdin support
 | 
			
		||||
# https://github.com/rust-lang/rust-bindgen/issues/2703
 | 
			
		||||
build:
 | 
			
		||||
	# 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 build/test
 | 
			
		||||
 | 
			
		||||
.PHONY: clean
 | 
			
		||||
@ -67,9 +66,9 @@ build/o/libstrerror.rlib: build src/strerror.rs
 | 
			
		||||
	$(RUSTC) $(RUSTFLAGS) --crate-type=lib -o $@ \
 | 
			
		||||
		src/strerror.rs
 | 
			
		||||
 | 
			
		||||
# bandage solution until bindgen(1) gets stdin support
 | 
			
		||||
build/o/libsysexits.rlib: build $(SYSEXITS)sysexits.h
 | 
			
		||||
	# bandage solution until bindgen(1) gets stdin support
 | 
			
		||||
	printf '#define EXIT_FAILURE 1\n' | cat - $(SYSEXITS)sysexits.h \
 | 
			
		||||
	printf '\043define EXIT_FAILURE 1\n' | cat - $(SYSEXITS)sysexits.h \
 | 
			
		||||
		> build/include/sysexits.h 
 | 
			
		||||
	bindgen --default-macro-constant-type signed --use-core --formatter=none \
 | 
			
		||||
		build/include/sysexits.h | $(RUSTC) $(RUSTFLAGS) --crate-type lib -o $@ -
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user