Marcin Garski eba3ca
# Makefile for source rpm: digikam
Marcin Garski eba3ca
# $Id$
Marcin Garski eba3ca
NAME := digikam
Marcin Garski eba3ca
SPECFILE = $(firstword $(wildcard *.spec))
Marcin Garski eba3ca
Marcin Garski eba3ca
define find-makefile-common
Marcin Garski eba3ca
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
Marcin Garski eba3ca
endef
Marcin Garski eba3ca
Marcin Garski eba3ca
MAKEFILE_COMMON := $(shell $(find-makefile-common))
Marcin Garski eba3ca
Marcin Garski eba3ca
ifeq ($(MAKEFILE_COMMON),)
Marcin Garski eba3ca
# attept a checkout
Marcin Garski eba3ca
define checkout-makefile-common
Marcin Garski eba3ca
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
Marcin Garski eba3ca
endef
Marcin Garski eba3ca
Marcin Garski eba3ca
MAKEFILE_COMMON := $(shell $(checkout-makefile-common))
Marcin Garski eba3ca
endif
Marcin Garski eba3ca
Marcin Garski eba3ca
include $(MAKEFILE_COMMON)