annotate src/ocaml-flexdll.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 dabfd7db980c
children b6c7244a2f66
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2835
72427f641846 add package ocaml-flexdll
William <r.3@libertysurf.fr>
parents:
diff changeset
1 # This file is part of mingw-cross-env.
72427f641846 add package ocaml-flexdll
William <r.3@libertysurf.fr>
parents:
diff changeset
2 # See doc/index.html for further information.
72427f641846 add package ocaml-flexdll
William <r.3@libertysurf.fr>
parents:
diff changeset
3
72427f641846 add package ocaml-flexdll
William <r.3@libertysurf.fr>
parents:
diff changeset
4 # zlib
72427f641846 add package ocaml-flexdll
William <r.3@libertysurf.fr>
parents:
diff changeset
5 PKG := ocaml-flexdll
72427f641846 add package ocaml-flexdll
William <r.3@libertysurf.fr>
parents:
diff changeset
6 $(PKG)_IGNORE :=
72427f641846 add package ocaml-flexdll
William <r.3@libertysurf.fr>
parents:
diff changeset
7 $(PKG)_CHECKSUM := 585f066f890c7dca95be7541b4647128335f7df9
72427f641846 add package ocaml-flexdll
William <r.3@libertysurf.fr>
parents:
diff changeset
8 $(PKG)_SUBDIR := flexdll
72427f641846 add package ocaml-flexdll
William <r.3@libertysurf.fr>
parents:
diff changeset
9 $(PKG)_FILE := flexdll-$($(PKG)_VERSION).tar.gz
72427f641846 add package ocaml-flexdll
William <r.3@libertysurf.fr>
parents:
diff changeset
10 $(PKG)_URL := http://alain.frisch.fr/flexdll/$($(PKG)_FILE)
72427f641846 add package ocaml-flexdll
William <r.3@libertysurf.fr>
parents:
diff changeset
11 $(PKG)_DEPS := gcc ocaml-native
72427f641846 add package ocaml-flexdll
William <r.3@libertysurf.fr>
parents:
diff changeset
12
72427f641846 add package ocaml-flexdll
William <r.3@libertysurf.fr>
parents:
diff changeset
13 define $(PKG)_UPDATE
72427f641846 add package ocaml-flexdll
William <r.3@libertysurf.fr>
parents:
diff changeset
14 wget -q -O- 'http://alain.frisch.fr/flexdll/' | \
72427f641846 add package ocaml-flexdll
William <r.3@libertysurf.fr>
parents:
diff changeset
15 $(SED) -n 's,.*flexdll-\([0-9][^>]*\)\.tar.gz.*,\1,ip' | \
72427f641846 add package ocaml-flexdll
William <r.3@libertysurf.fr>
parents:
diff changeset
16 head -1
72427f641846 add package ocaml-flexdll
William <r.3@libertysurf.fr>
parents:
diff changeset
17 endef
72427f641846 add package ocaml-flexdll
William <r.3@libertysurf.fr>
parents:
diff changeset
18
72427f641846 add package ocaml-flexdll
William <r.3@libertysurf.fr>
parents:
diff changeset
19 define $(PKG)_BUILD
72427f641846 add package ocaml-flexdll
William <r.3@libertysurf.fr>
parents:
diff changeset
20 $(MAKE) -C '$(1)' -j '$(JOBS)' \
72427f641846 add package ocaml-flexdll
William <r.3@libertysurf.fr>
parents:
diff changeset
21 CHAINS=mingw \
72427f641846 add package ocaml-flexdll
William <r.3@libertysurf.fr>
parents:
diff changeset
22 MINGW_PREFIX=$(TARGET) \
3012
100e618349f7 Improve handling of prefix directories by defining HOST_PREFIX and
John W. Eaton <jwe@octave.org>
parents: 3006
diff changeset
23 OCAMLOPT=$(HOST_PREFIX)/bin/ocaml-native/ocamlopt \
2835
72427f641846 add package ocaml-flexdll
William <r.3@libertysurf.fr>
parents:
diff changeset
24 all
3012
100e618349f7 Improve handling of prefix directories by defining HOST_PREFIX and
John W. Eaton <jwe@octave.org>
parents: 3006
diff changeset
25 mkdir -p '$(HOST_PREFIX)/lib/ocaml/flexdll'
2835
72427f641846 add package ocaml-flexdll
William <r.3@libertysurf.fr>
parents:
diff changeset
26 cd '$(1)' && mv flexlink.exe flexlink
72427f641846 add package ocaml-flexdll
William <r.3@libertysurf.fr>
parents:
diff changeset
27 cd '$(1)' && strip --remove-section=.comment --remove-section=.note flexlink
3012
100e618349f7 Improve handling of prefix directories by defining HOST_PREFIX and
John W. Eaton <jwe@octave.org>
parents: 3006
diff changeset
28 cd '$(1)' && $(INSTALL) -m 0755 flexdll.h '$(HOST_PREFIX)/include'
2835
72427f641846 add package ocaml-flexdll
William <r.3@libertysurf.fr>
parents:
diff changeset
29 cd '$(1)' && $(INSTALL) -m 0755 flexlink flexdll_mingw.o \
72427f641846 add package ocaml-flexdll
William <r.3@libertysurf.fr>
parents:
diff changeset
30 flexdll_initer_mingw.o \
3012
100e618349f7 Improve handling of prefix directories by defining HOST_PREFIX and
John W. Eaton <jwe@octave.org>
parents: 3006
diff changeset
31 '$(HOST_PREFIX)/lib/ocaml/flexdll'
2835
72427f641846 add package ocaml-flexdll
William <r.3@libertysurf.fr>
parents:
diff changeset
32 # create flexdll scripts
3012
100e618349f7 Improve handling of prefix directories by defining HOST_PREFIX and
John W. Eaton <jwe@octave.org>
parents: 3006
diff changeset
33 cd '$(BUILD_TOOLS_PREFIX)/bin' && $(LN_SF) '$(HOST_PREFIX)/lib/ocaml/flexdll/flexlink'
2835
72427f641846 add package ocaml-flexdll
William <r.3@libertysurf.fr>
parents:
diff changeset
34 (echo '#!/bin/sh'; \
3012
100e618349f7 Improve handling of prefix directories by defining HOST_PREFIX and
John W. Eaton <jwe@octave.org>
parents: 3006
diff changeset
35 echo 'exec flexlink -I $(HOST_PREFIX)/lib -chain mingw -nocygpath "$$@"') \
100e618349f7 Improve handling of prefix directories by defining HOST_PREFIX and
John W. Eaton <jwe@octave.org>
parents: 3006
diff changeset
36 > '$(BUILD_TOOLS_PREFIX)/bin/$(TARGET)-flexlink'
100e618349f7 Improve handling of prefix directories by defining HOST_PREFIX and
John W. Eaton <jwe@octave.org>
parents: 3006
diff changeset
37 chmod 0755 '$(BUILD_TOOLS_PREFIX)/bin/$(TARGET)-flexlink'
2835
72427f641846 add package ocaml-flexdll
William <r.3@libertysurf.fr>
parents:
diff changeset
38
72427f641846 add package ocaml-flexdll
William <r.3@libertysurf.fr>
parents:
diff changeset
39 echo "testing flexlink..."
72427f641846 add package ocaml-flexdll
William <r.3@libertysurf.fr>
parents:
diff changeset
40 $(MAKE) -C '$(1)/test' -j '$(JOBS)' dump.exe plug1.dll plug2.dll CC=$(TARGET)-gcc O=o FLEXLINK=$(TARGET)-flexlink
72427f641846 add package ocaml-flexdll
William <r.3@libertysurf.fr>
parents:
diff changeset
41 #works if wine is installed :
72427f641846 add package ocaml-flexdll
William <r.3@libertysurf.fr>
parents:
diff changeset
42 #cd '$(1)/test' && ./dump.exe plug1.dll plug2.dll
72427f641846 add package ocaml-flexdll
William <r.3@libertysurf.fr>
parents:
diff changeset
43 endef