1 message in com.perforce.jamming[jamming] SoftLink rule?| From | Sent On | Attachments |
|---|---|---|
| David Lindes | 09 Mar 2002 03:09 |
| Subject: | [jamming] SoftLink rule?![]() |
|---|---|
| From: | David Lindes (user...@daveltd.com) |
| Date: | 03/09/2002 03:09:52 AM |
| List: | com.perforce.jamming |
Hi there,
I recently discovered jam, and I've been playing with it a bit, trying to learn my way around... (I hope you don't mind a non-list-member posting... that doesn't seem to be discouraged on the web site)
In my experiments with it, I came upon a desire to have a Jamfile of mine create a symbolic link to a file in a different directory, which would then be compiled, and which I wanted 'jam clean' to get rid of for me...
I didn't see an obvious way of doing that (easily) with the existing Jambase, but I figured this might be a common enough thing that perhaps an addition to Jambase would be warranted... So, I tried making a new Jambase file with the following changes...:
--- /home/lindes/src/otherware/devel/jam/jam-2.3/Jambase Thu Jan 4 07:53:08
2001
+++ /usr/tmp/Jambase.SoftLink Sat Mar 9 11:03:15 2002
@@ -681,6 +681,14 @@
SEARCH on $(>) = $(SEARCH_SOURCE) ;
}
+rule SoftLink +{ + DEPENDS files : $(<) ; + DEPENDS $(<) : $(>) ; + SEARCH on $(>) = $(SEARCH_SOURCE) ; + Clean clean : $(<) ; +} + rule HdrRule { # HdrRule source : headers ; @@ -1539,6 +1547,11 @@ actions HardLink { $(RM) $(<) && $(LN) $(>) $(<) +} + +actions SoftLink +{ + $(RM) $(<) && $(LN) -s $(>) $(<) }
actions Install
... and that seems to work just fine for me. I don't know my way around jam well enough to know if there's something I might be doing that would be generally problematic and/or naive, and I certainly don't know if this would create problems (and if so, what sorts of problems, and/or what a good fix would be) on platforms that aren't particularly similar to my own... So do with this what you will, but I think this change (or one comparable to it) would be a nifty feature...
Cheers,
David Lindes, possible future-jam-addict ;-)
P.S. I also thought about just adding the Clean line to the HardLink rule, but I can see reasons why that might be bad in some situations. In mine it would have been fine, but I figured I'd create a SoftLink rule instead so as not to be suggesting something that might cause problems for people. :-)
-- David Lindes, KF6HFQ DaveLtd[tm] Enterprises lin...@daveltd.com http://www.daveltd.com/




