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
14 @# sed-fu: remove the "@" from "//@", and remove trailing "/*@*/".
15 @sed 's|^\(\s*//\)@|\1|;s|\s*/\*@\*/$$||' $< > $@
17 docs/%.html: .tmp/docs/%.rs
21 # The generated files are shipped only for the benefit of Windows users, who
22 # typically don't have the necessary tools for generating the workspace
24 workspace: $(WORKSPACEFILES)
26 workspace/src/%.rs: src/%.rs Makefile dup-unimpl.sed
29 @# sed-fu: remove lines starting with "//@", and replace those ending in "/*@*/" by "unimplemented!()".
30 @# Also coalesce multiple adjacent such lines to one.
31 @sed '/^\s*\/\/@/d;s|\(\s*\)\S.*/\*@\*/|\1unimplemented!()|' $< | sed -f dup-unimpl.sed > $@
33 workspace/src/main.rs:
34 # Don't touch this file
37 crates: $(WORKSPACEFILES)
39 @cd workspace && cargo build
40 @cd solutions && cargo build && cargo test