Files
2016-11-18 22:39:22 +01:00

26 lines
420 B
Perl

#! @PERL@
# $NetBSD: build.pl,v 1.1 2015/11/25 16:42:21 rillig Exp $
#
use strict;
use warnings;
sub readfile {
my $file = shift;
local $/ = undef;
open(my $in, "<", $file) || die "failed to read $file: $!";
my $contents = <$in>;
close($in) || die "failed to read $file: $!";
return $contents;
}
while (my $line = <>) {
if ($line =~ m"^#include (.+)$/") {
print readfile($1);
} else {
print $line;
}
}