1
0
exercises/Makefile

58 lines
1.2 KiB
Makefile
Raw Normal View History

2024-07-03 16:35:49 -06:00
# 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.
2024-07-03 16:29:11 -06:00
.POSIX:
RUSTC ?= rustc
CC ?= cc
.PHONY: all
all: exercism fun
.PHONY: exercism
exercism: exercism-test protein
.PHONY: fun
fun: fun-test butt bingame-rs
2024-07-03 16:29:11 -06:00
.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
2024-07-03 16:29:11 -06:00
.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: