Created
April 15, 2014 08:05
-
-
Save jordwalke/10712353 to your computer and use it in GitHub Desktop.
General OCaml Build
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 | |
# Just make sure there's a file called fileName.ml in the same directory | |
TARGET=fileName | |
# 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