• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/bash
2
3# Temporarily (de)ignore Makefiles generated by CMake to allow easier
4# git development
5#
6# Copyright The Mbed TLS Contributors
7# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
8#
9# This file is provided under the Apache License 2.0, or the
10# GNU General Public License v2.0 or later.
11#
12# **********
13# Apache License 2.0:
14#
15# Licensed under the Apache License, Version 2.0 (the "License"); you may
16# not use this file except in compliance with the License.
17# You may obtain a copy of the License at
18#
19# http://www.apache.org/licenses/LICENSE-2.0
20#
21# Unless required by applicable law or agreed to in writing, software
22# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
23# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
24# See the License for the specific language governing permissions and
25# limitations under the License.
26#
27# **********
28#
29# **********
30# GNU General Public License v2.0 or later:
31#
32# This program is free software; you can redistribute it and/or modify
33# it under the terms of the GNU General Public License as published by
34# the Free Software Foundation; either version 2 of the License, or
35# (at your option) any later version.
36#
37# This program is distributed in the hope that it will be useful,
38# but WITHOUT ANY WARRANTY; without even the implied warranty of
39# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
40# GNU General Public License for more details.
41#
42# You should have received a copy of the GNU General Public License along
43# with this program; if not, write to the Free Software Foundation, Inc.,
44# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
45#
46# **********
47
48IGNORE=""
49
50# Parse arguments
51#
52until [ -z "$1" ]
53do
54  case "$1" in
55    -u|--undo)
56      IGNORE="0"
57      ;;
58    -v|--verbose)
59      # Be verbose
60      VERBOSE="1"
61      ;;
62    -h|--help)
63      # print help
64      echo "Usage: $0"
65      echo -e "  -h|--help\t\tPrint this help."
66      echo -e "  -u|--undo\t\tRemove ignores and continue tracking."
67      echo -e "  -v|--verbose\t\tVerbose."
68      exit 1
69      ;;
70    *)
71      # print error
72      echo "Unknown argument: '$1'"
73      exit 1
74      ;;
75  esac
76  shift
77done
78
79if [ "X" = "X$IGNORE" ];
80then
81  [ $VERBOSE ] && echo "Ignoring Makefiles"
82  git update-index --assume-unchanged Makefile library/Makefile programs/Makefile tests/Makefile
83else
84  [ $VERBOSE ] && echo "Tracking Makefiles"
85  git update-index --no-assume-unchanged Makefile library/Makefile programs/Makefile tests/Makefile
86fi
87