-
Notifications
You must be signed in to change notification settings - Fork 14
/
Makefile
62 lines (51 loc) · 2.08 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# Copyright 2023 seL4 Project a Series of LF Projects, LLC.
# SPDX-License-Identifier: BSD-2-Clause
SHELL := bash
.SHELLFLAGS := -eu -o pipefail -c
.ONESHELL:
MAKEFLAGS += --warn-undefined-variables --no-builtin-rules
.DELETE_ON_ERROR:
.SUFFIXES:
.PHONY: help build serve debug preview clean doctor checklinks update \
on_seL4
help:
@echo -e "Usage: make <target>. Available seL4 website targets:\n\
\n\
build Generate the static files and put them in _site/.\n\
serve Host site locally on port 4000 for previewing before commit.\n\
debug Host the development version of the site for local testing.\n\
clean Remove generated files.\n\
doctor Run jekyll doctor to check configuration.\n\
checklinks Runs html-proofer to check for broken links.\n\
update Updates all Ruby Gem versions to the newest available.\n\
help This help text.\n"
.jekyll-cache/ruby_deps: Gemfile Gemfile.lock
@bundle install
@mkdir -p .jekyll-cache/
@touch $@
JEKYLL_ENV := production
SERVE_HOST :=
build serve: .jekyll-cache/ruby_deps
# $(SERVE_HOST) is here so docker can pass in "--host 0.0.0.0" for serve
# otherwise this variable is not needed and by default empty
JEKYLL_ENV=$(JEKYLL_ENV) bundle exec jekyll $@ $(SERVE_HOST)
debug: JEKYLL_ENV := development
debug: serve
preview: JEKYLL_ENV := development
preview: SERVE_HOST := --config "_config.yml,_preview.yml" $(SERVE_HOST)
preview: build
on_seL4: SERVE_HOST := --config "_config.yml,_on_seL4.yml"
on_seL4: build
clean doctor:
@bundle exec jekyll $@
@rm -rf _preview/*
HTMLPROOFEROPT := --swap-urls '^https\://sel4.systems:http\://localhost\:4000'
HTMLPROOFEROPT += --enforce-https=false --only-4xx --disable-external=false
# comma-separated list of URL regexps, e.g. /twitter.com/,/facebook.com/
# twitter ignored because of rate limiting; query links on github work, but don't seem to check
# rtx.com produces 403 from GitHub
HTMLPROOFEROPT += --ignore-urls '/twitter.com/,/flaticon.com/,/github.com.seL4.rfcs.pulls\?q/,/rtx.com/'
checklinks:
@bundle exec htmlproofer $(HTMLPROOFEROPT) _site
update:
@bundle update