in reply to Breaking up a text file to make a Makefile

Try this for a start?

#!/usr/bin/perl use strict; use warnings; use v5.10; open my $FILE ,"makefile.txt"; my $accum=""; while(<$FILE>){ chomp; if(s%(.*?)\\$% %){ $accum.=$1; } else { $accum.=$_; $accum=~s/\s+/ /gs; say $accum; $accum=""; } }

Replies are listed 'Best First'.
Re^2: Breaking up a text file to make a Makefile
by flybd5 (Initiate) on Mar 13, 2015 at 13:12 UTC
    Ok, this sets me in the right direction. I need to store these in an array, and then I need to count how many array entries I made in order to produce the definition of the "all" target in the makefile, then dump the array one at a time for each target into the makefile. Thanks!