forked from bonsai/harakit
Makefile: removed configure and made library builds better
This commit is contained in:
10
Makefile
10
Makefile
@@ -15,9 +15,6 @@ PREFIX=/usr/local
|
||||
CC=cc
|
||||
RUSTC=rustc
|
||||
|
||||
# to build, first run ./configure
|
||||
include cc.mk rustc.mk
|
||||
|
||||
.PHONY: all
|
||||
all: dj false fop intcmp scrut str strcmp true
|
||||
|
||||
@@ -46,7 +43,7 @@ test: build
|
||||
tests/posix-compat.sh
|
||||
$(RUSTC) --test src/getopt-rs/lib.rs -o build/test/getopt
|
||||
|
||||
sysexits: build
|
||||
build/o/libsysexits.rlib: build
|
||||
# bandage solution until bindgen(1) gets stdin support
|
||||
printf '#define EXIT_FAILURE 1\n' | cat - include/sysexits.h \
|
||||
> build/include/sysexits.h
|
||||
@@ -56,7 +53,7 @@ sysexits: build
|
||||
| sed 's/ /\n/g' | grep sysexits.h)" \
|
||||
| $(RUSTC) $(RUSTCFLAGS) --crate-type lib -o build/o/libsysexits.rlib -
|
||||
|
||||
libgetopt: src/getopt-rs/lib.rs
|
||||
build/o/libgetopt.rlib: src/getopt-rs/lib.rs
|
||||
$(RUSTC) $(RUSTCFLAGS) --crate-type=lib --crate-name=getopt \
|
||||
-o build/o/libgetopt.rlib src/getopt-rs/lib.rs
|
||||
|
||||
@@ -72,8 +69,9 @@ build/bin/false: src/false.c build
|
||||
|
||||
.PHONY: fop
|
||||
fop: build/bin/fop
|
||||
build/bin/fop: src/fop.rs build libgetopt sysexits
|
||||
build/bin/fop: src/fop.rs build build/o/libgetopt.rlib build/o/libsysexits.rlib
|
||||
$(RUSTC) $(RUSTFLAGS) --extern getopt=build/o/libgetopt.rlib \
|
||||
--extern sysexits=build/o/libsysexits.rlib \
|
||||
-o $@ src/fop.rs
|
||||
|
||||
.PHONY: intcmp
|
||||
|
||||
Reference in New Issue
Block a user