#!/usr/bin/env perl ################################################################################ # SPDX-FileCopyrightText: 2000, Eric Busboom # # SPDX-License-Identifier: LGPL-2.1-only OR MPL-2.0 ################################################################################ use Getopt::Std; getopts('chspi:'); # ARG 0 is components.txt open(PV, "$ARGV[0]") || die "Can't open components file $ARGV[0]:$!"; my @components; while () { s/#.*//; chop; push(@components, $_); } close PV; # Write the file inline by copying everything before a demarcation # line, and putting the generated data after the demarcation if ($opt_i) { open(IN, $opt_i) || die "Can't open input file \"$opt_i\""; while () { if (/Do not edit/) { last; } print; } if ($opt_i) { print "# Everything below this line is machine generated. Do not edit. \n"; } else { print "/* Everything below this line is machine generated. Do not edit. */\n"; } } if ($opt_c or $opt_h and !$opt_i) { print < SPDX-License-Identifier: LGPL-2.1-only OR MPL-2.0 ======================================================================*/ /* * THIS FILE IS MACHINE GENERATED DO NOT EDIT */ #include /* for va_arg functions */ EOM } if ($opt_p and !$opt_i) { print <