43 lines
650 B
Makefile
43 lines
650 B
Makefile
.POSIX:
|
|
|
|
RUSTC ?= rustc
|
|
CC ?= cc
|
|
|
|
.PHONY: all
|
|
all: exercism fun
|
|
|
|
.PHONY: exercism
|
|
exercism: exercism-test protein
|
|
|
|
fun: fun-test butt
|
|
|
|
.PHONY: build
|
|
build:
|
|
mkdir -p build
|
|
|
|
.PHONY: clean
|
|
clean:
|
|
rm -rf build
|
|
|
|
.PHONY: butt
|
|
butt: build/butt
|
|
build/butt: build fun/butt.rs
|
|
$(RUSTC) $(RUSTFLAGS) -o $@ fun/butt.rs
|
|
|
|
.PHONY: protein
|
|
protein: build/protein
|
|
build/protein: build exercism/protein.rs
|
|
$(RUSTC) $(RUSTFLAGS) -o $@ exercism/protein.rs
|
|
|
|
.PHONY: test
|
|
test: exercism-test fun-test
|
|
|
|
.PHONY: exercism-test
|
|
exercism-test: build /tmp/protein
|
|
/tmp/protein: exercism/protein.rs
|
|
$(RUSTC) --test -o $@ exercism/protein.rs
|
|
$@
|
|
|
|
.PHONY: fun-test
|
|
fun-test:
|