bug-make
[Top][All Lists]
Advanced

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

using "%: $(subst RCS/,,%)"


From: Marc MERLIN
Subject: using "%: $(subst RCS/,,%)"
Date: Mon, 2 Oct 2000 15:07:37 -0700
User-agent: Mutt/1.2i

Hi,

This is  probably not a  bug, but I  wasn't able to  find a mailing  list or
another place  to ask  for advanced  make help (after  having read  the info
pages that is)

Here's what I'm trying to do:
----------------------------------------------------------------------------
# Cancel the RCS rule because we want to supersede it
% :: RCS/%,v
% :: %,v

# Check modified files in automatically
%,v: $(subst RCS/,,%)
        @echo "$<"
#       @if [ `rcsdiff -q $< | wc -l` -gt 1 ]; then echo "$< is more recent 
than $@, you want to check it in"; echo "The diff follows (type enter and then 
'q' to quit less)"; read dummy; rcsdiff -u $< | less; ci -u $<; fi 
#       @touch $@
----------------------------------------------------------------------------

Basically, I'm  trying to get  make to make sure  that some files  have been
checked in

It's a bit hairy, but what I ended up with was:
ORCSFILES=hostfile $(HDQTMANUALZONES) $(FRMTMANUALZONES) $(SNDGMANUALZONES)
#TORCSFILESTMP=$(addsuffix .v,$(addprefix RCS/,$(TORCSFILES)))
#TORCS=$(TORCSFILESTMP:.v=,v)
# Man, this is getting hairy, thank god for the shell function...
TORCS=$(shell echo '$(TORCSFILES)' | sed -e 's/\/\([^/]*\) /\/RCS\/\1 /g'  -e 
's/\<\([^/]*\) /RCS\/\1 /g' -e 's/RCS\/RCS/RCS/g' -e 's/  */,v /'g) 

My main problem is that I end up with:
TORCS=RCS/hostfile,v hdqt.valinux.com/RCS/hdqt.10.1.0,v 
hdqt.valinux.com/RCS/hdqt.10.40,v frmt.valinux.com/RCS/frmt.10.20,v

and then I have an rcs target as such:
rcs:    $(TORCS)
        

"make -r -d rcs" shows that make does the right matching:
   (...)
   Looking for an implicit rule for `frmt.valinux.com/RCS/frmt.10.20,v'.
   Trying pattern rule with stem `frmt.10.20'.

but the %,v: $(subst RCS/,,%) part doesn't work.

I used to be able to write:
RCS/%,v:        %
but I can't anymore now that I have optional leading pathnames.

The only fix I see right now is to get rid of the RCS directories, something
which I'd like to avoid at the moment.

Any suggestions on how to do this?

Thanks,
Marc
-- 
Microsoft is to software what McDonalds is to gourmet cooking
 
Home page: http://marc.merlins.org/ (friendly to non IE browsers)
Finger address@hidden for PGP key and other contact information



reply via email to

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