3
# This file is part of our reusable OCaml BRICKS library
4
# Copyright (C) 2009 Jean-Vincent Loddo
6
# This program is free software: you can redistribute it and/or modify
7
# it under the terms of the GNU General Public License as published by
8
# the Free Software Foundation, either version 2 of the License, or
9
# (at your option) any later version.
11
# This program is distributed in the hope that it will be useful,
12
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
# GNU General Public License for more details.
16
# You should have received a copy of the GNU General Public License
17
# along with this program. If not, see <http://www.gnu.org/licenses/>.
20
# ocamlmklib_wrapper $(OTHER_LIBRARY_FILES_TO_INSTALL)"
24
# Check script dependencies
30
echo 'Usage (in a Makefile):'
31
echo '$(basename $0) $(C_OBJECTS_TO_LINK)'
35
OBJECTS=$(for i in "$@"; do echo $i.o; done)
36
INCLUDES=$(cd _build ; find -type d -printf "-I %p\n")
37
CMO=$(ocamlobjinfo _build/ocamlbricks.cma | awk '/Unit name/{x=tolower(substr($3,1,1)); r=substr($3,2); printf("%s%s.cmo\n",x,r);}')
38
CMX=$(ocamlobjinfo _build/ocamlbricks.cma | awk '/Unit name/{x=tolower(substr($3,1,1)); r=substr($3,2); printf("%s%s.cmx\n",x,r);}')
41
echo "Rebuilding library with ocamlmklib..."
43
ocamlmklib -custom -o ocamlbricks $OBJECTS $INCLUDES $CMO
44
ocamlmklib -custom -o ocamlbricks $OBJECTS $INCLUDES $CMX
46
ls -l ocamlbricks.cm{,x}a