cvsdist fcb8c8
# Makefile for source rpm: autofs
Bill Nottingham df1d9b
# $Id: Makefile,v 1.1 2004/09/09 03:19:55 cvsdist Exp $
cvsdist fcb8c8
NAME := autofs
cvsdist fcb8c8
SPECFILE = $(firstword $(wildcard *.spec))
cvsdist fcb8c8
Bill Nottingham df1d9b
define find-makefile-common
Bill Nottingham df1d9b
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
Bill Nottingham df1d9b
endef
Bill Nottingham df1d9b
Bill Nottingham df1d9b
MAKEFILE_COMMON := $(shell $(find-makefile-common))
Bill Nottingham df1d9b
Bill Nottingham df1d9b
ifeq ($(MAKEFILE_COMMON),)
Bill Nottingham df1d9b
# attempt a checkout
Bill Nottingham df1d9b
define checkout-makefile-common
Bill Nottingham df1d9b
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
Bill Nottingham df1d9b
endef
Bill Nottingham df1d9b
Bill Nottingham df1d9b
MAKEFILE_COMMON := $(shell $(checkout-makefile-common))
Bill Nottingham df1d9b
endif
Bill Nottingham df1d9b
Bill Nottingham df1d9b
include $(MAKEFILE_COMMON)