util/: Replace GPLv2 boiler plate with SPDX header
[coreboot.git] / src / mainboard / google / nyan / bct / cfg2inc.sh
blobd7b6c464952bd45ca35fefa24a161b9da3551040
1 #!/bin/sh
3 # This file is part of the coreboot project.
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; version 2 of the License.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 bct_cfg2inc() {
16 local in_file="$1"
17 local out_file="$2"
18 echo "{ /* generated from ${in_file}; do not edit. */" >"${out_file}"
19 # Note currently we can only handle DDR3 type memory, even in C
20 # implementation.
21 sed "/^#.*$/d; s/^SDRAM.0./ /; s/\r$//; s/;$/,/;" \
22 "${in_file}" >> "${out_file}"
23 echo "}," >>"${out_file}"
26 for file in $@; do
27 echo "Generating $file => ${file%cfg}inc..."
28 bct_cfg2inc "${file}" "${file%cfg}inc"
29 done