Skip to content

Instantly share code, notes, and snippets.

@derwolfe
Last active August 29, 2015 13:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save derwolfe/8752809 to your computer and use it in GitHub Desktop.
Save derwolfe/8752809 to your computer and use it in GitHub Desktop.
makefile with test, build, clean etc. Not excellent make, but works.
# you should put all of the tests to be run for each of the
# files as they are being built
CC=rustc
BUILDDIR=~/Code/matasano/rust/build
DOCDIR=~/Code/matasano/rust/docs
CCFLAGS=--out-dir $(BUILDDIR)
DC=rustdoc --output $(DOCDIR)
all: score single_cipher decrypt_single fixed_xor encode64
decrypt_single:
$(CC) src/decrypt_single_cipher.rs $(CCFLAGS) -L $(BUILDDIR)
score:
$(CC) src/score.rs $(CCFLAGS)
single_cipher: score
$(CC) src/single_cipher.rs $(CCFLAGS) -L $(BUILDDIR)
cycle_cipher: score single_cipher
$(CC) src/cycle_cipher.rs $(CCFLAGS) -L $(BUILDDIR)
encode64:
$(CC) src/encode64.rs $(CCFLAGS)
fixed_xor:
$(CC) src/fixed_xor.rs $(CCFLAGS)
test: all
$(CC) src/score.rs --test $(CCFLAGS)
$(CC) src/single_cipher.rs --test -L $(BUILDDIR) $(CCFLAGS)
$(CC) src/fixed_xor.rs --test $(CCFLAGS)
$(CC) src/encode64.rs --test $(CCFLAGS)
$(BUILDDIR)/score
$(BUILDDIR)/single_cipher
$(BUILDDIR)/fixed_xor
$(BUILDDIR)/encode64
docs: all test
# build all of the docs for each module
$(DC) src/score.rs
$(DC) src/single_cipher.rs -L $(BUILDDIR)
$(DC) src/encode64.rs
$(DC) src/fixed_xor.rs
cleandocs:
\rm -rf $(DOCDIR)/*
cleanobs:
\rm -rf $(BUILDDIR)/*
clean: cleanobs cleandocs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment