Skip to content

Commit 0a982a3

Browse files
committed
[Makefile] Remake when Make is called with different arguments as last time.
1 parent 9a2ed8c commit 0a982a3

File tree

1 file changed

+25
-7
lines changed

1 file changed

+25
-7
lines changed

css-template/Makefile

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
# Calling the post-processor with file-upload. Assumes the username
22
# and password are in ~/.curl-w3.org (user = USER:PASS)
33
#
4-
# To set a date other than today, use: make cdate=YYYYMMDD
4+
# To set a date other than today, use: make date=YYYYMMDD
5+
#
6+
# "cdate" is an alias for "date": "make cdate=YYYYMMDD" works,
7+
# too. And instead of a compact date, an ISO date is also accepted:
8+
# "make date=YYYY-MM-DD".
59
#
610
# To set the status, modify one of the "this version" URLs:
711
# http://www.w3.org/TR/[YEAR]/CR-[SHORTNAME]-[CDATE]/
@@ -13,19 +17,20 @@
1317
# -F omitdchtml=on
1418
# e.g., like this: make opts="-F ids=on -F omitdchtml=on"
1519

16-
cdate ?=
20+
date ?=
1721
status ?=
1822
group ?= CSS
1923
opts ?=
2024
target ?= Overview
2125
markup ?= html
26+
cdate ?= $(date)
2227

23-
%.html: %.src.html
28+
%.html: %.src.html $(MAKEFILE_LIST) %.options
2429
@echo "Calling post-processor to generate $@..."
2530
@curl -K ~/.curl-w3.org -s -S -F output=html -F file=@$< \
2631
-F group=$(group) -F method=file -F date=$(cdate) -F status=$(status) \
2732
$(opts) -o $@ https://www.w3.org/Style/Group/process.cgi
28-
%.err: %.src.html
33+
%.err: %.src.html %.options
2934
@echo "Calling post-processor to check $<..."
3035
@curl -K ~/.curl-w3.org -s -S -F output=err -F file=@$< \
3136
-F group=$(group) -F method=file -F date=$(cdate) -F status=$(status) \
@@ -39,7 +44,7 @@ markup ?= html
3944
curl -s -L -F file=@$< -F time=$(cdate) -F output=err \
4045
-F paragraph=$(markup) $(opts) -o $@ http://api.csswg.org/bikeshed/
4146

42-
%.tmp: %.bs
47+
%.tmp: %.bs $(MAKEFILE_LIST) %.options
4348
cp $< $@
4449
if [ "$(cdate)" != "" ]; then sed -r -i " \
4550
/<pre class=['\"]?metadata/,/<\/pre/{ \
@@ -52,6 +57,11 @@ markup ?= html
5257
s/<\/pre/Status: $(status)\n&/; \
5358
}" $@; fi
5459

60+
# Check if make options (date, status, opts) changed
61+
%.options: always
62+
@echo '$(MAKEFLAGS)' >$@.tmp
63+
@cmp -s $@ $@.tmp && rm $@.tmp || mv $@.tmp $@
64+
5565
# For Dispositions of Comments in css3-background:
5666
%.html: %.txt; awk -f issues-txt-to-html.awk $< >$@
5767

@@ -65,6 +75,13 @@ markup ?= html
6575
%.png: %.eps; convert -density 96x96 $< $@
6676

6777

78+
# all:
79+
# @echo MAKFLAGS = $(MAKEFLAGS)
80+
# @echo MAKEOVERRIDES = $(MAKEOVERRIDES)
81+
# @echo MAKEFILES = $(MAKEFILES)
82+
# @echo MAKEFILE_LIST = $(MAKEFILE_LIST)
83+
84+
6885
all: check $(target).html
6986

7087
# egrep will exit with a zero exit code if there is anything left
@@ -89,6 +106,7 @@ clean:
89106

90107

91108

92-
.PHONY: check commit update clean
109+
.PHONY: check commit update clean always
93110
.DELETE_ON_ERROR:
94-
.PRECIOUS: %.png
111+
.PRECIOUS: %.png %.options
112+

0 commit comments

Comments
 (0)