repo.or.cz
/
llpp.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
First stab at ocaml dependencies
[llpp.git]
/
doocaml
blob
548d06c06c40413bd17de97bdb10b0d70a6a29bc
1
#!/bin/sh
2
set -e
3
4
out
=
"$(basename "
$1
")"
5
dir
=
"$(dirname "
$1
")"
6
expr
"
$2
"
:
"/.*"
>/
dev
/
null
&&
src
=
"
$2
"
|| src
=
"
$PWD
/
$2
"
7
dep
=
"
$3
"
8
shift
3
9
10
fixdep
() {
11
sed
-e
"/.*\.cmx.*/d"
-e
"s,
${src%%.ml}
.cm[oxi],
$dir
/
$out
,"
12
}
13
14
dep
=
${dep#$dir/}
15
(
cd
$dir
&&
ocamlc
"$@"
-o
$out $src
&&
ocamldep
$src
| fixdep
>
$dep
)