32 lines
635 B
Makefile
32 lines
635 B
Makefile
.PHONY: all clean
|
|
|
|
DOCKER := docker
|
|
ZIP := zip
|
|
PANDOC := pandoc
|
|
|
|
HANDIN := hw1a.michael.zhang.zip
|
|
BINARY := assignment-1
|
|
WRITEUP := writeup.pdf
|
|
SOURCES := $(shell find -name "*.rs")
|
|
|
|
all: $(HANDIN)
|
|
|
|
$(BINARY): $(SOURCES)
|
|
$(DOCKER) run \
|
|
--rm \
|
|
-v "$(shell pwd)":/usr/src/myapp \
|
|
-v cargo-registry:/usr/local/cargo \
|
|
--user "$(shell id -u)":"$(shell id -g)" \
|
|
-w /usr/src/myapp \
|
|
rust \
|
|
cargo build --release
|
|
mv target/release/assignment-1 $@
|
|
|
|
$(HANDIN): $(BINARY) $(WRITEUP) Cargo.toml Cargo.lock README.md
|
|
$(ZIP) -r $@ src $<
|
|
|
|
writeup.pdf: writeup.md
|
|
$(PANDOC) -o $@ $<
|
|
|
|
clean:
|
|
rm -f $(HANDIN) $(BINARY) $(WRITEUP)
|