5
5
6
6
PYTHON = python3
7
7
SPHINX = sphinx-build
8
- BUILD_DIR = "build"
9
- BASE_CLASS_DIR := base_classes
10
- CONTRIB_DIR := contributed_definitions
11
- APPDEF_DIR := applications
12
- NXDL_DIRS := $(BASE_CLASS_DIR ) $(CONTRIB_DIR ) $(APPDEF_DIR )
13
- NYAML_SUBDIR := nyaml
14
- NYAML_APPENDIX := _parsed
8
+ BUILD_DIR = build
9
+ BASE_CLASS_DIR = base_classes
10
+ CONTRIB_DIR = contributed_definitions
11
+ APPDEF_DIR = applications
12
+ NYAML_SUBDIR = nyaml
15
13
16
- NXDL_BC : = $(wildcard $(BASE_CLASS_DIR ) /* .nxdl.xml )
17
- NXDL_CONTRIB : = $(wildcard $(CONTRIB_DIR ) /* .nxdl.xml )
18
- NXDL_APPDEF : = $(wildcard $(APPDEF_DIR ) /* .nxdl.xml )
14
+ YBC_NXDL_TARGETS = $(patsubst % .yaml, % .nxdl.xml, $( subst /nyaml/,/, $( wildcard $(BASE_CLASS_DIR ) /nyaml/ * .yaml) ) )
15
+ YCONTRIB_NXDL_TARGETS = $(patsubst % .yaml, % .nxdl.xml, $( subst /nyaml/,/, $( wildcard $(CONTRIB_DIR ) /nyaml/ * .yaml) ) )
16
+ YAPPDEF_NXDL_TARGETS = $(patsubst % .yaml, % .nxdl.xml, $( subst /nyaml/,/, $( wildcard $(APPDEF_DIR ) /nyaml/ * .yaml) ) )
19
17
20
- .PHONY : help install style autoformat test clean prepare html pdf impatient-guide all local nyaml nxdl
18
+
19
+ .PHONY : help install style autoformat test clean prepare html pdf impatient-guide all local nxdl nyaml
21
20
22
21
help ::
23
22
@echo " "
@@ -29,12 +28,15 @@ help ::
29
28
@echo "make autoformat Format all files to the coding style conventions."
30
29
@echo "make test Run NXDL syntax and documentation tests."
31
30
@echo "make clean Remove all build files."
31
+ @echo "make clean-nyaml Remove all nyaml files."
32
32
@echo "make prepare (Re)create all build files."
33
33
@echo "make html Build HTML version of manual. Requires prepare first."
34
34
@echo "make pdf Build PDF version of manual. Requires prepare first."
35
35
@echo "make impatient-guide Build html & PDF versions of the Guide for the Impatient. Requires prepare first."
36
36
@echo "make all Builds complete web site for the manual (in build directory)."
37
37
@echo "make local (Developer use) Test, prepare and build the HTML manual."
38
+ @echo "make nxdl Build NXDL files from NYAML files in nyaml subdirectories."
39
+ @echo "make nyaml Build NYAML files to nyaml subdirectories from NXDL files."
38
40
@echo ""
39
41
@echo "Note: All builds of the manual will occur in the 'build/' directory."
40
42
@echo " For a complete build, run 'make all' in the root directory."
@@ -99,27 +101,19 @@ all ::
99
101
@echo " PDF built: ` ls -lAFgh $( BUILD_DIR) /manual/build/latex/nexus-fairmat.pdf` "
100
102
101
103
$(BASE_CLASS_DIR ) /% .nxdl.xml : $(BASE_CLASS_DIR ) /$(NYAML_SUBDIR ) /% .yaml
102
- nyaml2nxdl $<
103
- mv $(BASE_CLASS_DIR ) /$(NYAML_SUBDIR ) /$* .nxdl.xml $@
104
+ nyaml2nxdl $< --output-file $@
104
105
105
106
$(CONTRIB_DIR ) /% .nxdl.xml : $(CONTRIB_DIR ) /$(NYAML_SUBDIR ) /% .yaml
106
- nyaml2nxdl $<
107
- mv $(CONTRIB_DIR ) /$(NYAML_SUBDIR ) /$* .nxdl.xml $@
107
+ nyaml2nxdl $< --output-file $@
108
108
109
109
$(APPDEF_DIR ) /% .nxdl.xml : $(APPDEF_DIR ) /$(NYAML_SUBDIR ) /% .yaml
110
- nyaml2nxdl $<
111
- mv $(APPDEF_DIR ) /$(NYAML_SUBDIR ) /$* .nxdl.xml $@
112
-
113
- NXDLS := $(NXDL_APPDEF ) $(NXDL_CONTRIB ) $(NXDL_BC )
114
- nyaml :
115
- for file in $( NXDLS) ; do\
116
- mkdir -p " $$ {file%/*}/nyaml" ; \
117
- nyaml2nxdl $$ {file}; \
118
- FNAME=$$ {file## */};\
119
- mv -- " $$ {file%.nxdl.xml}_parsed.yaml" " $$ {file%/*}/nyaml/$$ {FNAME%.nxdl.xml}.yaml" ; \
120
- done
121
-
122
- nxdl : $(NXDL_APPDEF ) $(NXDL_CONTRIB ) $(NXDL_BC )
110
+ nyaml2nxdl $< --output-file $@
111
+
112
+ nxdl : $(YBC_NXDL_TARGETS ) $(YCONTRIB_NXDL_TARGETS ) $(YAPPDEF_NXDL_TARGETS )
113
+
114
+ nyaml :
115
+ $(MAKE ) -f nyaml.mk
116
+
123
117
124
118
# NeXus - Neutron and X-ray Common Data Format
125
119
#
0 commit comments