cvsdist 10e1d4b
# Makefile for source rpm: tcsh
3bbb348
# $Id: Makefile,v 1.2 2007/10/15 19:27:31 notting Exp $
cvsdist 10e1d4b
NAME := tcsh
cvsdist 10e1d4b
SPECFILE = $(firstword $(wildcard *.spec))
cvsdist 10e1d4b
024b8ef
define find-makefile-common
3bbb348
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
024b8ef
endef
024b8ef
024b8ef
MAKEFILE_COMMON := $(shell $(find-makefile-common))
024b8ef
024b8ef
ifeq ($(MAKEFILE_COMMON),)
024b8ef
# attempt a checkout
024b8ef
define checkout-makefile-common
024b8ef
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
024b8ef
endef
024b8ef
024b8ef
MAKEFILE_COMMON := $(shell $(checkout-makefile-common))
024b8ef
endif
024b8ef
024b8ef
include $(MAKEFILE_COMMON)