Last active
August 29, 2015 14:19
-
-
Save keleshev/a4982b234b0aa62d2f70 to your computer and use it in GitHub Desktop.
This file contains 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
task :default => :test | |
PACKAGES = ['core', 'sexplib.syntax'] | |
MENHIR = 'menhir --explain' | |
TEST_SOURCES = FileList['**/test_*.ml'].exclude(/build\//) | |
TEST_BINARIES = TEST_SOURCES.pathmap 'build/%X.d.byte' | |
task :test do |t| | |
ocamlbuild TEST_BINARIES | |
TEST_BINARIES.each do |binary| | |
sh binary | |
end | |
end | |
task :clean do | |
sh 'rm -rf *build *.byte *.native' | |
end | |
# Build any `ocamlbuild` target, for example: | |
# $ rake build/test_foo.d.byte | |
# $ rake build/foo/test_bar.native | |
rule(/^build\//) do |task| | |
ocamlbuild task.name.sub(/^build\//, '') | |
end | |
def ocamlbuild targets | |
targets = targets.map {|target| target.sub /^build\//, ''}.join ' ' | |
sh "ocamlbuild -build-dir build -syntax camlp4o -cflags '-w @a-6-4-27-44' \ | |
-tag thread -use-ocamlfind -quiet \ | |
-use-menhir -menhir '#{MENHIR}' \ | |
-pkg #{PACKAGES.join ','} \ | |
#{targets}" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment