This repository has been archived by the owner on Sep 10, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathdepend.mk
62 lines (56 loc) · 1.62 KB
/
depend.mk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# ------------------------------------------------------------------
# recalculate dependencies
# Main mkfile must set $DEPEND and $SCAN
# ocaml.mk sets PCHECK and it should be empty
# config.mk sets B and it should not be a relative path
# ------------------------------------------------------------------
consistency-check:VQ:
[ -z "$B" ] || [ -d $B ] || mkdir -p $B
DOTS=`echo $B | sed "s/[^.]//g"`
if $config_test -n "$DOTS"; then
echo
echo "Your B variable (B=$B) looks strange to me. I am quiting."
echo "Maybe you set B when you wanted to set BT?"
echo
exit 1
fi
if $config_test -n "$PCHECK"; then
echo
echo "Your P variable looks strange to me. I am quiting."
echo "P should be gprof, count, or nothing."
echo
exit 1
fi
A=`echo ${B}P=*`
if [ "$A" != "${B}P=$P" -a "$A" != "${B}P=*" ]
then
C=`basename $A`
echo
echo "The build directory $B is configured for $C not P=$P"
echo "You must run mk clobber followed by mk depend"
echo
exit 1
fi
dep-chk:VQ: consistency-check
if $config_test $DEPEND -nt mkfile; then true
else
echo
echo "You must run mk depend first"
echo
exit 1
fi
$DEPEND:DQ: consistency-check $SCAN mkfile
if [ -z "$B" ]; then
echo "$OCAMLDEP $DEPFLAGS $SCAN > $DEPEND"
$OCAMLDEP $DEPFLAGS $SCAN > $DEPEND
else
echo "$OCAMLDEP $DEPFLAGS -I $B $SCAN > $DEPEND"
(cd ..; $OCAMLDEP $DEPFLAGS -I $B $SCAN > $DEPEND)
fi
touch ${B}P=$P
dep-clobber:V:
rm -f ${B}P=* $DEPEND
# ------------------------------------------------------------------
# include dependencies
# ------------------------------------------------------------------
<$DEPEND