Fix for x86_64 build fail
[platform/upstream/connectedhomeip.git] / third_party / nlunit-test / repo / third_party / nlbuild-autotools / repo / make / pre / macros / git.mak
1 #
2 #    Copyright 2018 Google LLC. All Rights Reserved.
3 #    Copyright 2017-2018 Nest Labs Inc. All Rights Reserved.
4 #
5 #    Licensed under the Apache License, Version 2.0 (the "License");
6 #    you may not use this file except in compliance with the License.
7 #    You may obtain a copy of the License at
8 #
9 #    http://www.apache.org/licenses/LICENSE-2.0
10 #
11 #    Unless required by applicable law or agreed to in writing, software
12 #    distributed under the License is distributed on an "AS IS" BASIS,
13 #    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 #    See the License for the specific language governing permissions and
15 #    limitations under the License.
16 #
17
18 #
19 #    Description:
20 #      This file is the make "header" or pre make header that defines make
21 #      convenience macros for interacting with git.
22 #
23
24 # nlGitGetConfigFromFileCommand <file>
25 #
26 # Command to get a value for a variable set in the specified git config file <file>.
27
28 nlGitGetConfigFromFileCommand         = $(GIT) config --file $(1)
29
30 # nlGitListConfigFromFileCommand <file>
31 #
32 # Command to list all variables set in the specified config file <file>
33
34 nlGitListConfigFromFileCommand        = $(call nlGitGetConfigFromFileCommand,$(1)) --list
35
36 # nlGitGetConfigFromFile <file>
37 #
38 # Get a value for a variable set in the specified git config file <file>.
39
40 nlGitGetConfigFromFile                = $(shell $(call nlGitGetConfigFromFileCommand,$(1)))
41
42 # nlGitListConfigFromFile <file>
43 #
44 # List all variables set in the specified config file <file>
45
46 nlGitListConfigFromFile               = $(shell $(call nlGitListConfigFromFileCommand,$(1)))
47
48 # nlGitGetValueForRepoFromNameFromFile <file> <repo name> <value>
49 #
50 # Get a value for a repo / submodule variable set in specified git config file <file>.
51
52 nlGitGetValueForRepoFromNameFromFile  = $(shell $(call nlGitGetConfigFromFileCommand,$(1)) 'submodule.$(2).$(3)')
53
54 # nlGitGetBranchForRepoFromNameFromFile <file> <repo name>
55 #
56 # Get the remote branch for a repo / submodule variable set in specified git config file <file>.
57
58 nlGitGetBranchForRepoFromNameFromFile = $(call nlGitGetValueForRepoFromNameFromFile,$(1),$(2),branch)
59
60 # nlGitGetCommitForRepoFromNameFromFile <file> <repo name>
61 #
62 # Get the commit for a repo / submodule variable set in specified git config file <file>.
63
64 nlGitGetCommitForRepoFromNameFromFile = $(call nlGitGetValueForRepoFromNameFromFile,$(1),$(2),commit)
65
66 # nlGitGetURLForRepoFromNameFromFile <file> <repo name>
67 #
68 # Get the remote URL for a repo / submodule variable set in specified git config file <file>.
69
70 nlGitGetURLForRepoFromNameFromFile    = $(call nlGitGetValueForRepoFromNameFromFile,$(1),$(2),url)
71
72 # nlGitGetPathForRepoFromNameFromFile <file> <repo name>
73 #
74 # Get the local path for a repo / submodule variable set in specified git config file <file>.
75
76 nlGitGetPathForRepoFromNameFromFile   = $(call nlGitGetValueForRepoFromNameFromFile,$(1),$(2),path)
77
78 # nlGitGetMethodForPullFromFile <file>
79 #
80 # Get the pull method set in specified git config file <file>.
81
82 nlGitGetMethodForPullFromFile         = $(shell $(call nlGitGetConfigFromFileCommand,$(1)) 'pull.method')
83