0a7a7cf
# Makefile for source rpm: rubygem-shoulda
0a7a7cf
# $Id$
0a7a7cf
NAME := rubygem-shoulda
0a7a7cf
SPECFILE = $(firstword $(wildcard *.spec))
0a7a7cf
0a7a7cf
define find-makefile-common
0a7a7cf
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
0a7a7cf
endef
0a7a7cf
0a7a7cf
MAKEFILE_COMMON := $(shell $(find-makefile-common))
0a7a7cf
0a7a7cf
ifeq ($(MAKEFILE_COMMON),)
0a7a7cf
# attept a checkout
0a7a7cf
define checkout-makefile-common
0a7a7cf
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
0a7a7cf
endef
0a7a7cf
0a7a7cf
MAKEFILE_COMMON := $(shell $(checkout-makefile-common))
0a7a7cf
endif
0a7a7cf
0a7a7cf
include $(MAKEFILE_COMMON)