Skip to content
This repository has been archived by the owner on Feb 15, 2021. It is now read-only.

Commit

Permalink
Hiding mess
Browse files Browse the repository at this point in the history
  • Loading branch information
martinthomson committed Dec 21, 2015
1 parent ee42a82 commit 6ff1724
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions Makefile
@@ -1,7 +1,7 @@
SUPPORTDIR ?= $(CURDIR)/support
BUILDDIR ?= $(CURDIR)/build
SUPPORTDIR ?= support
BUILDDIR ?= build
REPOS = https://github.com/w3c/respec|gh-pages https://github.com/dontcallmedom/webidl-checker https://github.com/dontcallmedom/widlproc https://github.com/dontcallmedom/linkchecker https://github.com/htacg/tidy-html5
TIDYCONF ?= $(firstword $(wildcard $(CURDIR)/tidy.config tidy.config))
TIDYCONF ?= $(firstword $(wildcard tidy.config webrtc-respec-ci/tidy.config))
LINEWRAP ?= false

ifndef TIDY
Expand All @@ -14,7 +14,7 @@ INPUT = $(shell head -1 W3CTRMANIFEST | cut -d '?' -f 1)
OUTPUT = $(BUILDDIR)/output.html

.PHONY: check
check: tidycheck respec webidl html5valid linkcheck
check:: tidycheck webidl html5valid linkcheck

.PHONY: tidycheck
tidycheck: $(TIDY)
Expand All @@ -25,9 +25,6 @@ ifeq (true,$(LINEWRAP))
(echo $(INPUT)" has lines not wrapped at "$(LINEWRAPLENGTH)" characters" && false)
endif

$(OUTPUT): $(INPUT) $(SUPPORTDIR)/respec
phantomjs --ignore-ssl-errors=true --ssl-protocol=tlsv1 $(SUPPORTDIR)/respec/tools/respec2html.js -e -w $< $@

.PHONY: webidl
webidl: $(OUTPUT) $(SUPPORTDIR)/webidl-checker $(WIDLPROC_PATH)
WIDLPROC_PATH=$(WIDLPROC_PATH) python $(SUPPORTDIR)/webidl-checker/webidl-check $< > /dev/null
Expand Down Expand Up @@ -59,7 +56,7 @@ to_dir = $(SUPPORTDIR)/$(notdir $(call to_url,$(1)))
to_dot = $(SUPPORTDIR)/.$(notdir $(call to_url,$(1)))

$(SUPPORTDIR)/repos.mk: $(SUPPORTDIR)
@echo ' $(foreach repo,$(REPOS),$(call to_dir,$(repo)): $(call to_dot,$(repo))\n$(call to_dot,$(repo)): $<\n\t[ -d $(call to_dir,$(repo)) ] && git -C $(call to_dir,$(repo)) pull || git clone --depth 5 $(call branch_arg,$(repo)) $(call to_url,$(repo)) $(call to_dir,$(repo))\n\t@touch $$@\n\n)' > $@
@echo ' $(foreach repo,$(REPOS),$(call to_dir,$(repo)): $(call to_dot,$(repo))\n$(call to_dot,$(repo)): $<\n\t@[ -d $(call to_dir,$(repo)) ] && git -C $(call to_dir,$(repo)) pull || git clone --depth 5 $(call branch_arg,$(repo)) $(call to_url,$(repo)) $(call to_dir,$(repo))\n\t@touch $$@\n\n)' > $@

ifdef BUILD_TIDY
$(TIDY): $(SUPPORTDIR)/tidy-html5
Expand All @@ -71,28 +68,31 @@ $(WIDLPROC_PATH): $(SUPPORTDIR)/widlproc
@$(MAKE) -C $< obj/widlproc

.PHONY: update force_update
update: force_update $(foreach repo,$(REPOS),$(call to_dir,$(repo))) $(tidy) $(WIDLPROC_PATH)
force_update:
update:: force_update $(foreach repo,$(REPOS),$(call to_dir,$(repo))) $(tidy) $(WIDLPROC_PATH)
force_update::
@touch $(SUPPORTDIR)/repos.mk

## Copy auxiliary files listed in W3CTRMANIFEST
## Build a processed copy of the spec

BUILD_FILES = $(shell tail -n +2 W3CTRMANIFEST)
.PHONY: build_files
build_files: $(addprefix $(BUILDDIR),$(BUILD_FILES))
BUILD_INPUT = $(shell tail -n +2 W3CTRMANIFEST)
BUILD_FILES = $(addprefix $(BUILDDIR)/,$(BUILD_INPUT))
include $(SUPPORTDIR)/build.mk
$(SUPPORTDIR)/build.mk: W3CTRMANIFEST $(SUPPORTDIR)
@echo ' $(foreach f,$(BUILD_FILES),$(BUILDDIR)/$(f): $(f) $(BUILDDIR)\n\t@cp -f $$< $$@\n)' > $@
@echo ' $(foreach f,$(BUILD_INPUT),$(BUILDDIR)/$(f): $(f) $(BUILDDIR)\n\t@mkdir -p $$(dir $$@)\n\tcp -f $$< $$@\n)' > $@

$(OUTPUT): $(INPUT) $(SUPPORTDIR)/respec $(BUILD_FILES)
phantomjs --ignore-ssl-errors=true --ssl-protocol=tlsv1 $(SUPPORTDIR)/respec/tools/respec2html.js -e -w $< $@


## Machine setup

.PHONY: travissetup
# .travis.yml need to install libwww-perl libcss-dom-perl python-lxml
travissetup: support
travissetup::
pip install html5lib html5validator

.PHONY: setup
setup:
setup::
sudo apt-get install libwww-perl libcss-dom-perl perl phantomjs python2.7 python-pip python-lxml cmake
sudo pip install html5lib html5validator

Expand Down

0 comments on commit 6ff1724

Please sign in to comment.