Makefile: remove hard bindgen(1) dep
This commit is contained in:
parent
d3c59ede0d
commit
6e859fa7e2
21
Makefile
21
Makefile
@ -28,13 +28,18 @@ MANDIR != test $(PREFIX_N) = / && printf '/usr/share/man\n' \
|
|||||||
SYSEXITS != printf '\043include <sysexits.h>\n' | cpp -M - | tr ' ' '\n' \
|
SYSEXITS != printf '\043include <sysexits.h>\n' | cpp -M - | tr ' ' '\n' \
|
||||||
| sed -n 's/sysexits\.h//p' || printf 'include\n'
|
| sed -n 's/sysexits\.h//p' || printf 'include\n'
|
||||||
|
|
||||||
|
BINDGEN ?= bindgen
|
||||||
|
BINDGENFLAGS ?= --fit-macro-constant-types \
|
||||||
|
--default-macro-constant-type unsigned --use-core --formatter=none
|
||||||
|
|
||||||
CC ?= cc
|
CC ?= cc
|
||||||
|
CFLAGS += -I$(SYSEXITS)
|
||||||
|
|
||||||
RUSTC ?= rustc
|
RUSTC ?= rustc
|
||||||
RUSTFLAGS += --extern delimit=build/o/libdelimit.rlib \
|
RUSTFLAGS += --extern delimit=build/o/libdelimit.rlib \
|
||||||
--extern getopt=build/o/libgetopt.rlib \
|
--extern getopt=build/o/libgetopt.rlib \
|
||||||
--extern strerror=build/o/libstrerror.rlib \
|
--extern strerror=build/o/libstrerror.rlib \
|
||||||
--extern sysexits=build/o/libsysexits.rlib
|
--extern sysexits=build/o/libsysexits.rlib
|
||||||
CFLAGS += -I$(SYSEXITS)
|
|
||||||
|
|
||||||
# testing requires the absolute path to the bin directory set
|
# testing requires the absolute path to the bin directory set
|
||||||
BIN = build/bin
|
BIN = build/bin
|
||||||
@ -71,15 +76,15 @@ TESTS != printf '%s\n' "$(TESTFILES)" | xargs -n1 basename \
|
|||||||
include $(TESTFILES)
|
include $(TESTFILES)
|
||||||
|
|
||||||
.PHONY: test
|
.PHONY: test
|
||||||
test: all $(TESTS) /tmp/delimit /tmp/getopt
|
test: all $(TESTS) build/test/delimit build/test/getopt
|
||||||
@echo $(TESTS)
|
@echo $(TESTS)
|
||||||
/tmp/delimit
|
build/test/delimit
|
||||||
/tmp/getopt
|
build/test/getopt
|
||||||
|
|
||||||
/tmp/delimit: src/libdelimit.rs
|
build/test/delimit: src/libdelimit.rs
|
||||||
$(RUSTC) --test -o $@ src/libdelimit.rs
|
$(RUSTC) --test -o $@ src/libdelimit.rs
|
||||||
|
|
||||||
/tmp/getopt: src/libgetopt.rs
|
build/test/getopt: src/libgetopt.rs
|
||||||
$(RUSTC) --test -o $@ src/libgetopt.rs
|
$(RUSTC) --test -o $@ src/libgetopt.rs
|
||||||
|
|
||||||
.PHONY: docs
|
.PHONY: docs
|
||||||
@ -109,8 +114,8 @@ build/o/libstrerror.rlib: build src/libstrerror.rs
|
|||||||
src/libstrerror.rs
|
src/libstrerror.rs
|
||||||
|
|
||||||
build/o/libsysexits.rlib: build/include/sysexits.h
|
build/o/libsysexits.rlib: build/include/sysexits.h
|
||||||
bindgen --fit-macro-constant-types --default-macro-constant-type unsigned --use-core --formatter=none \
|
$(BINDGEN) $(BINDGENFLAGS) build/include/sysexits.h \
|
||||||
build/include/sysexits.h | $(RUSTC) $(RUSTFLAGS) --crate-type lib -o $@ -
|
| $(RUSTC) $(RUSTFLAGS) --crate-type lib -o $@ -
|
||||||
|
|
||||||
# bandage solution until bindgen(1) gets stdin support
|
# bandage solution until bindgen(1) gets stdin support
|
||||||
build/include/sysexits.h: build $(SYSEXITS)sysexits.h
|
build/include/sysexits.h: build $(SYSEXITS)sysexits.h
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user