help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: can't get sed script into makefile


From: Johan Bezem
Subject: Re: can't get sed script into makefile
Date: Wed, 10 Nov 2004 07:51:24 +0100
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)

I'm not exactly an sed expert, but you might consider labelling the expressions 
with the option -e, like:
 sed -e "s/^Build-Depends: .*$$/\0, libldap-dev/" \
     -e "s/^Package: bind9$$/\0-sdb-ldap/" \
     -e "...
That way, make's substitution of newlines with whitespace in one large string 
does not affect sed's separation of commands.
Alternately, since you do not need special make-specific variables or such, you might 
consider packing all the commands into a single file (using normal newlines, nothing 
to be escaped), and using 'sed -f <command-file>' with identical IO-redirection.

HTH,

Johan

address@hidden wrote:
I can't get this sed script into a makefile. sed won't accept lines ending with backslashes, but they are required by make for to express multiline commands.

These lines don't work:

    [...]
    control: control-stamp
    control-stamp:
        mv debian/control debian/control.orig
        sed "s/^Build-Depends: .*$$/\0, libldap-dev/ \
            s/^Package: bind9$$/\0-sdb-ldap/ \
            T \
            : loop \
            n \
            s/^Conflicts: .*$$/\0, bind9\nProvides: bind9/ \
            t \
            s/^$$/\0/ \
            T loop" < debian/control.orig > debian/control
        touch control-stamp
...

--
JB Enterprises - Johan Bezem         Tel:   +49 172 5463210
Software Architect - Project Manager Fax:   +49 172 50 5463210
Realtime / Embedded Consultant       Email: address@hidden
Design - Development - Test - QA     Web:   http://www.bezem.de






reply via email to

[Prev in Thread] Current Thread [Next in Thread]