Skip to content

Instantly share code, notes, and snippets.

@tungd
Created February 19, 2013 09:51
Show Gist options
  • Save tungd/4984501 to your computer and use it in GitHub Desktop.
Save tungd/4984501 to your computer and use it in GitHub Desktop.
Makefile I used when learning Rust (following this tutorial: http://www.rustforrubyists.com/). Compile and run by `make [example name]/run` Compile and run as test by `make [example name]/test`
RM := rm -vf
TARGET := $(shell find . -type f -not -name "*.rs" -and -not -name "Makefile" -and -not -name ".git")
all:
@echo "Nothing to be done here"
%/run: %.rs
rustc $*.rs
./$*
%/test:
rustc --test -o $*-test $*.rs
./$*-test
clean: $(TARGET)
@$(RM) $(TARGET)
.PHONY: clean
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment