![]() |
|
FreeBSD Ports and Packages Installation and upgrading of ports and packages on FreeBSD. |
![]() |
|
Thread Tools | Display Modes |
|
|||
![]()
I'm trying to use the 'a' sed command on a Makefile to insert a line. This is a Makefile for a port that's currently broken.
Code:
$@{REINPLACE_CMD} '|<iostream.h>|a \\ \#include <ios>|' sed a command syntax ref: [1addr]a \ text Thank you... (if this post is more appropiate to the programming section, feel free to move it) |
|
|||
![]()
You can create the sed command file in Make
Code:
FILES= a.src b.src EDIT : sedcmd sed -f sedcmd ${FILES} sedcmd : echo '/<iostream.h>/a\\' >${.TARGET} echo '#include <ios>' >>${.TARGET} Code:
$ cat sedcmd /<iostream.h>/a\ #include <ios>
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump |
|
||||
![]()
IMO, you're better off just using a patch file. Too many replacements like this make the Makefile unneccesarily overbloated and pehaps confusing to everyone else. REINPLACE_CMD is good for replacing many instances of something in a single file or something that may be dependent upon architecture, etc.
|
![]() |
Tags |
sed append makefile |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Makefile Problem | BadWolf | Programming | 4 | 15th March 2009 01:58 PM |
ports config and makefile scripting | boincv | FreeBSD Ports and Packages | 6 | 1st October 2008 07:57 AM |
Change Makefile options in ports | shep | FreeBSD Ports and Packages | 5 | 18th August 2008 07:58 AM |
First Post.. Woot!! --- An obvious Makefile question..? | roundkat | OpenBSD Packages and Ports | 2 | 2nd May 2008 03:05 PM |