comparison 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
comparison
equal deleted inserted replaced
3011:75e142c0004b 3012:100e618349f7
18 18
19 define $(PKG)_BUILD 19 define $(PKG)_BUILD
20 $(MAKE) -C '$(1)' -j '$(JOBS)' \ 20 $(MAKE) -C '$(1)' -j '$(JOBS)' \
21 CHAINS=mingw \ 21 CHAINS=mingw \
22 MINGW_PREFIX=$(TARGET) \ 22 MINGW_PREFIX=$(TARGET) \
23 OCAMLOPT=$(PREFIX)/$(TARGET)/bin/ocaml-native/ocamlopt \ 23 OCAMLOPT=$(HOST_PREFIX)/bin/ocaml-native/ocamlopt \
24 all 24 all
25 mkdir -p '$(PREFIX)/$(TARGET)/lib/ocaml/flexdll' 25 mkdir -p '$(HOST_PREFIX)/lib/ocaml/flexdll'
26 cd '$(1)' && mv flexlink.exe flexlink 26 cd '$(1)' && mv flexlink.exe flexlink
27 cd '$(1)' && strip --remove-section=.comment --remove-section=.note flexlink 27 cd '$(1)' && strip --remove-section=.comment --remove-section=.note flexlink
28 cd '$(1)' && $(INSTALL) -m 0755 flexdll.h '$(PREFIX)/$(TARGET)/include' 28 cd '$(1)' && $(INSTALL) -m 0755 flexdll.h '$(HOST_PREFIX)/include'
29 cd '$(1)' && $(INSTALL) -m 0755 flexlink flexdll_mingw.o \ 29 cd '$(1)' && $(INSTALL) -m 0755 flexlink flexdll_mingw.o \
30 flexdll_initer_mingw.o \ 30 flexdll_initer_mingw.o \
31 '$(PREFIX)/$(TARGET)/lib/ocaml/flexdll' 31 '$(HOST_PREFIX)/lib/ocaml/flexdll'
32 # create flexdll scripts 32 # create flexdll scripts
33 cd '$(PREFIX)/bin' && $(LN_SF) '$(PREFIX)/$(TARGET)/lib/ocaml/flexdll/flexlink' 33 cd '$(BUILD_TOOLS_PREFIX)/bin' && $(LN_SF) '$(HOST_PREFIX)/lib/ocaml/flexdll/flexlink'
34 (echo '#!/bin/sh'; \ 34 (echo '#!/bin/sh'; \
35 echo 'exec flexlink -I $(PREFIX)/$(TARGET)/lib -chain mingw -nocygpath "$$@"') \ 35 echo 'exec flexlink -I $(HOST_PREFIX)/lib -chain mingw -nocygpath "$$@"') \
36 > '$(PREFIX)/bin/$(TARGET)-flexlink' 36 > '$(BUILD_TOOLS_PREFIX)/bin/$(TARGET)-flexlink'
37 chmod 0755 '$(PREFIX)/bin/$(TARGET)-flexlink' 37 chmod 0755 '$(BUILD_TOOLS_PREFIX)/bin/$(TARGET)-flexlink'
38 38
39 echo "testing flexlink..." 39 echo "testing flexlink..."
40 $(MAKE) -C '$(1)/test' -j '$(JOBS)' dump.exe plug1.dll plug2.dll CC=$(TARGET)-gcc O=o FLEXLINK=$(TARGET)-flexlink 40 $(MAKE) -C '$(1)/test' -j '$(JOBS)' dump.exe plug1.dll plug2.dll CC=$(TARGET)-gcc O=o FLEXLINK=$(TARGET)-flexlink
41 #works if wine is installed : 41 #works if wine is installed :
42 #cd '$(1)/test' && ./dump.exe plug1.dll plug2.dll 42 #cd '$(1)/test' && ./dump.exe plug1.dll plug2.dll