# -*- Makefile -*- # # Common Makefile for building RPMs # Licensed under the new-BSD license (http://www.opensource.org/licenses/bsd-license.php) # Copyright (C) 2004-2005 Red Hat, Inc. # Copyright (C) 2005 Fedora Foundation # # $Id: Makefile.common,v 1.106 2008/07/21 19:01:59 ausil Exp $ # Do one thing...find out what SCM we need to work with and whether we are # a traditional SRPM style file makeup or an exploded source repo. Once we # know that, pass off to the appropriate Makefile # Define the common dir. # This needs to happen first. define find-common-dir for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then echo "$$d"; break ; fi ; done endef COMMON_DIR := $(shell $(find-common-dir)) # Get what SCM this repo uses...the plan is to add scm packages as support for # them is added...right now we only do cvs and git, so that's all we test for define find-what-scm for d in CVS git ; do if [ -d .$$d -o -d $$d ] ; then echo $$d ; fi ; done endef SCM := $(shell $(find-what-scm)) # Get our package file layout: either dist (meaning traditional srpm style) or # repo (meaning exploded source style) define find-layout [ -d distropkg ] && echo "repo" || echo "dist" endef LAYOUT := $(shell $(find-layout)) include $(COMMON_DIR)/Makefile.$(LAYOUT)-$(SCM)