forked from nexusformat/definitions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
105 lines (87 loc) · 3.89 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# File: Makefile
# purpose:
# build resources in NeXus definitions tree
PYTHON = python3
SPHINX = sphinx-build
BUILD_DIR = "build"
.PHONY: help install style autoformat test clean prepare html pdf impatient-guide all local
help ::
@echo ""
@echo "NeXus: Testing the NXDL files and building the documentation:"
@echo ""
@echo "make install Install all requirements to run tests and builds."
@echo "make style Check python coding style."
@echo "make autoformat Format all files to the coding style conventions."
@echo "make test Run NXDL syntax and documentation tests."
@echo "make clean Remove all build files."
@echo "make prepare (Re)create all build files."
@echo "make html Build HTML version of manual. Requires prepare first."
@echo "make pdf Build PDF version of manual. Requires prepare first."
@echo "make impatient-guide Build html & PDF versions of the Guide for the Impatient. Requires prepare first."
@echo "make all Builds complete web site for the manual (in build directory)."
@echo "make local (Developer use) Test, prepare and build the HTML manual."
@echo ""
@echo "Note: All builds of the manual will occur in the 'build/' directory."
@echo " For a complete build, run 'make all' in the root directory."
@echo " Developers of the NeXus class definitions can use 'make local' to"
@echo " confirm the documentation builds."
@echo ""
install ::
$(PYTHON) -m pip install -r requirements.txt
style ::
$(PYTHON) -m black --check dev_tools
$(PYTHON) -m flake8 dev_tools
$(PYTHON) -m isort --check dev_tools
autoformat ::
$(PYTHON) -m black dev_tools
$(PYTHON) -m isort dev_tools
test ::
$(PYTHON) -m pytest dev_tools
clean ::
$(RM) -rf $(BUILD_DIR)
prepare ::
$(PYTHON) -m dev_tools manual --prepare --build-root $(BUILD_DIR)
$(PYTHON) -m dev_tools impatient --prepare --build-root $(BUILD_DIR)
pdf ::
$(SPHINX) -M latexpdf $(BUILD_DIR)/manual/source/ $(BUILD_DIR)/manual/build
cp $(BUILD_DIR)/manual/build/latex/nexus.pdf $(BUILD_DIR)/manual/source/_static/NeXusManual.pdf
html ::
$(SPHINX) -b html -W $(BUILD_DIR)/manual/source/ $(BUILD_DIR)/manual/build/html
impatient-guide ::
$(SPHINX) -b html -W $(BUILD_DIR)/impatient-guide/ $(BUILD_DIR)/impatient-guide/build/html
$(SPHINX) -M latexpdf $(BUILD_DIR)/impatient-guide/ $(BUILD_DIR)/impatient-guide/build
cp $(BUILD_DIR)/impatient-guide/build/latex/NXImpatient.pdf $(BUILD_DIR)/manual/source/_static/NXImpatient.pdf
# for developer's use on local build host
local ::
$(MAKE) test
$(MAKE) prepare
$(MAKE) html
all ::
$(MAKE) clean
$(MAKE) prepare
$(MAKE) impatient-guide
$(MAKE) pdf
$(MAKE) html
@echo "HTML built: `ls -lAFgh $(BUILD_DIR)/impatient-guide/build/html/index.html`"
@echo "PDF built: `ls -lAFgh $(BUILD_DIR)/impatient-guide/build/latex/NXImpatient.pdf`"
@echo "HTML built: `ls -lAFgh $(BUILD_DIR)/manual/build/html/index.html`"
@echo "PDF built: `ls -lAFgh $(BUILD_DIR)/manual/build/latex/nexus.pdf`"
# NeXus - Neutron and X-ray Common Data Format
#
# Copyright (C) 2008-2022 NeXus International Advisory Committee (NIAC)
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 3 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# For further information, see http://www.nexusformat.org