Makefile
changeset 34 0a8caba627ac
parent 30 1def008491ba
child 36 ad68e85dc416
equal deleted inserted replaced
33:12390414aed0 34:0a8caba627ac
   136 msiexec = WINEPREFIX=$(tmp) msiexec
   136 msiexec = WINEPREFIX=$(tmp) msiexec
   137 wine = WINEPREFIX=$(tmp) wine
   137 wine = WINEPREFIX=$(tmp) wine
   138 pydir = build/python
   138 pydir = build/python
   139 pysite = $(pydir)/Lib/site-packages
   139 pysite = $(pydir)/Lib/site-packages
   140 
   140 
   141 OSSLVER=openssl-1.0.1p
       
   142 M2CRVER=M2Crypto-0.22.6rc2
       
   143 MINGPFX=i686-w64-mingw32-
       
   144 
       
   145 python: |build
   141 python: |build
   146 	rm -rf $(pydir)
   142 	rm -rf $(pydir)
   147 	mkdir -p $(pydir)
   143 	mkdir -p $(pydir)
   148 	
   144 	
   149 	# Python
   145 	# Python
   293 	# Lxml
   289 	# Lxml
   294 	$(call get_src_pypi,c7/e6/26a600d9828554ca9de35d3d1daf3779028bea37025f3dd25e9d58d63bac,lxml-4.1.1-cp27-cp27m-win32.whl)\
   290 	$(call get_src_pypi,c7/e6/26a600d9828554ca9de35d3d1daf3779028bea37025f3dd25e9d58d63bac,lxml-4.1.1-cp27-cp27m-win32.whl)\
   295 	unzip -d $(tmp) $$dld
   291 	unzip -d $(tmp) $$dld
   296 	cp -R $(tmp)/lxml/* $(pysite)
   292 	cp -R $(tmp)/lxml/* $(pysite)
   297 	
   293 	
       
   294 	touch $@
       
   295 
       
   296 	
       
   297 OSSLVER=openssl-1.0.1p
       
   298 MINGPFX=i686-w64-mingw32-
       
   299 
       
   300 openssl:
   298 	# Build Openssl
   301 	# Build Openssl
   299 	$(call get_src_http,https://openssl.org/source,$(OSSLVER).tar.gz)\
   302 	$(call get_src_http,https://openssl.org/source,$(OSSLVER).tar.gz)\
   300 	tar -C $(tmp) -xzf $$dld
   303 	tar -C $(tmp) -xzf $$dld
   301 	cd $(tmp)/$(OSSLVER); \
   304 	cd $(tmp)/$(OSSLVER); \
   302 	CC=$(MINGPFX)gcc ./Configure mingw && \
   305 	CC=$(MINGPFX)gcc ./Configure mingw && \
   303 	make all build-shared CROSS_COMPILE=$(MINGPFX) SHARED_LDFLAGS=-static-libgcc
   306 	make all build-shared CROSS_COMPILE=$(MINGPFX) SHARED_LDFLAGS=-static-libgcc
   304 	
   307 	mv $(tmp)/$(OSSLVER) .;
       
   308 	
       
   309 	touch $@
       
   310 	
       
   311 M2CRVER=M2Crypto-0.22.5
       
   312 
       
   313 m2crypto: openssl
   305 	# Build M2crypto
   314 	# Build M2crypto
   306 	$(call get_src_pypi,source/M/M2Crypto,$(M2CRVER).tar.gz)\
   315 	$(call get_src_pypi,54/f5/6fa9bca4a18cc36c0c84c73d41d8e521c8cb70f077b11297efcd985242a6,M2Crypto-0.22.5.tar.gz)\
   307 	tar -C $(tmp) -xzf $$dld
   316 	tar -C $(tmp) -xzf $$dld
   308 	cd $(tmp)/$(M2CRVER); \
   317 	cd $(tmp)/$(M2CRVER); \
   309 	patch -p1 < $(src)/M2Crypto-mingw-cross-compile-fix.patch && \
   318 	patch -p1 < $(src)/M2Crypto-mingw-cross-compile-fix.patch && \
   310 	PYTHONLIB=$(abspath $(pydir))/libs \
   319 	PYTHONLIB=$(abspath $(pydir))/libs \
   311 	PYTHONINC=$(abspath $(pydir))/include/ \
   320 	PYTHONINC=$(abspath $(pydir))/include/ \
   312 	MINGCCPREFIX=$(MINGPFX) \
   321 	MINGCCPREFIX=$(MINGPFX) \
   313 	    python setup.py build build_ext \
   322 	    python setup.py build build_ext \
   314 	        --openssl=$(tmp)/$(OSSLVER) -cmingw32
   323 	        --openssl=$(CURDIR)/$(OSSLVER) -cmingw32
   315 	
   324 	
   316 	# Copy openssl dlls directly in M2Crypto package directory
   325 	# Copy openssl dlls directly in M2Crypto package directory
   317 	cp -a $(tmp)/$(OSSLVER)/*.dll $(tmp)/$(M2CRVER)/build/lib.win32-2.7/M2Crypto 
   326 	cp -a $(CURDIR)/$(OSSLVER)/*.dll $(tmp)/$(M2CRVER)/build/lib.win32-2.7/M2Crypto 
   318 	
   327 	
   319 	# Move result into python site packages
   328 	# Move result into python site packages
   320 	mv $(tmp)/$(M2CRVER)/build/lib.win32-2.7/M2Crypto $(pysite)
   329 	mv $(tmp)/$(M2CRVER)/build/lib.win32-2.7/M2Crypto $(pysite)
   321 	
   330 	
   322 	touch $@
   331 	touch $@
   367 				--wx=0
   376 				--wx=0
   368 	$(MAKE) -C $(CFbuild)
   377 	$(MAKE) -C $(CFbuild)
   369 	cd $(CFbuild); find . -name "*.o" -exec rm {} ';' #remove object files only
   378 	cd $(CFbuild); find . -name "*.o" -exec rm {} ';' #remove object files only
   370 	touch $@
   379 	touch $@
   371 
   380 
   372 targets=python mingw matiec beremiz
   381 targets=python m2crypto mingw matiec beremiz
   373 Beremiz-$(version).exe: $(targets) $(src)/license.txt $(src)/install.nsi $(targets_ex)
   382 Beremiz-$(version).exe: $(targets) $(src)/license.txt $(src)/install.nsi $(targets_ex)
   374 	sed -e 's/\$$BVERSION/$(version)/g' $(src)/license.txt > build/license.txt
   383 	sed -e 's/\$$BVERSION/$(version)/g' $(src)/license.txt > build/license.txt
   375 	sed -e 's/\$$BVERSION/$(version)/g' $(src)/install.nsi |\
   384 	sed -e 's/\$$BVERSION/$(version)/g' $(src)/install.nsi |\
   376 	sed -e 's/\$$BEXTENSIONS/$(extensions)/g' |\
   385 	sed -e 's/\$$BEXTENSIONS/$(extensions)/g' |\
   377         makensis -
   386         makensis -