GNUmakefile, fop(1): added sysexits support
This commit is contained in:
16
GNUmakefile
16
GNUmakefile
@@ -20,8 +20,9 @@ CC=cc
|
||||
CFLAGS=-O3 -Lbuild/lib -idirafter include
|
||||
|
||||
RUSTC=rustc +nightly
|
||||
RUSTCFLAGS=-Zlocation-detail=none -Copt-level=z -Ccodegen-units=1 -Cpanic=abort
|
||||
-Clto=y -Cstrip=symbols -Ctarget-cpu=native
|
||||
RUSTCFLAGS=-Zlocation-detail=none -Copt-level=z -Ccodegen-units=1 \
|
||||
-Cpanic=abort -Clto=y -Cstrip=symbols -Ctarget-cpu=native \
|
||||
--extern sysexits=build/o/libsysexits.rlib
|
||||
|
||||
ifeq ($(CC), gcc)
|
||||
CFLAGS=-O3 -s -Wl,-z,noseparate-code,-z,nosectionheader -flto -Lbuild/lib \
|
||||
@@ -39,7 +40,7 @@ endif
|
||||
build: build_dir false intcmp scrut str strcmp true
|
||||
|
||||
build_dir:
|
||||
mkdir -p build/o build/lib build/bin
|
||||
mkdir -p build/bin build/lib build/o
|
||||
|
||||
clean:
|
||||
rm -rf build/
|
||||
@@ -56,10 +57,16 @@ test: build
|
||||
tests/cc-compat.sh
|
||||
tests/posix-compat.sh
|
||||
|
||||
sysexits: build_dir
|
||||
bindgen --default-macro-constant-type signed \
|
||||
"$$(printf '#include <sysexits.h>\n' | cpp -M -idirafter include - \
|
||||
| sed 's/ /\n/g' | grep sysexits.h)" \
|
||||
| $(RUSTC) $(RUSTCFLAGS) --crate-type lib -o build/o/libsysexits.rlib -
|
||||
|
||||
false: src/false.rs build_dir
|
||||
$(RUSTC) $(RUSTCFLAGS) -o build/bin/false src/false.rs
|
||||
|
||||
fop: src/fop.rs build_dir
|
||||
fop: src/fop.rs build_dir sysexits
|
||||
$(RUSTC) $(RUSTCFLAGS) -o build/bin/fop src/fop.rs
|
||||
|
||||
intcmp: src/intcmp.c build_dir
|
||||
@@ -76,4 +83,3 @@ strcmp: src/strcmp.c build_dir
|
||||
|
||||
true: src/true.rs build_dir
|
||||
$(RUSTC) $(RUSTCFLAGS) -o build/bin/true src/true.rs
|
||||
|
||||
|
||||
Reference in New Issue
Block a user