blob: 2b53d223b5c9a0af304c26aca77ec68fbef3c293 [file] [log] [blame]
Eric Kunze3309a532020-10-01 18:50:46 -07001#
2# This confidential and proprietary software may be used only as
3# authorised by a licensing agreement from ARM Limited
Eric Kunzea3eded02021-12-13 15:40:04 -08004# (C) COPYRIGHT 2020-2022 ARM Limited
Eric Kunze3309a532020-10-01 18:50:46 -07005# ALL RIGHTS RESERVED
6# The entire notice above must be reproduced on all authorised
7# copies and copies may only be made to the extent permitted
8# by a licensing agreement from ARM Limited.
9#
10
Eric Kunzef5ddd922022-06-14 23:39:42 -070011TOSAREVISION=0.30.0
Eric Kunze3309a532020-10-01 18:50:46 -070012MKDIR=mkdir -p
13ASCIIDOC=asciidoctor
Eric Kunzea3eded02021-12-13 15:40:04 -080014ASPELL=aspell
Eric Kunzea1ba6562022-03-31 09:53:16 -070015SHELL=/bin/bash -o pipefail
Eric Kunze3309a532020-10-01 18:50:46 -070016
17HTMLDIR=out/html
18PDFDIR=out/pdf
19
20COMMON_ARGS= -a revnumber="$(TOSAREVISION)"
21
22SPECSRC := tosa_spec.adoc
Eric Kunzea3eded02021-12-13 15:40:04 -080023ADOCFILES = $(wildcard chapters/[A-Za-z]*.adoc)
24SPECFILES = $(ADOCFILES) tosa.css
Eric Kunze44a13472021-08-12 11:01:14 -070025FIGURES = $(wildcard figures/*.svg)
Eric Kunze3309a532020-10-01 18:50:46 -070026
27.DELETE_ON_ERROR:
28
Eric Kunze44a13472021-08-12 11:01:14 -070029.PHONY: all html pdf clean spell copy_html_figures
Eric Kunze3309a532020-10-01 18:50:46 -070030
Eric Kunzea3eded02021-12-13 15:40:04 -080031all: spell html pdf
Eric Kunze3309a532020-10-01 18:50:46 -070032
Eric Kunze44a13472021-08-12 11:01:14 -070033html: copy_html_figures $(HTMLDIR)/tosa_spec.html
Eric Kunze3309a532020-10-01 18:50:46 -070034
35pdf: $(PDFDIR)/tosa_spec.pdf
36
37clean:
38 $(RM) $(HTMLDIR)/tosa_spec.html
Eric Kunze44a13472021-08-12 11:01:14 -070039 rm -rf $(HTMLDIR)/figures
Eric Kunze3309a532020-10-01 18:50:46 -070040 $(RM) $(PDFDIR)/tosa_spec.pdf
41
Eric Kunzea3eded02021-12-13 15:40:04 -080042spell: out/spell.txt
43
Eric Kunze44a13472021-08-12 11:01:14 -070044copy_html_figures: $(FIGURES)
45 $(MKDIR) -p $(HTMLDIR)/figures
46 cp $(FIGURES) $(HTMLDIR)/figures
47
Eric Kunzea1ba6562022-03-31 09:53:16 -070048.PRECIOUS: out/spell.txt
Eric Kunzea3eded02021-12-13 15:40:04 -080049out/spell.txt: $(ADOCFILES) FORCE
50 @echo Running spell check
51 @mkdir -p $(@D)
52 @tools/get_descriptions.py $(ADOCFILES) \
53 | $(ASPELL) list -v -l en-US --encoding=UTF-8 --add-extra-dicts=./tools/dictionary.dic\
54 | sort -u > $@
Eric Kunzea1ba6562022-03-31 09:53:16 -070055 @if [ -s $@ ] ; then \
56 echo Spelling errors detected, check $@; exit 1; \
Eric Kunzea3eded02021-12-13 15:40:04 -080057 else echo No spelling errors found ; \
58 fi
59
Eric Kunze3309a532020-10-01 18:50:46 -070060$(HTMLDIR)/tosa_spec.html: $(SPECSRC) $(SPECFILES)
61 $(MKDIR) $(HTMLDIR)
62 $(ASCIIDOC) -b html5 -a stylesheet=tosa.css $(COMMON_ARGS) -o $@ $<
63
64$(PDFDIR)/tosa_spec.pdf: $(SPECSRC) $(SPECFILES)
65 $(MKDIR) $(PDFDIR)
66 $(ASCIIDOC) -r asciidoctor-pdf -b pdf $(COMMON_ARGS) -o $@ $(SPECSRC)
Eric Kunzea3eded02021-12-13 15:40:04 -080067
68.PHONY: FORCE
69FORCE: