Re: Bug#82852: DWN index for each year needs to depend on all the issues for that year
[removed Cc to make@p.d.o]
On Tue, Jul 31, 2001 at 11:54:11PM +0200, Josip Rodin wrote:
> On Tue, Jul 31, 2001 at 10:52:12PM +0200, Tollef Fog Heen wrote:
> > | I just tried to fix this, but it didn't seem to work. My thoughts were:
> > |
> > | */index.$(LANGUAGE).html: %/index.$(LANGUAGE).html: $(wildcard $*/*/index.wml)
> > | $(wildcard $(ENGLISHSRCDIR)/News/weekly/$*/*) \
> > | $(TEMPLDIR)/weeklynews/header.wml \
> > | $(TEMPLDIR)/weeklynews/index.wml \
> > | $(TEMPLDIR)/weeklynews/footer.wml
> > |
> > | This was just a guess based on the info in the make manual, and it didn't
> > | work. Looks like $* can't be used in the DEP-PATTERNS part, only COMMANDS.
> > | Using % instead of $* doesn't work, either.
> >
> > */index.$(LANGUAGE).html: %/index.$(LANGUAGE).html: $(shell find $* -name index.wml) \
> > $(wildcard $(ENGLISHSRCDIR)/News/weekly/$*/*) \
> > $(TEMPLDIR)/weeklynews/header.wml \
> > $(TEMPLDIR)/weeklynews/index.wml \
> > $(TEMPLDIR)/weeklynews/footer.wml
> >
> > Seems to work.
> >
> > (At least the first part -- you might need to fix up the wildcard part
> > as well.)
> >
> > I would think this is a bug in make, but I don't know Make well
> > enough.
>
> Tollef, your version is working.
>
> Manoj, this looks like a problem with the $(wildcard) function. Am I right?
Looks like I should commit my patch about automatic dependencies ;)
It does not automagically handle such complicated stuff, but it should
be quite trivial to adapt it.
I still wonder whether overhead caused by dependency computations is
acceptable or not.
Denis
Index: Makefile.common
===================================================================
RCS file: /cvs/webwml/webwml/Makefile.common,v
retrieving revision 1.41
diff -u -r1.41 Makefile.common
--- Makefile.common 2001/07/28 09:18:26 1.41
+++ Makefile.common 2001/07/31 22:12:03
@@ -87,8 +87,17 @@
# the rule for every wml file
ifndef NOGENERICDEP
-%.$(LANGUAGE).html : %.wml $(WMLBASE)/../.wmlrc $(WMLBASE)/.wmlrc \
- $(TEMPLDIR)/template.wml $(TEMPLDIR)/languages.wml $(HTMLDEP)
+
+DEPS_MAKE_DIRECTORY := $(shell mkdir .deps >/dev/null 2>&1 || :)
+
+-include $(patsubst %.wml,.deps/%.d,$(WMLFILES))
+
+.deps/%.d: %.wml
+ wml -p1 -M $(WMLOPTIONS) \
+ -i $(WMLBASE)/../.wmlrc -i $(WMLBASE)/.wmlrc \
+ -o $*.$(LANGUAGE).html -o $@ $(<F) > $@
+
+%.$(LANGUAGE).html : %.wml
$(WML) $(<F)
ifeq "$(LANGUAGE)" "en"
ifeq "$(findstring /international/,$(CURDIR)/)" ""
Reply to: