-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathMakefile
53 lines (48 loc) · 1.3 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
PHD_REPO=https://github.com/php/phd.git
DOC_BASE_REPO=https://github.com/php/doc-base.git
DOC_EN_REPO=https://github.com/php/doc-en.git
DOC_JA_REPO=https://github.com/php/doc-ja.git
OUTPUT_DIR=output/php-chunked-xhtml
setup:
@if [ ! -d "phd" ]; then \
echo "Cloning phd..."; \
git clone $(PHD_REPO); \
else \
echo "phd already cloned."; \
fi
@if [ ! -d "doc-base" ]; then \
echo "Cloning doc-base..."; \
git clone $(DOC_BASE_REPO); \
else \
echo "doc-base already cloned."; \
fi
@if [ ! -d "en" ]; then \
echo "Cloning doc-en..."; \
git clone $(DOC_EN_REPO) en; \
else \
echo "doc-en already cloned."; \
fi
@if [ ! -d "ja" ]; then \
echo "Cloning doc-ja..."; \
git clone $(DOC_JA_REPO) ja; \
else \
echo "doc-ja already cloned."; \
fi
build:
php doc-base/configure.php --with-lang=ja
xhtml:
php phd/render.php --docbook doc-base/.manual.xml --package PHP --format xhtml
open:
@if [ -f output/php-chunked-xhtml/index.html ]; then \
open output/php-chunked-xhtml/index.html; \
else \
echo "Output file not found: output/php-chunked-xhtml/index.html"; \
fi
open-modified:
@PATHS=$$(php bin/getModifiedFilePath.php); \
if [ -n "$$PATHS" ]; then \
echo "Opening: $$PATHS"; \
open $$PATHS || echo "Failed to open the file(s)."; \
else \
echo "Modified file not found."; \
fi