Matt Domsch 225e19f
# Makefile for source rpm: aiccu
Matt Domsch 225e19f
# $Id$
Matt Domsch 225e19f
NAME := aiccu
Matt Domsch 225e19f
SPECFILE = $(firstword $(wildcard *.spec))
Matt Domsch 225e19f
Matt Domsch 225e19f
define find-makefile-common
8bfab4d
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
Matt Domsch 225e19f
endef
Matt Domsch 225e19f
Matt Domsch 225e19f
MAKEFILE_COMMON := $(shell $(find-makefile-common))
Matt Domsch 225e19f
Matt Domsch 225e19f
ifeq ($(MAKEFILE_COMMON),)
Matt Domsch 225e19f
# attept a checkout
Matt Domsch 225e19f
define checkout-makefile-common
Matt Domsch 225e19f
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
Matt Domsch 225e19f
endef
Matt Domsch 225e19f
Matt Domsch 225e19f
MAKEFILE_COMMON := $(shell $(checkout-makefile-common))
Matt Domsch 225e19f
endif
Matt Domsch 225e19f
Matt Domsch 225e19f
include $(MAKEFILE_COMMON)