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

Automatic dependency checking



Hi, attached patch is a first draft to use WML support for automatic
dependency tracking, it surely needs fine tuning (i.e. do not commit it
now ;)) to deal with all special cases, but I believe this issue could
be very helpful when finished.
Suggestions are welcome.

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/28 23:36:54
@@ -29,6 +29,8 @@
 	$(patsubst %.wml,$(HTMLDIR)/%.$(LANGUAGE)-$(i).html,$(WMLFILES))))
 endif
 
+DEP_FILES = $(patsubst %.wml,.deps/%.d,$(WMLFILES))
+
 JPGSOURCE := $(wildcard *.jpg)
 GIFSOURCE := $(wildcard *.gif)
 PNGSOURCE := $(wildcard *.png)
@@ -179,6 +181,12 @@
 $(TEMPLDIR)/countries.def: $(TEMPLDIR)/countries.wml
 	cd $(TEMPLDIR) && sed -e /^#/d countries.wml | eperl -B '<:' -E ':>' - >/dev/null
 
+-include $(DEP_FILES)
+
+depend: $(DEP_FILES)
+
+.deps/%.d: %.wml
+	wml -p1 -M -o $*.$(LANGUAGE).html $? > $@
 
 .SUFFIXES: 
 .PHONY: all $(existing-SUBS) install $(existing-SUBS-install)

Reply to: