Discussion:
[9fans] plumb rule for include files in different directories
(too old to reply)
Bence Fábián
2013-06-11 12:38:03 UTC
Permalink
i work on a project and i'd like to be able to plumb #includes right

source files are in $path-to-project/source/$subsystem/src/
includes are in either $path-to-project/source/$subsystem/intf/
or $path-to-project/intf/$subsystem/intf/

it's quite chaothic

i'm trying (at the end of rules) with something like

type is text
wdir matches '(/path-to-project/.*)/src/.*'
arg isdir $1
data matches '([a-zA-Z¡-￿0-9]+\.h)('$addr')?'
arg isfile $dir/intf/$1
data set $file
attr add addr=$3
plumb to edit
plumb client window $editor

but it doesn't seem to work

Does anyone experimented with this (and managed to solve it)?
Steve Simon
2013-06-11 14:06:03 UTC
Permalink
I do somthing similar, though my solution is rather crufty.

I connect linux box using ssh from plan9, I also have a sftpfs
session from plan9 mounted at /n/linux

I have my own script called make on a which runs /bin/make and
pipes the output through sed. sed rewrites the absolute paths
(I have to use cmake which always uses absolute paths) into
plan9 relative paths so they can be plumbed. e.g.

/home/steve/work/xxx/yyy/fred.cpp
gets rewritten as
/n/linux/home/steve/work/xxx/yyy/fred.cpp

I also use conswdir(1) and a cd function in rc (on linux) to ensure
my plan9 /dev/wdir is kept in sync with linux. This allows me to plumb files
in the current dir or dirs relative to it.

I warned you it was crufty.

-Steve
Richard Miller
2013-06-11 16:16:59 UTC
Permalink
If you're using acme, the Incl command might be useful.
Bence Fábián
2013-06-11 16:30:59 UTC
Permalink
i missed Incl.
thank you
Post by Richard Miller
If you're using acme, the Incl command might be useful.
Continue reading on narkive:
Search results for '[9fans] plumb rule for include files in different directories' (Questions and Answers)
23
replies
Republicans', how do you propose paying for our federal deficit?
started 2006-08-28 13:56:42 UTC
politics
Loading...