# $Id$ # http://ftp.gnupg.org/gcrypt/libgpg-error/libgpg-error-1.5.tar.bz2 LIBGPGERROR_VER?=1.5 LIBGPGERROR_DIR?=libgpg-error-${LIBGPGERROR_VER} LIBGPGERROR_BZ2?=${LIBGPGERROR_DIR}.tar.bz2 LIBGPGERROR_URL?=http://ftp.gnupg.org/gcrypt/libgpg-error/${LIBGPGERROR_BZ2} OSNAME:=$(shell uname | perl -ne 'tr/A-Z/a-z/; /([a-z]+)/ && print $$1;') GUNZIP?=gunzip MAKE?=make PATCH?=patch PERL?=perl SUDO?= TAR?=tar WGET?=wget -N ifeq ('${OSNAME}', 'mingw') # mingw's tar doesn't handle symlinks TAR=c:/cygwin/bin/tar endif CONFIGURE=./configure ifeq ('${OSNAME}', 'linux') CONFIGURE=./configure \ --host=i586-mingw32msvc \ --build=`dpkg-architecture -qDEB_BUILD_GNU_TYPE` \ --prefix=/usr/i586-mingw32msvc \ --enable-shared 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 LIBGPGERROR_TAR_TOUCH=${LIBGPGERROR_DIR}/.tar.touch LIBGPGERROR_CONFIGURE_TOUCH=${LIBGPGERROR_DIR}/.configure.touch LIBGPGERROR_MAKE_TOUCH=${LIBGPGERROR_DIR}/.make.touch LIBGPGERROR_INSTALL_TOUCH=${LIBGPGERROR_DIR}/.install.touch .PHONY: all clean configure install make nuke remove untar wget all: make ${LIBGPGERROR_BZ2}: ${WGET} ${LIBGPGERROR_URL} touch $@ wget: ${LIBGPGERROR_BZ2} ${LIBGPGERROR_TAR_TOUCH}: ${LIBGPGERROR_BZ2} ${TAR} -xjvf ${LIBGPGERROR_BZ2} touch $@ untar: ${LIBGPGERROR_TAR_TOUCH} ${LIBGPGERROR_CONFIGURE_TOUCH}: ${LIBGPGERROR_TAR_TOUCH} cd ${LIBGPGERROR_DIR} && \ ${CONFIGURE} touch $@ configure: ${LIBGPGERROR_CONFIGURE_TOUCH} # the following hack is to work around this error: # # i586-mingw32msvc-gcc -E _mkerrcodes.h | grep GPG_ERR_ | mawk -f ./mkerrcodes.awk >mkerrcodes.h # rm _mkerrcodes.h # cc -I. -I. -o mkerrcodes ./mkerrcodes.c # as: unrecognized option `-Qy' #ifeq ('${OSNAME}', 'linux') # cd ${LIBGPGERROR_DIR}/src && \ # rm -f cc # cd ${LIBGPGERROR_DIR}/src && \ # ln -s /usr/bin/i586-mingw32msvc-cc cc #endif #ifeq ('${OSNAME}', 'linux') # cd ${LIBGPGERROR_DIR}/src && \ # rm -f cc #endif ${LIBGPGERROR_MAKE_TOUCH}: ${LIBGPGERROR_CONFIGURE_TOUCH} -cd ${LIBGPGERROR_DIR} && \ ${MAKE} ifeq ('${OSNAME}', 'linux') cd ${LIBGPGERROR_DIR}/src && \ rm -f as cd ${LIBGPGERROR_DIR}/src && \ ln -s /usr/bin/as as cd ${LIBGPGERROR_DIR}/src && \ rm -f ld cd ${LIBGPGERROR_DIR}/src && \ ln -s /usr/bin/ld ld endif cd ${LIBGPGERROR_DIR}/src && \ ${MAKE} mkerrcodes ifeq ('${OSNAME}', 'linux') cd ${LIBGPGERROR_DIR}/src && \ rm -f as cd ${LIBGPGERROR_DIR}/src && \ rm -f ld endif cd ${LIBGPGERROR_DIR} && \ ${MAKE} touch $@ make: ${LIBGPGERROR_MAKE_TOUCH} ${LIBGPGERROR_INSTALL_TOUCH}: ${LIBGPGERROR_MAKE_TOUCH} cd ${LIBGPGERROR_DIR} && \ ${SUDO} ${MAKE} install touch $@ install: ${LIBGPGERROR_INSTALL_TOUCH} clean: rm -fr ${LIBGPGERROR_DIR}/.*.touch cd ${LIBGPGERROR_DIR} && \ ${MAKE} clean nuke: rm -fr ${LIBGPGERROR_DIR} remove: nuke rm -f ${LIBGPGERROR_GZ}