/
ocamli.sh
executable file
·51 lines (39 loc) · 984 Bytes
/
ocamli.sh
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
#!/usr/bin/env bash
# Ce script a pour but d'automatiser la création de fichier .mli
#ocamlc -i $* > /tmp/tmpgedit.mli && gedit /tmp/tmpgedit.mli
destination="/tmp/tmpgedit.mli"
if [ "$*" = "" ]
then
exit 1
fi
for fileml in $*
do
if [ ! -f "$fileml" ]
then
echo -e "$fileml : notfound"
exit 1
fi
done
echo "(*"
echo " * Ce fichier .mli a ete genere automatiquement par '.ocamli.sh'"
echo " * A partir des fichiers .ml suivants : $*"
echo " *)"
echo "(*" > $destination
echo " * Ce fichier .mli a ete genere automatiquement par '.ocamli.sh'" >> $destination
echo " * A partir des fichiers .ml suivants : $*" >> $destination
echo " *)" >> $destination
for fileml in $*
do
echo "(* *)"
echo "(* Signature du fichier '$fileml' *)"
echo "(* *)"
ocamlc -i "$fileml"
echo "(* *)" >> $destination
echo "(* Signature du fichier '$fileml' *)" >> $destination
echo "(* *)" >> $destination
ocamlc -i "$fileml" >> $destination
done
#gedit $destination &
#
#
# FIN