cvsdist f146152
# Makefile for source rpm: sane-backends
33cdd2c
# $Id: Makefile,v 1.1 2004/09/09 12:01:12 cvsdist Exp $
cvsdist f146152
NAME := sane-backends
cvsdist f146152
SPECFILE = $(firstword $(wildcard *.spec))
cvsdist f146152
33cdd2c
define find-makefile-common
33cdd2c
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
33cdd2c
endef
33cdd2c
33cdd2c
MAKEFILE_COMMON := $(shell $(find-makefile-common))
33cdd2c
33cdd2c
ifeq ($(MAKEFILE_COMMON),)
33cdd2c
# attempt a checkout
33cdd2c
define checkout-makefile-common
33cdd2c
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
33cdd2c
endef
33cdd2c
33cdd2c
MAKEFILE_COMMON := $(shell $(checkout-makefile-common))
33cdd2c
endif
33cdd2c
33cdd2c
include $(MAKEFILE_COMMON)