comparison src/ocaml-native.mk @ 3012:100e618349f7

Improve handling of prefix directories by defining HOST_PREFIX and BUILD_TOOLS_PREFIX variables in top-level Makefile.
author John W. Eaton <jwe@octave.org>
date Sun, 02 Jun 2013 10:31:04 -0400
parents efb8519157c2
children b6c7244a2f66
comparison
equal deleted inserted replaced
3011:75e142c0004b 3012:100e618349f7
17 endef 17 endef
18 18
19 define $(PKG)_BUILD 19 define $(PKG)_BUILD
20 # patched ocaml source to get ocamlbuild use $(TARGET)-ocamlc, $(TARGET)-ocamlfind, ... 20 # patched ocaml source to get ocamlbuild use $(TARGET)-ocamlc, $(TARGET)-ocamlfind, ...
21 cd '$(1)' && ./configure \ 21 cd '$(1)' && ./configure \
22 -prefix '$(PREFIX)/$(TARGET)' \ 22 -prefix '$(HOST_PREFIX)' \
23 -bindir '$(PREFIX)/$(TARGET)/bin/ocaml-native' \ 23 -bindir '$(HOST_PREFIX)/bin/ocaml-native' \
24 -libdir '$(PREFIX)/$(TARGET)/lib/ocaml-native' \ 24 -libdir '$(HOST_PREFIX)/lib/ocaml-native' \
25 -no-tk \ 25 -no-tk \
26 -no-shared-libs \ 26 -no-shared-libs \
27 -verbose 27 -verbose
28 $(MAKE) -C '$(1)' -j 1 world opt 28 $(MAKE) -C '$(1)' -j 1 world opt
29 $(SED) -i "s,@target@,$(TARGET),g" $(1)/ocamlbuild/options.ml 29 $(SED) -i "s,@target@,$(TARGET),g" $(1)/ocamlbuild/options.ml
30 $(SED) -i "s,@target@,$(TARGET),g" $(1)/ocamlbuild/findlib.ml 30 $(SED) -i "s,@target@,$(TARGET),g" $(1)/ocamlbuild/findlib.ml
31 $(MAKE) -C '$(1)' -j '$(JOBS)' ocamlbuild.native 31 $(MAKE) -C '$(1)' -j '$(JOBS)' ocamlbuild.native
32 cp -f '$(1)/_build/ocamlbuild/ocamlbuild.native' $(PREFIX)/bin/$(TARGET)-ocamlbuild 32 cp -f '$(1)/_build/ocamlbuild/ocamlbuild.native' $(BUILD_TOOLS_PREFIX)/bin/$(TARGET)-ocamlbuild
33 $(MAKE) -C '$(1)' install 33 $(MAKE) -C '$(1)' install
34 # the following script requires ocamlbuild with option -ocamlfind to work 34 # the following script requires ocamlbuild with option -ocamlfind to work
35 #(echo '#!/bin/sh'; \ 35 #(echo '#!/bin/sh'; \
36 # echo 'exec $(PREFIX)/bin/ocamlbuild -use-ocamlfind -ocamlfind $(TARGET)-ocamlfind "$$@"') \ 36 # echo 'exec $(BUILD_TOOLS_PREFIX)/bin/ocamlbuild -use-ocamlfind -ocamlfind $(TARGET)-ocamlfind "$$@"') \
37 # > '$(PREFIX)/bin/$(TARGET)-ocamlbuild' 37 # > '$(BUILD_TOOLS_PREFIX)/bin/$(TARGET)-ocamlbuild'
38 #chmod 0755 '$(PREFIX)/bin/$(TARGET)-ocamlbuild' 38 #chmod 0755 '$(BUILD_TOOLS_PREFIX)/bin/$(TARGET)-ocamlbuild'
39 # test will be done once cross ocamlopt is built 39 # test will be done once cross ocamlopt is built
40 endef 40 endef