Files
epics-base/modules/database/src/tools/makeIncludeDbd.pl
2018-06-19 11:31:13 +02:00

34 lines
887 B
Perl

#!/usr/bin/env perl
#*************************************************************************
# Copyright (c) 2014 UChicago Argonne LLC, as Operator of Argonne
# National Laboratory.
# EPICS BASE is distributed subject to a Software License Agreement found
# in file LICENSE that is included with this distribution.
#*************************************************************************
use strict;
use File::Basename;
sub Usage {
my $txt = shift;
print "Usage: makeIncludeDbd.pl input file list ... outfile\n";
print "Error: $txt\n" if $txt;
exit 2;
}
Usage("No input files specified")
unless $#ARGV > 1;
my $target = pop @ARGV;
my @inputs = map { basename($_); } @ARGV;
open(my $OUT, '>', $target)
or die "$0: Can't create $target, $!\n";
print $OUT "# Generated file $target\n\n";
print $OUT map { "include \"$_\"\n"; } @inputs;
close $OUT;