forked from Materials-Consortia/OPTIMADE
-
Notifications
You must be signed in to change notification settings - Fork 0
/
GNUmakefile
141 lines (119 loc) · 3.81 KB
/
GNUmakefile
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
#---*- Makefile -*-------------------------------------------------------
#
# This is the makefile for the OPTIMADE specification
# It contains targets for creating formatted documents,
# auditing / testing the specification documents,
# and a few other helpers.
#
#
# Targets for formatted documents
#################################
#
# - html: renders a html version of the specification
# - pdf: renders a pdf version of the specification
#
#
# Targets for helpers for misc tasks
####################################
#
# - spell: runs an interactive spellchecker
#
#
# Extracting machine-readable parts of the specification
########################################################
#
# - tests/generated/<part>.<format>: extracts the corresponding
# part from the specification document and places the result
# in the target file.
#
# The following such targets exist:
# - tests/generated/Filter.ebnf
# - tests/generated/Number.ebnf
# - tests/generated/identifiers.pcre
# - tests/generated/numbers.pcre
# - tests/generated/strings.pcre
# - tests/generated/identifiers.ere
# - tests/generated/numbers.ere
# - tests/generated/strings.ere
#
#
# Targets for testing / auditing the specification
##################################################
#
# Note: the distinction of 'test'-type and 'audit'-type targets is:
#
# - A 'test' target returns successfully if the test
# could run, even if the test failed.
# - An 'audit' target returns unsuccessfully if the test fails.
#
# These are the targets:
#
# - audit: runs the full suite of audit targets
#
# - docker_audit: dynamically builds a docker image and
# runs the full suite of audit targets inside it.
#
# - docker_rebuild_grammar_tests: dynamically builds a docker image
# which is then used to reinitialize the "out" files that record
# how the grammar parses example inputs, which will then be used
# for future grammar audits.
#
# - audit_grammar: audits the filter language grammar included
# in the specification
#
# - audit_authors: audits the AUTHORS file
#
# - audit_spelling: presently a placeholder where we will add audit
# of the spelling of the specification
#
# - tests: runs the grammar tests
#
# - test_authors: runs tests on the AUTHORS file (checks order)
#
#
# Furthermore, there are some more granular targets specifically for
# testing the grammar.
#
# A typical interaction with the grammar test system runs tests in a
# test directory (tests/cases by default) and report if all tests
# pass.
# USAGE:
# make clean
# make distclean
# make tests
# make
# make run
# make run TEXT_TO_PARSE=filter.txt
# make run TEXT_TO_PARSE=filter.txt GRAMMAR=grammars/filters.ebnf
#------------------------------------------------------------------------------
# Include local configuration files from this directory:
MAKEFILE_DIR = tests/makefiles
MAKECONF_EXAMPLES = ${wildcard ${MAKEFILE_DIR}/Makeconf*.example}
MAKECONF_FILES = \
$(sort \
${filter-out %.example, \
${filter-out %~, ${wildcard ${MAKEFILE_DIR}/Makeconf*}}} \
${MAKECONF_EXAMPLES:%.example=%} \
)
ifneq ("${MAKECONF_FILES}","")
include ${MAKECONF_FILES}
endif
TOOL_DIR ?= tests/tools
PATH := ${PATH}:${TOOL_DIR}
# Make local customisable Makeconfig files:
Makecon%: Makecon%.example
test -f $@ || cp -v $< $@
test -f $@ && touch $@
#------------------------------------------------------------------------------
.PHONY: all
all:
#------------------------------------------------------------------------------
# Include Makefiles with additional rules for this directory:
MAKELOCAL_FILES = ${filter-out %~, ${wildcard ${MAKEFILE_DIR}/Makelocal*}}
ifneq ("${MAKELOCAL_FILES}","")
include ${MAKELOCAL_FILES}
endif
#------------------------------------------------------------------------------
.PHONY: clean distclean cleanAll
clean:
distclean cleanAll: clean ${DISTCLEAN_TARGETS}