From 6a82a96ff11f755b50eb0df79617035074c381fa Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Mon, 23 Aug 2021 21:20:15 +0200 Subject: Build final Perl program from `incdec.pm` Build an intermediary Perl file that includes the extra lines that call `incdec()`. This whole file should be included in the final Bash function `perl -e` call. --- Makefile | 6 ++++++ incdec.pl.m4 | 7 +++++++ 2 files changed, 13 insertions(+) create mode 100644 incdec.pl.m4 diff --git a/Makefile b/Makefile index 667ff7e..b1a3109 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,9 @@ .PHONY: test test: prove -v + + +incdec.pl: incdec.pl.m4 incdec.pm + sed -n '/sub incdec {/,/^}/p' incdec.pm > incdec.sub.pl + m4 $< > $@ + rm incdec.sub.pl diff --git a/incdec.pl.m4 b/incdec.pl.m4 new file mode 100644 index 0000000..03fb905 --- /dev/null +++ b/incdec.pl.m4 @@ -0,0 +1,7 @@ +use strict; +use warnings; + +include(`incdec.sub.pl')dnl + +my $output = incdec($line, $increment_by, $point_position, $backward); +print $output; -- cgit v1.2.3