cvsdist 8ccc63d
# Makefile for source rpm: gdm
e3bd939
# $Id: Makefile,v 1.2 2007/10/15 18:46:51 notting Exp $
cvsdist 8ccc63d
NAME := gdm
cvsdist 8ccc63d
SPECFILE = $(firstword $(wildcard *.spec))
cvsdist 8ccc63d
f105fe2
define find-makefile-common
e3bd939
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
f105fe2
endef
f105fe2
f105fe2
MAKEFILE_COMMON := $(shell $(find-makefile-common))
f105fe2
f105fe2
ifeq ($(MAKEFILE_COMMON),)
f105fe2
# attempt a checkout
f105fe2
define checkout-makefile-common
f105fe2
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
f105fe2
endef
f105fe2
f105fe2
MAKEFILE_COMMON := $(shell $(checkout-makefile-common))
f105fe2
endif
f105fe2
f105fe2
include $(MAKEFILE_COMMON)