cvsdist 5dd912c
# Makefile for source rpm: ksh
a18e517
# $Id: Makefile,v 1.1 2004/09/09 16:25:17 cvsdist Exp $
cvsdist 5dd912c
NAME := ksh
cvsdist 5dd912c
SPECFILE = $(firstword $(wildcard *.spec))
cvsdist 5dd912c
a18e517
define find-makefile-common
a18e517
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
a18e517
endef
a18e517
a18e517
MAKEFILE_COMMON := $(shell $(find-makefile-common))
a18e517
a18e517
ifeq ($(MAKEFILE_COMMON),)
a18e517
# attempt a checkout
a18e517
define checkout-makefile-common
a18e517
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
a18e517
endef
a18e517
a18e517
MAKEFILE_COMMON := $(shell $(checkout-makefile-common))
a18e517
endif
a18e517
a18e517
include $(MAKEFILE_COMMON)