xref: /netbsd-src/external/gpl3/gcc/dist/gcc/config/nvptx/gen-copyright.sh (revision b1e838363e3c6fc78a55519254d99869742dd33c)
1#!/bin/sh
2
3# Copyright (C) 2022 Free Software Foundation, Inc.
4#
5# This file is part of GCC.
6#
7# GCC is free software; you can redistribute it and/or modify
8# it under the terms of the GNU General Public License as published by
9# the Free Software Foundation; either version 3, or (at your option)
10# any later version.
11#
12# GCC is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15# GNU General Public License for more details.
16#
17# You should have received a copy of the GNU General Public License
18# along with GCC; see the file COPYING3.  If not see
19# <http://www.gnu.org/licenses/>.
20
21style="$1"
22case $style in
23    opt)
24    ;;
25    c)
26	first=true
27    ;;
28    *)
29	echo "Unknown style: \"$style\""
30	exit 1
31	;;
32esac
33
34( cat <<EOF
35Copyright (C) 2022 Free Software Foundation, Inc.
36
37This file is part of GCC.
38
39GCC is free software; you can redistribute it and/or modify it under
40the terms of the GNU General Public License as published by the Free
41Software Foundation; either version 3, or (at your option) any later
42version.
43
44GCC is distributed in the hope that it will be useful, but WITHOUT ANY
45WARRANTY; without even the implied warranty of MERCHANTABILITY or
46FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
47for more details.
48
49You should have received a copy of the GNU General Public License
50along with GCC; see the file COPYING3.  If not see
51<http://www.gnu.org/licenses/>.
52EOF
53) | while read line; do
54    case $style in
55	opt)
56	    if [ "$line" = "" ]; then
57		echo ";"
58	    else
59		echo "; $line"
60	    fi
61	    ;;
62	c)
63	    if $first; then
64		echo "/* $line"
65		first=false
66	    else
67		if [ "$line" = "" ]; then
68		    echo
69		else
70		    echo "   $line"
71		fi
72	    fi
73	    ;;
74    esac
75done
76
77
78case $style in
79    c)
80	echo "*/"
81	;;
82esac
83