merged forgotten changeset, necessary to build Makefile based targets in Beremiz
authorEdouard Tisserant 7BB06627 <edouard.tisserant@gmail.com>
Sun, 15 Jan 2017 22:22:32 +0100
changeset 18 efd809f369c6
parent 17 97a78502b383 (diff)
parent 8 b7e0285edfa8 (current diff)
child 19 4cd3af22787e
merged forgotten changeset, necessary to build Makefile based targets in Beremiz
Makefile
--- a/.hgignore	Sat Mar 29 16:14:18 2014 +0100
+++ b/.hgignore	Sun Jan 15 22:22:32 2017 +0100
@@ -1,3 +1,3 @@
 .*~
 .*\.swp
-distfiles/.*[.](?!md5$).*$
+distfiles/.*[.](?!.*md5$).*$
--- a/Makefile	Sat Mar 29 16:14:18 2014 +0100
+++ b/Makefile	Sun Jan 15 22:22:32 2017 +0100
@@ -2,7 +2,7 @@
 
 # This is Makefile for Beremiz installer
 #
-# Invoke with "make -f path/to/Makefile" on a linux box 
+# Invoke with "make -f path/to/Makefile" on a linux box
 # in directory where build should happen.
 #
 # All those dependencies have to be installed :
@@ -21,18 +21,11 @@
 #  - xsltproc
 #  - python-lxml
 #
-#  Linux RootFS and packages
-#  - reprepro 
-#  - multistrap
-#  - germinate
-#  - user-mode-linux
-#  - ddpt
-#
 # WARNING : DISPLAY variable have to be defined to a valid X server
 #           in case it would be a problem, run :
 #           xvfb-run make -f /path/to/this/Makefile
 
-version = 1.1
+version = 1.2-rc1
 
 HGROOT := ~/src
 GITROOT := $(HGROOT)
@@ -41,6 +34,17 @@
 CPUS = 8
 BLKDEV=/dev/null
 
+
+CROSS_COMPILE=i686-w64-mingw32
+CROSS_COMPILE_LIBS_DIR=/usr/lib/gcc/$(CROSS_COMPILE)/6.1-win32
+CC=$(CROSS_COMPILE)-gcc
+CXX=$(CROSS_COMPILE)-g++
+
+define get_runtime_libs
+	cp $(CROSS_COMPILE_LIBS_DIR)/libgcc_s_sjlj-1.dll $(1)
+	cp $(CROSS_COMPILE_LIBS_DIR)/libstdc++-6.dll $(1)
+endef
+
 src := $(shell dirname $(lastword $(MAKEFILE_LIST)))
 distfiles = $(src)/distfiles
 sfmirror = downloads
@@ -58,6 +62,10 @@
 endef
 endif
 
+define hg_get_rev_num
+hg -R $(HGROOT)/`basename $(1)` id -i | sed 's/\+//' > $(2)
+endef
+
 define get_src_hg
 rm -rf $(1)
 $(call hg_get_archive, $(1), $(2))
@@ -112,9 +120,9 @@
 	# windows.h
 	$(call get_mingw,w32api/w32api-3.17,w32api-3.17-2-mingw32-dev.tar.lzma)
 	# mingw runtime
-	$(call get_mingw,mingw-rt/mingwrt-3.20,mingwrt-3.20-2-mingw32-dll.tar.lzma)
+	$(call get_mingw,mingwrt/mingwrt-3.20,mingwrt-3.20-2-mingw32-dll.tar.lzma)
 	# mingw headers and lib
-	$(call get_mingw,mingw-rt/mingwrt-3.20,mingwrt-3.20-2-mingw32-dev.tar.lzma)
+	$(call get_mingw,mingwrt/mingwrt-3.20,mingwrt-3.20-2-mingw32-dev.tar.lzma)
 	# binutils
 	$(call get_mingw,binutils/binutils-2.21.53,binutils-2.21.53-1-mingw32-bin.tar.lzma)
 	# C compiler
@@ -138,7 +146,7 @@
 	$(call get_msys,msys-core/msys-1.0.13-2,msysCORE-1.0.13-2-msys-1.0.13-bin.tar.lzma)
 	$(call get_msys,termcap/termcap-0.20050421_1-2,libtermcap-0.20050421_1-2-msys-1.0.13-dll-0.tar.lzma)
 	touch $@
-	
+
 msiexec = WINEPREFIX=$(tmp) msiexec
 wine = WINEPREFIX=$(tmp) wine
 pydir = build/python
@@ -175,9 +183,9 @@
 	unzip -d $(tmp)/pw32 $$dld ; [ $$? -eq 1 ] #silence error unziping .exe
 	cp -R $(tmp)/pw32/PLATLIB/* $(pysite)
 	
-	# zope.interface 
-	$(call get_src_pypi,/2.7/z/zope.interface,zope.interface-3.8.0-py2.7-win32.egg)\
-	unzip -d $(tmp) $$dld 
+	# zope.interface
+	$(call get_src_pypi,9d/2d/beb32519c0bd19bda4ac38c34db417d563ee698518e582f951d0b9e5898b,zope.interface-4.3.2-py2.7-win32.egg)\
+	unzip -d $(tmp) $$dld
 	cp -R $(tmp)/zope $(pysite)
 	
 	# Twisted
@@ -200,9 +208,10 @@
 	cp -R $(tmp)/simplejson-2.2.1/simplejson/ $(pysite)
 	
 	# WxGlade
-	$(call get_src_http,https://bitbucket.org/agriggio/wxglade/get,b0247325407e.zip)\
-	unzip -d $(tmp) $$dld 
-	mv $(tmp)/agriggio-wxglade-b0247325407e $(pysite)/wxglade
+
+	$(call get_src_http,https://bitbucket.org/wxglade/wxglade/get,034d891cc947.zip)\
+	unzip -d $(tmp) $$dld
+	mv $(tmp)/wxglade-wxglade-034d891cc947 $(pysite)/wxglade
 	
 	# Pyro
 	$(call get_src_pypi,source/P/Pyro,Pyro-3.9.1.tar.gz)\
@@ -221,11 +230,16 @@
 	$(call get_src_hg,$(tmp)/matiec)
 	cd $(tmp)/matiec ;\
 	autoreconf;\
-	./configure --host=i586-mingw32msvc;\
+	automake --add-missing;\
+	./configure --host=$(CROSS_COMPILE);\
 	make -j$(CPUS);
 	rm -rf $(matiecdir)
 	mkdir -p $(matiecdir)
 	mv $(tmp)/matiec/*.exe $(matiecdir)
+
+	# install necessary shared libraries from local cross-compiler
+	$(call get_runtime_libs,$(matiecdir))
+
 	mv $(tmp)/matiec/lib $(matiecdir)
 	touch $@
 
@@ -233,8 +247,9 @@
 	rm -rf  examples
 	mkdir -p examples
 
-beremiz: | build examples 
+beremiz: | build examples
 	$(call get_src_hg,build/beremiz)
+	$(call hg_get_rev_num,beremiz,build/beremiz/revision)
 	$(call tweak_beremiz_targets)
 	rm -rf examples/canopen_tests
 	mkdir -p examples/canopen_tests
@@ -244,14 +259,6 @@
 	mv build/beremiz/tests/* examples/base_tests
 	touch $@
 
-beremiz_etherlab_plugin: beremiz | examples
-	$(call get_src_hg,$(tmp)/beremiz_etherlab_plugin)
-	rm -rf examples/ethercat_tests
-	mv $(tmp)/beremiz_etherlab_plugin/ethercat_tests examples/
-	rm -rf build/EthercatMaster
-	mv $(tmp)/beremiz_etherlab_plugin/etherlab build/EthercatMaster
-	touch $@
-
 CFbuild = build/CanFestival-3
 CFconfig = $(CFbuild)/objdictgen/canfestival_config.py
 canfestival: mingw
@@ -259,8 +266,8 @@
 	$(call get_src_hg,$(CFbuild))
 	cd $(CFbuild); \
 	./configure --can=tcp_win32 \
-				--cc=i586-mingw32msvc-gcc \
-				--cxx=i586-mingw32msvc-g++ \
+				--cc=$(CC) \
+				--cxx=$(CXX) \
 				--target=win32 \
 				--wx=0
 	$(MAKE) -C $(CFbuild)
@@ -271,9 +278,9 @@
 Beremiz-$(version).exe: $(targets) $(src)/license.txt $(src)/install.nsi $(targets_ex)
 	sed -e 's/\$$BVERSION/$(version)/g' $(src)/license.txt > build/license.txt
 	sed -e 's/\$$BVERSION/$(version)/g' $(src)/install.nsi |\
-    sed -e 's/\$$BEXTENSIONS/$(extensions)/g' |\
-    makensis - 
-	
+	sed -e 's/\$$BEXTENSIONS/$(extensions)/g' |\
+        makensis -
+
 clean_installer:
 	rm -rf build Beremiz-$(version).exe $(targets) $(targets_ex)
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/distfiles/034d891cc947.zip.md5	Sun Jan 15 22:22:32 2017 +0100
@@ -0,0 +1,1 @@
+46fac34fd7a93b46aafb08fd37590aa8  034d891cc947.zip
--- a/distfiles/b0247325407e.zip.md5	Sat Mar 29 16:14:18 2014 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-084d852dd93f71ba32f83aecd47ef18e  b0247325407e.zip
--- a/distfiles/zope.interface-3.8.0-py2.7-win32.egg.md5	Sat Mar 29 16:14:18 2014 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-5c985df0467e8727e8c8675abd0621c0  zope.interface-3.8.0-py2.7-win32.egg
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/distfiles/zope.interface-4.3.2-py2.7-win32.egg.md5	Sun Jan 15 22:22:32 2017 +0100
@@ -0,0 +1,1 @@
+f011c5fbd4c2e0f21df80afb52c833c3 zope.interface-4.3.2-py2.7-win32.egg