Commit 1714c6ef authored by Steve McIntyre's avatar Steve McIntyre

Add an option to stop make on various errors

By default, many of the processes in the webwml build are run with a
leading "-" so that make will ignore errors. Replace *most* of
those (*not* including rm calls for make clean) with $(IGNORE) and add
a conditional to Makefile.common to control what $(IGNORE) does.

By default, things will work just the same as before. If you set
STRICT_ERROR_CHECKS=1 in Makefile.common, the build will now be much
more strict. Most people can just ignore the change to add this
option, but it's helpful when debugging the scripts to have things
fail cleanly and quickly.
parent 03bccc27
......@@ -3,6 +3,14 @@
CUR_YEAR := $(shell date +%Y)
# Turn this on to stop ignoring errors in various places
STRICT_ERROR_CHECKS = 1
ifeq ($(STRICT_ERROR_CHECKS), 0)
IGNORE = -
else
IGNORE =
endif
ENGLISHSRCDIR := $(WMLBASE)/../english
ENGLISHDIR := $(ENGLISHSRCDIR)
# ^ just an alias ^
......@@ -64,12 +72,12 @@ existing-SUBS-cleandest := $(addsuffix -cleandest,$(existing-SUBS))
all:: $(HTMLFILES) $(existing-SUBS)
$(existing-SUBS):
-$(MAKE) -C $@
$(IGNORE)$(MAKE) -C $@
install:: $(HTMLDESTFILES) $(OTHERDESTFILES) $(existing-SUBS-install)
$(existing-SUBS-install):
-$(MAKE) -C $(patsubst %-install,%,$@) install
$(IGNORE)$(MAKE) -C $(patsubst %-install,%,$@) install
clean::
rm -f *.$(LANGUAGE).html *~ *.forced
......@@ -79,7 +87,7 @@ endif
clean:: $(existing-SUBS-clean)
$(existing-SUBS-clean):
-$(MAKE) -C $(patsubst %-clean,%,$@) clean
$(IGNORE)$(MAKE) -C $(patsubst %-clean,%,$@) clean
cleandest::
rm -f $(HTMLDIR)/*.$(LANGUAGE).html
......@@ -89,7 +97,7 @@ endif
cleandest:: $(existing-SUBS-cleandest)
$(existing-SUBS-cleandest):
-$(MAKE) -C $(patsubst %-cleandest,%,$@) cleandest
$(IGNORE)$(MAKE) -C $(patsubst %-cleandest,%,$@) cleandest
$(VCSREVCACHE): $(WMLBASE)/../.git/index
(cd $(WMLBASE)/.. && ./build_vcs_cache.pl)
......@@ -110,10 +118,10 @@ endif
%.$(LANGUAGE).html : %.wml $(EXTRAWMLDEP) | $(VCSREVCACHE)
$(WML) $(<F)
ifeq "$(LANGUAGE)" "en"
-$(WMLBASE)/../touch_translations.pl $(CURDIR)/$(<F) $(LANGUAGE)
$(IGNORE)$(WMLBASE)/../touch_translations.pl $(CURDIR)/$(<F) $(LANGUAGE)
else
ifneq "$(findstring international,$(CUR_DIR))" ""
-$(WMLBASE)/../touch_translations.pl $(CURDIR)/$(<F) $(LANGUAGE)
$(IGNORE)$(WMLBASE)/../touch_translations.pl $(CURDIR)/$(<F) $(LANGUAGE)
endif
endif
......@@ -123,7 +131,7 @@ ifndef NOGENERICINSTDEP
$(HTMLDIR)/%.$(LANGUAGE).html: %.$(LANGUAGE).html
@test -d $(HTMLDIR) || mkdir -m g+w -p $(HTMLDIR)
@echo copying $(@F) to $(HTMLDIR)
-@install -m 664 -p $(@F) $(HTMLDIR)
$(IGNORE)@install -m 664 -p $(@F) $(HTMLDIR)
ifeq "$(LANGUAGE)" "nb"
@echo making a link $(@D)/$(*F).no.html -\> $(@F)
@ln -sf $(@F) $(@D)/$(*F).no.html
......
......@@ -73,17 +73,17 @@ $(TOHK): $(TOTW)
$(HTMLDIR)/%.zh-cn.html: %.zh-cn.html
@test -d $(HTMLDIR) || mkdir -m g+w -p $(HTMLDIR)
@echo copying $(@F) to $(HTMLDIR)
-@install -m 664 -p $(@F) $(HTMLDIR)
$(IGNORE)@install -m 664 -p $(@F) $(HTMLDIR)
$(HTMLDIR)/%.zh-hk.html: %.zh-hk.html
@test -d $(HTMLDIR) || mkdir -m g+w -p $(HTMLDIR)
@echo copying $(@F) to $(HTMLDIR)
-@install -m 664 -p $(@F) $(HTMLDIR)
$(IGNORE)@install -m 664 -p $(@F) $(HTMLDIR)
$(HTMLDIR)/%.zh-tw.html: %.zh-tw.html
@test -d $(HTMLDIR) || mkdir -m g+w -p $(HTMLDIR)
@echo copying $(@F) to $(HTMLDIR)
-@install -m 664 -p $(@F) $(HTMLDIR)
$(IGNORE)@install -m 664 -p $(@F) $(HTMLDIR)
# Create %.html -> %.zh-tw.html symlink if no English version of %.wml exists
@if [ ! -f "$(WMLBASE)/../english/$(CUR_DIR)/$(*F).wml" ]; then \
echo "Making a link $(@D)/$(*F).html -> $(@F)"; \
......
......@@ -14,18 +14,18 @@ STRIP_INITIAL_BLANK_LINE := $(CURDIR)/$(STRIP_INITIAL_BLANK_LINE)
$(HTMLDIR)/%.zh-cn.html: %.zh-cn.html
@test -d $(@D) || mkdir -m g+w -p $(@D)
@echo copying $(@F) to $(@D)
-@install -m 664 -p $(<) $(@D)
$(IGNORE)@install -m 664 -p $(<) $(@D)
$(HTMLDIR)/%.zh-hk.html: %.zh-hk.html
@test -d $(@D) || mkdir -m g+w -p $(@D)
@echo copying $(@F) to $(@D)
-@install -m 664 -p $(<) $(@D)
$(IGNORE)@install -m 664 -p $(<) $(@D)
$(HTMLDIR)/%.zh-tw.html: %.zh-tw.html
@test -d $(@D) || mkdir -m g+w -p $(@D)
@echo copying $(@F) to $(@D)
-@install -m 664 -p $(<) $(@D)
$(IGNORE)@install -m 664 -p $(<) $(@D)
clean::
-find . -type f -name \*.$(LANGUAGE)-??.html | xargs rm -f
$(IGNORE)find . -type f -name \*.$(LANGUAGE)-??.html | xargs rm -f
index.zh-cn.html index.zh-hk.html index.zh-tw.html: index.wml \
$(wildcard $(CUR_YEAR)/*/index.wml) \
......
......@@ -63,7 +63,7 @@ endif
$(HTMLDIR)/%.$(LANGUAGE).html: %.$(LANGUAGE).html
@test -d $(@D) || mkdir -m g+w -p $(@D)
@echo copying $(@F) to $(@D)
-@install -m 664 -p $(<) $(@D)
$(IGNORE)install -m 664 -p $(<) $(@D)
ifeq "$(LANGUAGE)" "en"
@echo making a link $(@D)/$(*F).html -\> $(@F)
@ln -sf $(@F) $(@D)/$(*F).html
......@@ -73,12 +73,12 @@ endif
$(HTMLDIR)/%.png: %.png
@test -d $(@D) || mkdir -m g+w -p $(@D)
@echo copying $(@F) to $(@D)
-@install -m 664 -p $(<) $(@D)
$(IGNORE)install -m 664 -p $(<) $(@D)
# Have to add to the default clean rule to clean up all the html the
# above target produces.
clean::
-find . -type f -name \*.$(LANGUAGE).html | xargs rm -f
$(IGNORE)find . -type f -name \*.$(LANGUAGE).html | xargs rm -f
# Need to rebuild the index when anything changes.
index.$(LANGUAGE).html: index.wml $(wildcard $(CUR_YEAR)/*/index.wml) \
......
......@@ -45,6 +45,6 @@ install:: $(HTMLDIR)/diffstat.js
$(HTMLDIR)/diffstat.js: diffstat.js
@test -d $(HTMLDIR) || mkdir -m g+w -p $(HTMLDIR)
@echo copying $(@F) to $(HTMLDIR)
-@install -m 664 -p $(@F) $(HTMLDIR)
$(IGNORE)install -m 664 -p $(@F) $(HTMLDIR)
endif
......@@ -36,4 +36,4 @@ index.$(LANGUAGE).html: index.wml $(wildcard [0-9]*\-*.wml) $(TEMPLDIR)/template
$(HTMLDIR)/%.ics: %.ics
@echo copying $< to $(HTMLDIR)
-@install -m 644 -p $< $(HTMLDIR)
$(IGNORE)install -m 644 -p $< $(HTMLDIR)
......@@ -36,4 +36,4 @@ index.$(LANGUAGE).html: index.wml $(wildcard [0-9]*\-*.wml) $(TEMPLDIR)/template
$(HTMLDIR)/%.ics: %.ics
@echo copying $< to $(HTMLDIR)
-@install -m 644 -p $< $(HTMLDIR)
$(IGNORE)install -m 644 -p $< $(HTMLDIR)
......@@ -38,4 +38,4 @@ index.$(LANGUAGE).html: index.wml $(wildcard [0-9]*\-*.wml) $(TEMPLDIR)/template
$(HTMLDIR)/%.ics: %.ics
@echo copying $< to $(HTMLDIR)
-@install -m 644 -p $< $(HTMLDIR)
$(IGNORE)install -m 644 -p $< $(HTMLDIR)
......@@ -36,4 +36,4 @@ index.$(LANGUAGE).html: index.wml $(wildcard [0-9]*\-*.wml) $(TEMPLDIR)/template
$(HTMLDIR)/%.ics: %.ics
@echo copying $< to $(HTMLDIR)
-@install -m 644 -p $< $(HTMLDIR)
$(IGNORE)install -m 644 -p $< $(HTMLDIR)
......@@ -36,4 +36,4 @@ index.$(LANGUAGE).html: index.wml $(wildcard [0-9]*\-*.wml) $(TEMPLDIR)/template
$(HTMLDIR)/%.ics: %.ics
@echo copying $< to $(HTMLDIR)
-@install -m 644 -p $< $(HTMLDIR)
$(IGNORE)install -m 644 -p $< $(HTMLDIR)
......@@ -36,4 +36,4 @@ index.$(LANGUAGE).html: index.wml $(wildcard [0-9]*\-*.wml) $(TEMPLDIR)/template
$(HTMLDIR)/%.ics: %.ics
@echo copying $< to $(HTMLDIR)
-@install -m 644 -p $< $(HTMLDIR)
$(IGNORE)install -m 644 -p $< $(HTMLDIR)
......@@ -36,4 +36,4 @@ index.$(LANGUAGE).html: index.wml $(wildcard [0-9]*\-*.wml) $(TEMPLDIR)/template
$(HTMLDIR)/%.ics: %.ics
@echo copying $< to $(HTMLDIR)
-@install -m 644 -p $< $(HTMLDIR)
$(IGNORE)install -m 644 -p $< $(HTMLDIR)
......@@ -36,4 +36,4 @@ index.$(LANGUAGE).html: index.wml $(wildcard [0-9]*\-*.wml) $(TEMPLDIR)/template
$(HTMLDIR)/%.ics: %.ics
@echo copying $< to $(HTMLDIR)
-@install -m 644 -p $< $(HTMLDIR)
$(IGNORE)install -m 644 -p $< $(HTMLDIR)
......@@ -36,4 +36,4 @@ index.$(LANGUAGE).html: index.wml $(wildcard [0-9]*\-*.wml) $(TEMPLDIR)/template
$(HTMLDIR)/%.ics: %.ics
@echo copying $< to $(HTMLDIR)
-@install -m 644 -p $< $(HTMLDIR)
$(IGNORE)install -m 644 -p $< $(HTMLDIR)
......@@ -36,4 +36,4 @@ index.$(LANGUAGE).html: index.wml $(wildcard [0-9]*\-*.wml) $(TEMPLDIR)/template
$(HTMLDIR)/%.ics: %.ics
@echo copying $< to $(HTMLDIR)
-@install -m 644 -p $< $(HTMLDIR)
$(IGNORE)install -m 644 -p $< $(HTMLDIR)
......@@ -38,4 +38,4 @@ index.$(LANGUAGE).html: index.wml $(wildcard [0-9]*\-*.wml) \
$(HTMLDIR)/%.ics: %.ics
@echo copying $< to $(HTMLDIR)
-@install -m 644 -p $< $(HTMLDIR)
$(IGNORE)install -m 644 -p $< $(HTMLDIR)
......@@ -11,7 +11,7 @@ include $(WMLBASE)/Make.lang
$(HTMLDIR)/%.$(LANGUAGE).html: %.$(LANGUAGE).html
@test -d $(HTMLDIR) || mkdir -m g+w -p $(HTMLDIR)
@echo copying $(@F) to $(HTMLDIR)
-@install -m 664 -p $(@F) $(HTMLDIR)
$(IGNORE)install -m 664 -p $(@F) $(HTMLDIR)
ifeq "$(LANGUAGE)" "sv"
@echo making a link $(@D)/$(*F).html -\> $(@F)
@ln -sf $(@F) $(@D)/$(*F).html
......
......@@ -30,7 +30,7 @@ DebianSecTracker.json:
oval-definitions-%.xml: force DebianSecTracker.json
@[ -e $(PYTHON) ] || { echo "ERROR: Required python binary $(PYTHON) is not available, aborting generation" >&2; exit 1; }
-$(PYTHON) generate.py -d .. -j DebianSecTracker.json -r $(patsubst oval-definitions-%.xml,%,$@) >$@
$(IGNORE)$(PYTHON) generate.py -d .. -j DebianSecTracker.json -r $(patsubst oval-definitions-%.xml,%,$@) >$@
# Warn if empty files are generated
# Note: They cannot be removed or the install target will fail later
@[ -s $@ ] || echo "WARNING: OVAL Definition $@ is empty, please review script and/or DSAs"
......
......@@ -20,10 +20,10 @@ index.$(LANGUAGE).html : index.wml $(WMLRCDEP) $(GETTEXTDEP) \
$(TEMPLDIR)/template.wml $(TEMPLDIR)/languages.wml | $(VCSREVCACHE)
$(WML) $(<F)
ifeq "$(LANGUAGE)" "en"
-$(WMLBASE)/../touch_translations.pl $(CURDIR)/$(<F) $(LANGUAGE)
$(IGNORE)$(WMLBASE)/../touch_translations.pl $(CURDIR)/$(<F) $(LANGUAGE)
else
ifneq "$(findstring international,$(CUR_DIR))" ""
-$(WMLBASE)/../touch_translations.pl $(CURDIR)/$(<F) $(LANGUAGE)
$(IGNORE)$(WMLBASE)/../touch_translations.pl $(CURDIR)/$(<F) $(LANGUAGE)
endif
endif
......@@ -34,9 +34,9 @@ endif
$(TEMPLDIR)/template.wml $(TEMPLDIR)/languages.wml | $(VCSREVCACHE)
$(WML) $(<F)
ifeq "$(LANGUAGE)" "en"
-$(WMLBASE)/../touch_translations.pl $(CURDIR)/$(<F) $(LANGUAGE)
$(IGNORE)$(WMLBASE)/../touch_translations.pl $(CURDIR)/$(<F) $(LANGUAGE)
else
ifneq "$(findstring international,$(CUR_DIR))" ""
-$(WMLBASE)/../touch_translations.pl $(CURDIR)/$(<F) $(LANGUAGE)
$(IGNORE)$(WMLBASE)/../touch_translations.pl $(CURDIR)/$(<F) $(LANGUAGE)
endif
endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment