csci5607/assignment-1/Makefile

33 lines
635 B
Makefile
Raw Normal View History

2023-02-01 22:13:48 +00:00
.PHONY: all clean
2023-02-01 08:37:02 +00:00
2023-02-01 22:13:48 +00:00
DOCKER := docker
ZIP := zip
PANDOC := pandoc
2023-02-01 08:37:02 +00:00
2023-02-01 22:13:48 +00:00
HANDIN := hw1a.michael.zhang.zip
BINARY := assignment-1
WRITEUP := writeup.pdf
SOURCES := $(shell find -name "*.rs")
2023-02-01 08:37:02 +00:00
all: $(HANDIN)
2023-02-01 22:13:48 +00:00
$(BINARY): $(SOURCES)
$(DOCKER) run \
2023-02-01 08:37:02 +00:00
--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
2023-02-01 22:13:48 +00:00
mv target/release/assignment-1 $@
$(HANDIN): $(BINARY) $(WRITEUP) Cargo.toml Cargo.lock README.md
$(ZIP) -r $@ src $<
2023-02-01 08:37:02 +00:00
2023-02-01 22:13:48 +00:00
writeup.pdf: writeup.md
$(PANDOC) -o $@ $<
2023-02-01 08:37:02 +00:00
clean:
2023-02-01 22:13:48 +00:00
rm -f $(HANDIN) $(BINARY) $(WRITEUP)