58 lines
1.2 KiB
Makefile
58 lines
1.2 KiB
Makefile
# Copyright (c) 2024 Emma Tebibyte <emma@tebibyte.media>
|
|
# SPDX-License-Identifier: FSFAP
|
|
#
|
|
# Copying and distribution of this file, with or without modification, are
|
|
# permitted in any medium without royalty provided the copyright notice and this
|
|
# notice are preserved. This file is offered as-is, without any warranty.
|
|
|
|
.POSIX:
|
|
|
|
RUSTC ?= rustc
|
|
CC ?= cc
|
|
|
|
.PHONY: all
|
|
all: exercism fun
|
|
|
|
.PHONY: exercism
|
|
exercism: exercism-test protein
|
|
|
|
.PHONY: fun
|
|
fun: fun-test butt bingame-rs
|
|
|
|
.PHONY: build
|
|
build:
|
|
mkdir -p build
|
|
|
|
.PHONY: clean
|
|
clean:
|
|
rm -rf build
|
|
|
|
.PHONY: bingame-rs
|
|
bingame-rs: build/bingame
|
|
build/bingame: fun/bingame-rs/src/main.rs
|
|
cd fun/bingame-rs \
|
|
&& cargo b -Z unstable-options --artifact-dir ../../build/ \
|
|
&& cargo clean
|
|
|
|
.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:
|