Created
February 22, 2014 00:31
-
-
Save jordwalke/9146647 to your computer and use it in GitHub Desktop.
ocamlbuild starter script.
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
#!/bin/sh | |
set -e | |
TARGET=driver | |
# Disabling duplicate record warning (30) and non-opened record field names (40) | |
FLAGS="-libs unix,nums -cflags -w,-30,-w,-40" | |
OCAMLBUILD=ocamlbuild | |
ocb() | |
{ | |
$OCAMLBUILD $FLAGS $* | |
} | |
rule() { | |
case $1 in | |
clean) ocb -clean;; | |
native) ocb $TARGET.native;; | |
byte) ocb $TARGET.byte;; | |
all) ocb $TARGET.native $TARGET.byte;; | |
depend) echo "Not needed.";; | |
*) echo "Unknown action $1";; | |
esac; | |
} | |
if [ $# -eq 0 ]; then | |
rule all | |
else | |
while [ $# -gt 0 ]; do | |
rule $1; | |
shift | |
done | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment