1 FILES=$(wildcard src/*.rs)
2 DOCFILES=$(addsuffix .html,$(addprefix docs/,$(notdir $(basename $(FILES)))))
3 WORKSPACEFILES=$(addprefix workspace/,$(FILES))
5 all: docs workspace crates
6 .PHONY: docs workspace crates
11 .tmp/docs/%.rs: src/%.rs Makefile dup-unimpl.sed
14 @# sed-fu: remove the "@" from "//@", and remove trailing "/*@*/", replace lines ending in "/*@@*/" by "unimplemented!()".
15 @# Also coalesce multiple adjacent such lines to one.
16 @sed 's|^\(\s*//\)@|\1|;s|\s*/\*@\*/$$||;s|\(\s*\)\S.*/\*@@\*/|\1unimplemented!()|' $< | sed -f dup-unimpl.sed > $@
18 docs/%.html: pycco-rs .tmp/docs/%.rs
22 # The generated files are shipped only for the benefit of Windows users, who
23 # typically don't have the necessary tools for generating the workspace
25 workspace: $(WORKSPACEFILES)
27 workspace/src/%.rs: src/%.rs Makefile dup-unimpl.sed
30 @# sed-fu: remove lines starting with "//@", and replace those ending in "/*@*/" by "unimplemented!()".
31 @# Also coalesce multiple adjacent such lines to one.
32 @sed '/^\s*\/\/@/d;s|\(\s*\)\S.*/\*@@\?\*/|\1unimplemented!()|' $< | sed -f dup-unimpl.sed > $@
34 workspace/src/main.rs:
35 # Don't touch this file
38 crates: $(WORKSPACEFILES)
40 @cd workspace && cargo build
41 @cd solutions && cargo build && cargo test