Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pedantic improvements to Makefile #215

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
spec.html
spec-remote.html
36 changes: 20 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
SHELL=/bin/bash
SHELL = /bin/bash

local: spec.bs
bikeshed --die-on=warning spec spec.bs spec.html
# Automatically delete any target whose recipe fails.
.DELETE_ON_ERROR:

spec.html: spec.bs
@ (HTTP_STATUS=$$(curl https://api.csswg.org/bikeshed/ \
--output spec.html \
--write-out "%{http_code}" \
--header "Accept: text/plain, text/html" \
-F die-on=warning \
-F [email protected]) && \
[[ "$$HTTP_STATUS" -eq "200" ]]) || ( \
echo ""; cat spec.html; echo ""; \
rm -f spec.html; \
exit 22 \
);
bikeshed --die-on=warning spec $< $@

remote: spec.html
spec-remote.html: spec.bs
trap 'echo; cat $@; echo;' ERR; \
curl >$@ https://api.csswg.org/bikeshed/ \
--no-progress-meter \
--fail-with-body \
--form die-on=warning \
--form file=@$<

# These targets do not correspond to files.
.PHONY: local remote clean

local: spec.html

remote: spec-remote.html
cp $< spec.html

clean:
rm spec.html
rm -f spec.html spec-remote.html