Makefile: even more changes
This commit is contained in:
parent
2ad7140e1e
commit
b2d56bbc9a
13
Makefile
13
Makefile
@ -16,11 +16,15 @@
|
|||||||
DESTDIR=./dist
|
DESTDIR=./dist
|
||||||
PREFIX=/usr/local
|
PREFIX=/usr/local
|
||||||
|
|
||||||
|
SYSEXITS!=printf '\043include <sysexits.h>\n' | cpp -M - | sed 's/ /\n/g' \
|
||||||
|
| sed -n 's/sysexits\.h//p' || printf 'include/\n'
|
||||||
|
|
||||||
CC?=cc
|
CC?=cc
|
||||||
RUSTC?=rustc
|
RUSTC?=rustc
|
||||||
RUSTLIBS=--extern getopt=build/o/libgetopt.rlib \
|
RUSTLIBS=--extern getopt=build/o/libgetopt.rlib \
|
||||||
--extern sysexits=build/o/libsysexits.rlib \
|
--extern sysexits=build/o/libsysexits.rlib \
|
||||||
--extern strerror=build/o/libstrerror.rlib
|
--extern strerror=build/o/libstrerror.rlib
|
||||||
|
CFLAGS+=-I$(SYSEXITS)
|
||||||
|
|
||||||
.PHONY: all
|
.PHONY: all
|
||||||
all: dj false fop hru intcmp rpn scrut str strcmp true
|
all: dj false fop hru intcmp rpn scrut str strcmp true
|
||||||
@ -60,15 +64,12 @@ build/o/libstrerror.rlib: build src/strerror.rs
|
|||||||
$(RUSTC) $(RUSTFLAGS) --crate-type=lib -o $@ \
|
$(RUSTC) $(RUSTFLAGS) --crate-type=lib -o $@ \
|
||||||
src/strerror.rs
|
src/strerror.rs
|
||||||
|
|
||||||
build/o/libsysexits.rlib: build include/sysexits.h
|
build/o/libsysexits.rlib: build $(SYSEXITS)sysexits.h
|
||||||
# bandage solution until bindgen(1) gets stdin support
|
# bandage solution until bindgen(1) gets stdin support
|
||||||
printf '#define EXIT_FAILURE 1\n' | cat - include/sysexits.h \
|
printf '#define EXIT_FAILURE 1\n' | cat - $(SYSEXITS)sysexits.h \
|
||||||
> build/include/sysexits.h
|
> build/include/sysexits.h
|
||||||
bindgen --default-macro-constant-type signed --use-core --formatter=none \
|
bindgen --default-macro-constant-type signed --use-core --formatter=none \
|
||||||
"$$(printf '#include <sysexits.h>\n' \
|
build/include/sysexits.h | $(RUSTC) $(RUSTFLAGS) --crate-type lib -o $@ -
|
||||||
| cpp -M -idirafter "build/include" - \
|
|
||||||
| sed 's/ /\n/g' | grep sysexits.h)" \
|
|
||||||
| $(RUSTC) $(RUSTFLAGS) --crate-type lib -o $@ -
|
|
||||||
|
|
||||||
.PHONY: dj
|
.PHONY: dj
|
||||||
dj: build/bin/dj
|
dj: build/bin/dj
|
||||||
|
Loading…
Reference in New Issue
Block a user