michael@0: # -*- makefile -*- michael@0: # vim:set ts=8 sw=8 sts=8 noet: michael@0: # michael@0: # This Source Code Form is subject to the terms of the Mozilla Public michael@0: # License, v. 2.0. If a copy of the MPL was not distributed with this file, michael@0: # You can obtain one at http://mozilla.org/MPL/2.0/. michael@0: # michael@0: michael@0: ifdef USE_RCS_MK #{ michael@0: michael@0: ifndef INCLUDED_RCS_MK #{ michael@0: michael@0: MOZ_RCS_TYPE_HG ?= $(notdir $(wildcard $(topsrcdir)/.hg)) michael@0: MOZ_RCS_TYPE_GIT ?= $(notdir $(wildcard $(topsrcdir)/.git)) michael@0: michael@0: michael@0: ########################################################################### michael@0: # HAVE_MERCURIAL_RCS michael@0: ########################################################################### michael@0: ifeq (.hg,$(MOZ_RCS_TYPE_HG)) #{ michael@0: michael@0: # Intent: Retrieve the http:// repository path for a directory. michael@0: # Usage: $(call getSourceRepo[,repo_dir|args]) michael@0: # Args: michael@0: # path (optional): repository to query. Defaults to $(topsrcdir) michael@0: getSourceRepo = \ michael@0: $(call FUNC_getSourceRepo,$(if $(1),cd $(1) && hg,hg --repository $(topsrcdir))) michael@0: michael@0: # return: http://hg.mozilla.org/mozilla-central michael@0: FUNC_getSourceRepo = \ michael@0: $(strip \ michael@0: $(patsubst %/,%,\ michael@0: $(patsubst ssh://%,http://%,\ michael@0: $(firstword $(shell $(getargv) showconfig paths.default))\ michael@0: ))) michael@0: michael@0: #} HAVE_MERCURIAL_RCS michael@0: michael@0: ########################################################################### michael@0: # HAVE_GIT_RCS michael@0: ########################################################################### michael@0: else ifeq (.git,$(MOZ_RCS_TYPE_GIT)) #{ michael@0: michael@0: GIT ?= git michael@0: getSourceRepo = \ michael@0: $(shell cd $(topsrcdir) && $(GIT) rev-parse --verify HEAD) michael@0: michael@0: endif #} HAVE_GIT_RCS michael@0: michael@0: michael@0: INCLUDED_RCS_MK := 1 michael@0: endif #} michael@0: michael@0: endif #}