delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/01/23/10:45:24

From: mdruiter AT cs DOT vu DOT nl (Ruiter de M)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: How do I do this with make?
Date: 23 Jan 1998 15:14:50 GMT
Organization: Fac. Wiskunde & Informatica, VU, Amsterdam
Message-ID: <6aac5a$7po$1@star.cs.vu.nl>
References: <69nuae$492$1 AT star DOT cs DOT vu DOT nl> <6a805f$dij$1 AT news DOT ox DOT ac DOT uk>
NNTP-Posting-Host: sloep112.cs.vu.nl
Lines: 66
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

George Foot (mert0407 AT sable DOT ox DOT ac DOT uk) wrote:
> On 16 Jan 1998 15:28:14 GMT in comp.os.msdos.djgpp Ruiter de M
> <mdruiter AT cs DOT vu DOT nl> wrote:

> I'm sorry for the delayed reply, I thought you'd already been answered
> satisfactorily.  Anyway, I think this might point you in the right
> direction:

I've had answers but
- they answered the wrong question, or
- they told me it was only possible with sub-makes.

> :TARGETS = $(patsubst %.b,%.a,$(wildcard */*.b))

Yes, this is what I was able to do already.

> :%.a: %.b
> :        @echo "wibble $< $@"
> :        @touch $@

Huh? Is it THIS simple? I've tried almost everything, even VPATH and
vpath, but nothing worked! I must have been sleeping somewhere.

> With directories 10 and 20 and input files 10/foo.b, 10/bar.b,
> 20/foo.b the output was:
> 
> wibble 10/bar.b 10/bar.a
> wibble 10/foo.b 10/foo.a
> wibble 20/foo.b 20/foo.a

Great, that's what I wanted.

> Remember, with GNU Make [almost] anything is possible... ;)

Yes, that is what I thought. Just haven't searched enough I guess.

OK, now we got this working, does this thing also work if I want to do
this:

10/%.jpg: %.pgm
	same commands
20/%.jpg: %.pgm
	same commands
...
90/%.jpg: %.pgm
	same commands

If so, how do I do it exactly? My guess (first part can be generated):

10/%.jpg 20/%.jpg ... 90/%.jpg: %.pgm
	same commands

But, if I remember well, the direction part is added automaticly to
the %.pgm and that is what I don't want.

I can't test things right now, the files I want to process are at home
on a hard disk which `crashed' yesterday (all root-dir entries are
gone) :-(.

Thanx so much for helping!

-- 
Groeten, Michel.        http://www.cs.vu.nl/~mdruiter
 \----/==\----/
  \  /    \  /          "You know, Beavis, you need things that suck,
   \/      \/           to have things that are cool", Butt-Head.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019