cda7583
# Makefile for source rpm: perl-Sys-Virt
cda7583
# $Id$
cda7583
NAME := perl-Sys-Virt
cda7583
SPECFILE = $(firstword $(wildcard *.spec))
cda7583
cda7583
define find-makefile-common
4ab620b
for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$d/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done
cda7583
endef
cda7583
cda7583
MAKEFILE_COMMON := $(shell $(find-makefile-common))
cda7583
cda7583
ifeq ($(MAKEFILE_COMMON),)
cda7583
# attept a checkout
cda7583
define checkout-makefile-common
cda7583
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
cda7583
endef
cda7583
cda7583
MAKEFILE_COMMON := $(shell $(checkout-makefile-common))
cda7583
endif
cda7583
cda7583
include $(MAKEFILE_COMMON)