# $Id$ OPENSSL_VER?=0.9.8h OPENSSL_DIR?=openssl-${OPENSSL_VER} OPENSSL_TAR?=${OPENSSL_DIR}.tar OPENSSL_GZ?=${OPENSSL_TAR}.gz OPENSSL_URL?=http://www.openssl.org/source/${OPENSSL_GZ} OPENSSL_PATCH=openssl-${OPENSSL_VER}-mingw.patch OPENSSL_PATCH2=openssl-${OPENSSL_VER}-mingw-2.patch OPENSSL_PATCH_URL=http://smithii.com/files/${OPENSSL_PATCH} OPENSSL_PATCH2_URL=http://smithii.com/files/${OPENSSL_PATCH2} OSNAME:=$(shell uname | perl -ne 'tr/A-Z/a-z/; /([a-z]+)/ && print $$1;') BUNZIP2?=bunzip2 GUNZIP?=gunzip MAKE?=make PATCH?=patch PERL?=perl STRIP?=strip --strip-all SUDO?= TAR?=tar WGET?=wget -N CONFIGURE=./configure ifeq ('${OSNAME}', 'linux') CONFIGURE=./configure \ --host=i586-mingw32msvc \ --build=`dpkg-architecture -qDEB_BUILD_GNU_TYPE` \ --prefix=/usr/i586-mingw32msvc MAKE=PATH=/usr/i586-mingw32msvc/bin:$$PATH \ make \ PREFIX=/usr/i586-mingw32msvc \ AR=i586-mingw32msvc-ar \ AS=i586-mingw32msvc-as \ CC=i586-mingw32msvc-gcc \ LD=i586-mingw32msvc-ld \ RC=i586-mingw32msvc-windres endif MAKEFILE=${OPENSSL_DIR}/Makefile OPENSSL_EXE=${OPENSSL_DIR}/apps/openssl.exe OPENSSL_TAR_TOUCH=${OPENSSL_DIR}/.untar.touch OPENSSL_PATCH_TOUCH=${OPENSSL_DIR}/.patch.touch OPENSSL_INSTALL_TOUCH=${OPENSSL_DIR}/.install.touch .PHONY: all wget untar patch config make clean install nuke remove all: make ${OPENSSL_GZ}: $(WGET) $(OPENSSL_URL) wget: ${OPENSSL_GZ} # cp ${OPENSSL_GZ} ${OPENSSL_GZ}.sav # ${GUNZIP} ${OPENSSL_GZ} # mv -f ${OPENSSL_GZ}.sav ${OPENSSL_GZ} # ${TAR} -xvf ${OPENSSL_TAR} # rm -f ${OPENSSL_TAR} ${OPENSSL_TAR_TOUCH}: ${OPENSSL_GZ} ${TAR} -xzvf $< touch $@ untar: ${OPENSSL_TAR_TOUCH} #${OPENSSL_PATCH}: # ${WGET} ${OPENSSL_PATCH_URL} #${OPENSSL_PATCH2}: # ${WGET} ${OPENSSL_PATCH2_URL} #${OPENSSL_PATCH_TOUCH}: ${OPENSSL_PATCH} ${OPENSSL_PATCH2} ${OPENSSL_TAR_TOUCH} # cd ${OPENSSL_DIR} && \ # #${PATCH} -p1 <../${OPENSSL_PATCH} # #test -f ${OPENSSL_PATCH2} && cd ${OPENSSL_DIR} && \ # #${PATCH} -p1 <../${OPENSSL_PATCH2} # touch $@ #patch: ${OPENSSL_PATCH_TOUCH} #${MAKEFILE}: patch ${MAKEFILE}: ${OPENSSL_TAR_TOUCH} cd ${OPENSSL_DIR} && \ ${PERL} ./Configure mingw config: ${MAKEFILE} ${OPENSSL_EXE}: ${MAKEFILE} cd ${OPENSSL_DIR} && \ ${MAKE} make: ${OPENSSL_EXE} ${OPENSSL_INSTALL_TOUCH}: ${OPENSSL_EXE} cd ${OPENSSL_DIR} && \ ${SUDO} ${MAKE} install touch $@ install: ${OPENSSL_INSTALL_TOUCH} unconf: rm -f ${OPENSSL_CONFIGURE_TOUCH} clean: unconf rm -fr \ ${OPENSSL_MAKE_TOUCH} \ ${OPENSSL_INSTALL_TOUCH} cd ${OPENSSL_DIR} && \ ${MAKE} clean rmdir: rm -fr ${OPENSSL_DIR} nuke: rmdir rm -f ${OPENSSL_GZ}