Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Breaking up a text file to make a Makefile

by Anonymous Monk
on Mar 13, 2015 at 07:22 UTC ( [id://1119909]=note: print w/replies, xml ) Need Help??


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

... Any ideas how I should approach this?

Avoid it :)? something something makepp?

I really don't understand the problem ... you have some kind of makefile ... you want to add to some kind of Makefile ... I don't makefile often but that seems kind of like a thing some kind of makefile tools should be able to do already

Anyway, here are examples perlfaq6.../perlrequick/Regexp::Common/Re^6: POD style regex for inline HTML elements,Regexp::Grammars/Re^2: Parsing a config file with braces and nested braces/Re: Parsing a config file with braces and nested braces, Marpa::R2/Re: Parsing a config file with braces and nested braces

  • Comment on Re: Breaking up a text file to make a Makefile

Replies are listed 'Best First'.
Re^2: Breaking up a text file to make a Makefile
by Anonymous Monk on Mar 13, 2015 at 07:46 UTC
    #!/usr/bin/perl -- use strict; use warnings; use v5.10.0; use Data::Dump qw/ dd /; my $blah = qq{anything \\\nblah\nanything \\\nblah}; dd( $blah ); print "$blah\n\n"; #~ use re 'debug'; my $reblah = qr{ (?<multiline> (?: ^ [^\r\n]* \\ [\r\n]* )+ ## multiline MANY times (?: ^ [^\r\n]* [\r\n]+ ) ## but always ENDS with oneline ) | (?<oneline> ^ [^\r\n]* [\r\n]+ ) }smx; while( $blah =~ m{$reblah}g ){ dd( { %+ } ); } __END__ "anything \\\nblah\nanything \\\nblah" anything \ blah anything \ blah { multiline => "anything \\\nblah\n" } { oneline => "anything \\\n" }
Re^2: Breaking up a text file to make a Makefile
by flybd5 (Initiate) on Mar 13, 2015 at 13:09 UTC
    I have a "makefile" for a completely different build tool that comes with a 15-yr-old product, no compatibility to gmake. and I've devised a way to easily convert it to a gmake-compatible makefile. This is not something makefile tools do. I'm just not proficient enough in Perl to do it intelligently. I could use brute force, but I want to learn how to do things elegantly in Perl.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1119909]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (3)
As of 2024-04-18 23:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found