"Paul D. Smith" wrote:
>>
The rationale... behind the way "%.x %.y:" works?

It's _extremely_ handy.  In fact, I consider it a failing of GNU make
that there's no way to express this same concept for explicit,
non-pattern rules.  One should be added.
<<
I agree. I've been running into this a lot recently, and it seems that
it should be a pretty common need. For example, I'm writing a "master
makefile" to build a number of components (including, e.g., libtool,
libgdbm, etc.) and I want to set dependencies on the components'
Makefiles and configure scripts. Of course the configure scripts produce
more than one result - Makefile, some set of header files, etc.

For example:

gdbm/Makefile: gdbm/configure libtool/libltdl/libltdl.la
        cd gdbm; ./configure

gdbm/libgdbm.la: gdbm/Makefile FORCE
        cd gdbm; $(MAKE)

$(DESTDIR)/gdbm.h: gdbm/libgdbm.la gdbm/gdbm.h
        rm -f $@; cp gdbm/gdbm.h $@

$(DESTDIR)/libgdbm.la: gdbm/libgdm.la
        cd gdbm; ./libtool --mode=install ./install-sh -c libgdbm.la $@

gdbm: $(DESTDIR)/gdbm.h $(DESTDIR)/libgdbm.la

gdbm/gdbm.h is created during the invocation of $(MAKE) in the
gdbm/libgdbm.la rule. Right now this is pretty messy, and there's nothing
here that explicitly states where gdbm/gdbm.h came from.

  -- Howard Chu
  Chief Architect, Symas Corp.       Director, Highland Sun
  http://www.symas.com               http://highlandsun.com/hyc

Reply via email to