Created
February 19, 2013 09:51
-
-
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`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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