cvsdist 46ff4ec
# Makefile for source rpm: gdb
e42a86f
# $Id: Makefile,v 1.2 2007/05/30 14:38:39 kasal Exp $
cvsdist 46ff4ec
NAME := gdb
cvsdist 46ff4ec
SPECFILE = $(firstword $(wildcard *.spec))
cvsdist 46ff4ec
e42a86f
define find-makefile-common
e42a86f
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
e42a86f
endef
e42a86f
e42a86f
MAKEFILE_COMMON := $(shell $(find-makefile-common))
e42a86f
e42a86f
ifeq ($(MAKEFILE_COMMON),)
e42a86f
# attempt a checkout
e42a86f
define checkout-makefile-common
e42a86f
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
e42a86f
endef
e42a86f
e42a86f
MAKEFILE_COMMON := $(shell $(checkout-makefile-common))
e42a86f
endif
e42a86f
e42a86f
include $(MAKEFILE_COMMON)