|
1 # -*- makefile -*- |
|
2 # vim:set ts=8 sw=8 sts=8 noet: |
|
3 # |
|
4 # This Source Code Form is subject to the terms of the Mozilla Public |
|
5 # License, v. 2.0. If a copy of the MPL was not distributed with this file, |
|
6 # You can obtain one at http://mozilla.org/MPL/2.0/. |
|
7 # |
|
8 |
|
9 ifdef USE_RCS_MK #{ |
|
10 |
|
11 ifndef INCLUDED_RCS_MK #{ |
|
12 |
|
13 MOZ_RCS_TYPE_HG ?= $(notdir $(wildcard $(topsrcdir)/.hg)) |
|
14 MOZ_RCS_TYPE_GIT ?= $(notdir $(wildcard $(topsrcdir)/.git)) |
|
15 |
|
16 |
|
17 ########################################################################### |
|
18 # HAVE_MERCURIAL_RCS |
|
19 ########################################################################### |
|
20 ifeq (.hg,$(MOZ_RCS_TYPE_HG)) #{ |
|
21 |
|
22 # Intent: Retrieve the http:// repository path for a directory. |
|
23 # Usage: $(call getSourceRepo[,repo_dir|args]) |
|
24 # Args: |
|
25 # path (optional): repository to query. Defaults to $(topsrcdir) |
|
26 getSourceRepo = \ |
|
27 $(call FUNC_getSourceRepo,$(if $(1),cd $(1) && hg,hg --repository $(topsrcdir))) |
|
28 |
|
29 # return: http://hg.mozilla.org/mozilla-central |
|
30 FUNC_getSourceRepo = \ |
|
31 $(strip \ |
|
32 $(patsubst %/,%,\ |
|
33 $(patsubst ssh://%,http://%,\ |
|
34 $(firstword $(shell $(getargv) showconfig paths.default))\ |
|
35 ))) |
|
36 |
|
37 #} HAVE_MERCURIAL_RCS |
|
38 |
|
39 ########################################################################### |
|
40 # HAVE_GIT_RCS |
|
41 ########################################################################### |
|
42 else ifeq (.git,$(MOZ_RCS_TYPE_GIT)) #{ |
|
43 |
|
44 GIT ?= git |
|
45 getSourceRepo = \ |
|
46 $(shell cd $(topsrcdir) && $(GIT) rev-parse --verify HEAD) |
|
47 |
|
48 endif #} HAVE_GIT_RCS |
|
49 |
|
50 |
|
51 INCLUDED_RCS_MK := 1 |
|
52 endif #} |
|
53 |
|
54 endif #} |