# YaCy - Makefile Dependency Updater # $Id$ # $HeadURL$ # Copyright (C) 2009 Alexander Kahl # # This file is part of YaCy. # YaCy is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # YaCy is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . TOP := $(dir $(lastword $(MAKEFILE_LIST))) LIBDIR := ${TOP}lib MIRRORURL := http://yacy.de/libs DEPENDENCIES := commons-httpclient-3.1.jar xerces.jar bzip2.jar commons-fileupload-1.2.1.jar commons-logging-1.1.1.jar mysql-connector-java-5.1.7-bin.jar servlet-api.jar commons-jxpath-1.1.jar commons-io-1.4.jar sbbi-upnplib-1.0.4.jar svnRevNr.jar nsisant-1.2.jar domaingraph.jar jsmoothgen-ant.jar tm-extractors-1.0.jar PDFBox-0.7.3.jar jakarta-oro-2.0.7.jar odf_utils_05_11_29.jar FontBox-0.1.0-dev.jar poi-3.0-alpha2-20060616.jar bcprov-jdk14-139.jar jrpm-head.jar jsch-0.1.21.jar J7Zip-modified.jar log4j-1.2.9.jar jmimemagic-0.1.0.jar poi-scratchpad-3.0-alpha2-20060616.jar commons-codec-1.3.jar webcat-0.1-swf.jar tar.jar bcmail-jdk14-139.jar OBSOLETEDEPS = $(filter-out ${DEPENDENCIES}, $(notdir $(wildcard ${LIBDIR}/*))) PREREQS := du wget rm mkdir cut update: $(PREREQS) $(DEPENDENCIES) prune prune: $(OBSOLETEDEPS) # Placeholder rule $(OBSOLETEDEPS): @echo "pruning $@" @rm -vf "${LIBDIR}/$@" $(PREREQS): @which "$@" > /dev/null 2>&1 || { echo "please install \"$@\""; exit 1; } $(DEPENDENCIES): $(LIBDIR) @test -e "${LIBDIR}/$@" -a ! -w "${LIBDIR}/$@" \ && { echo "something's wrong with ${LIBDIR}/$@"; exit 1; } || : @test -e "${LIBDIR}/$@" && [[ $$(du "${LIBDIR}/$@"|cut -f1) == 0 ]] \ && rm -vf "${LIBDIR}/$@" ||: @wget -nv -O "${LIBDIR}/$@" "${MIRRORURL}/$@" || : $(LIBDIR): @mkdir -vp "$@" .PHONY: update prune