diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2017-04-27 23:29:00 +0200 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2017-04-27 23:29:00 +0200 |
commit | 9bd44f525b8c97407e083697cf0b4fb7eab4e718 (patch) | |
tree | b32d9c30ccb3073d3b3d06d6c0083009e8b1dd65 | |
parent | b739de430878e48eb6b56cadbe59fc65bbf57d51 (diff) | |
download | fbida-9bd44f525b8c97407e083697cf0b4fb7eab4e718.tar.gz |
pass filenames as args to fallback.pl
-rw-r--r-- | GNUmakefile | 2 | ||||
-rwxr-xr-x | scripts/fallback.pl | 12 |
2 files changed, 10 insertions, 4 deletions
diff --git a/GNUmakefile b/GNUmakefile index 8ecc5a0..8f688a8 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -184,7 +184,7 @@ RegEdit.o : CFLAGS += -Wno-missing-prototypes -Wno-strict-prototypes -Wno-maybe- ida: $(OBJS_IDA) $(OBJS_READER) $(OBJS_WRITER) Ida.ad.h: Ida.ad $(srcdir)/scripts/fallback.pl - perl $(srcdir)/scripts/fallback.pl < $< > $@ + perl $(srcdir)/scripts/fallback.pl $< $@ logo.h: logo.jpg hexdump -v -e '1/1 "0x%02x,"' < $< > $@ diff --git a/scripts/fallback.pl b/scripts/fallback.pl index 03706c4..971de2c 100755 --- a/scripts/fallback.pl +++ b/scripts/fallback.pl @@ -4,7 +4,13 @@ # use strict; -while (my $line = <>) { +my $in = shift; +my $out = shift; + +open(IN, "<", $in) or die "open (read): $in"; +open(OUT, ">", $out) or die "open (write): $out"; + +while (my $line = <IN>) { chomp $line; # ignore comments @@ -17,10 +23,10 @@ while (my $line = <>) { # continued line? if ($line =~ s/\\\\$//) { - printf "\"%s\"\n",$line; + printf OUT "\"%s\"\n",$line; next; } # write out - printf "\"%s\",\n",$line; + printf OUT "\"%s\",\n",$line; } |