# $Id$ # http://daniel.haxx.se/projects/c-ares/c-ares-1.5.2.tar.gz CARES_VER?=1.6.0 CARES_DIR?=c-ares-${CARES_VER} CARES_GZ?=${CARES_DIR}.tar.gz CARES_URL?=http://daniel.haxx.se/projects/c-ares/${CARES_GZ} #CARES_PATCH?=c-ares-1.4.0-mingw.patch #CARES_PATCH_URL?=http://smithii.com/files/${CARES_PATCH} 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=LIBS="-lws2_32" \ ./configure \ --host=i586-mingw32msvc \ --build=`dpkg-architecture -qDEB_BUILD_GNU_TYPE` \ --prefix=/usr/i586-mingw32msvc \ --without-random 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 CARES_TAR_TOUCH=${CARES_DIR}/.tar.touch CARES_CONFIGURE_TOUCH=${CARES_DIR}/.configure.touch #CARES_PATCH_TOUCH=${CARES_DIR}/.patch.touch CARES_MAKE_TOUCH=${CARES_DIR}/.make.touch CARES_INSTALL_TOUCH=${CARES_DIR}/.install.touch .PHONY: all clean configure install make nuke patch rmdir unconf untar wget all: make ${CARES_GZ}: ${WGET} ${CARES_URL} touch $@ wget: ${CARES_GZ} ${CARES_TAR_TOUCH}: ${CARES_GZ} ${TAR} -xzvf $< touch $@ untar: ${CARES_TAR_TOUCH} #${CARES_PATCH}: # ${WGET} ${CARES_PATCH_URL} #${CARES_PATCH_TOUCH}: ${CARES_PATCH} ${CARES_TAR_TOUCH} #ifneq ('${OSNAME}', 'linux') # cd ${CARES_DIR} && \ # ${PATCH} -p1 <../${CARES_PATCH} #endif # touch $@ #patch: ${CARES_PATCH_TOUCH} #${CARES_CONFIGURE_TOUCH}: ${CARES_PATCH_TOUCH} ${CARES_CONFIGURE_TOUCH}: ${CARES_TAR_TOUCH} cd ${CARES_DIR} && \ ${CONFIGURE} touch $@ configure: ${CARES_CONFIGURE_TOUCH} ${CARES_MAKE_TOUCH}: ${CARES_CONFIGURE_TOUCH} cd ${CARES_DIR} && \ ${MAKE} touch $@ make: ${CARES_MAKE_TOUCH} ${CARES_INSTALL_TOUCH}: ${CARES_MAKE_TOUCH} cd ${CARES_DIR} && \ ${SUDO} ${MAKE} install touch $@ install: ${CARES_INSTALL_TOUCH} unconf: rm -f ${CARES_CONFIGURE_TOUCH} clean: unconf rm -fr \ ${CARES_MAKE_TOUCH} \ ${CARES_INSTALL_TOUCH} cd ${CARES_DIR} && \ ${MAKE} clean rmdir: rm -fr ${CARES_DIR} nuke: rmdir rm -f ${CARES_GZ}