77b6fac
# Makefile for source rpm: perl-Cache
77b6fac
# $Id$
77b6fac
NAME := perl-Cache
77b6fac
SPECFILE = $(firstword $(wildcard *.spec))
77b6fac
77b6fac
define find-makefile-common
77b6fac
for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done
77b6fac
endef
77b6fac
77b6fac
MAKEFILE_COMMON := $(shell $(find-makefile-common))
77b6fac
77b6fac
ifeq ($(MAKEFILE_COMMON),)
77b6fac
# attept a checkout
77b6fac
define checkout-makefile-common
77b6fac
test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2
77b6fac
endef
77b6fac
77b6fac
MAKEFILE_COMMON := $(shell $(checkout-makefile-common))
77b6fac
endif
77b6fac
77b6fac
include $(MAKEFILE_COMMON)