forked from php/php-src
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
36 lines (25 loc) · 875 Bytes
/
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
# Makefile for php-src/docs
# Copyright (c) The PHP Group
# If people set these on the make command line, use 'em
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build
RSTFMT = rstfmt
RSTFMTFLAGS = -w 100
rwildcard = $(foreach d,$(wildcard $(1:=/*)),$(call rwildcard,$d,$2) $(filter $(subst *,%,$2),$d))
FILES = $(call rwildcard,$(SOURCEDIR),*.rst)
all : html
.PHONY : check-formatting clean html preflight
.SUFFIXES : # Disable legacy behavior
check-formatting :
$(RSTFMT) $(RSTFMTFLAGS) --check $(SOURCEDIR)
clean :
rm -rf -- $(wildcard $(SOURCEDIR)/.~ $(BUILDDIR))
html : preflight
$(SPHINXBUILD) -M $@ $(SOURCEDIR) $(BUILDDIR)
@printf 'Browse the \e]8;;%s\e\\%s\e]8;;\e\\.\n' \
"file://$(abspath $(BUILDDIR))/$@/index.$@" "php-src html docs locally"
preflight : $(SOURCEDIR)/.~
$(SOURCEDIR)/.~ : $(FILES)
$(RSTFMT) $(RSTFMTFLAGS) $?
touch $@