Makefile: replace bindgen with awk
This commit is contained in:
parent
c7ed30bd6e
commit
8c4552c0f3
10
Makefile
10
Makefile
@ -29,8 +29,6 @@ CFLAGS += -Ibuild/include
|
||||
.PHONY: all
|
||||
all: docs 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:
|
||||
mkdir -p build/bin build/docs build/include build/lib build/o build/test
|
||||
|
||||
@ -77,10 +75,10 @@ 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 build/include/sysexits.h
|
||||
bindgen --default-macro-constant-type signed --use-core --formatter=none \
|
||||
build/include/sysexits.h | $(RUSTC) $(RUSTFLAGS) --crate-type lib -o $@ -
|
||||
<build/include/sysexits.h \
|
||||
awk '{ print "pub const " $$2 ": i32 = " $$3 ";"; }' \
|
||||
| $(RUSTC) $(RUSTFLAGS) --crate-type lib -o $@ -
|
||||
|
||||
.PHONY: dj
|
||||
dj: build/bin/dj
|
||||
@ -139,7 +137,7 @@ build/bin/strcmp: src/strcmp.c build
|
||||
|
||||
.PHONY: swab
|
||||
swab: build/bin/swab
|
||||
build/bin/swab: src/swab.rs build build/o/libsysexits.rlib
|
||||
build/bin/swab: src/swab.rs build rustlibs
|
||||
$(RUSTC) $(RUSTFLAGS) --extern getopt=build/o/libgetopt.rlib \
|
||||
--extern sysexits=build/o/libsysexits.rlib \
|
||||
-o $@ src/swab.rs
|
||||
|
Loading…
Reference in New Issue
Block a user