Eric Kunze | 3309a53 | 2020-10-01 18:50:46 -0700 | [diff] [blame] | 1 | # |
| 2 | # This confidential and proprietary software may be used only as |
| 3 | # authorised by a licensing agreement from ARM Limited |
Eric Kunze | a3eded0 | 2021-12-13 15:40:04 -0800 | [diff] [blame] | 4 | # (C) COPYRIGHT 2020-2022 ARM Limited |
Eric Kunze | 3309a53 | 2020-10-01 18:50:46 -0700 | [diff] [blame] | 5 | # 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 Kunze | f5ddd92 | 2022-06-14 23:39:42 -0700 | [diff] [blame] | 11 | TOSAREVISION=0.30.0 |
Eric Kunze | 3309a53 | 2020-10-01 18:50:46 -0700 | [diff] [blame] | 12 | MKDIR=mkdir -p |
| 13 | ASCIIDOC=asciidoctor |
Eric Kunze | a3eded0 | 2021-12-13 15:40:04 -0800 | [diff] [blame] | 14 | ASPELL=aspell |
Eric Kunze | a1ba656 | 2022-03-31 09:53:16 -0700 | [diff] [blame] | 15 | SHELL=/bin/bash -o pipefail |
Eric Kunze | 3309a53 | 2020-10-01 18:50:46 -0700 | [diff] [blame] | 16 | |
| 17 | HTMLDIR=out/html |
| 18 | PDFDIR=out/pdf |
| 19 | |
| 20 | COMMON_ARGS= -a revnumber="$(TOSAREVISION)" |
| 21 | |
| 22 | SPECSRC := tosa_spec.adoc |
Eric Kunze | a3eded0 | 2021-12-13 15:40:04 -0800 | [diff] [blame] | 23 | ADOCFILES = $(wildcard chapters/[A-Za-z]*.adoc) |
| 24 | SPECFILES = $(ADOCFILES) tosa.css |
Eric Kunze | 44a1347 | 2021-08-12 11:01:14 -0700 | [diff] [blame] | 25 | FIGURES = $(wildcard figures/*.svg) |
Eric Kunze | 3309a53 | 2020-10-01 18:50:46 -0700 | [diff] [blame] | 26 | |
| 27 | .DELETE_ON_ERROR: |
| 28 | |
Eric Kunze | 44a1347 | 2021-08-12 11:01:14 -0700 | [diff] [blame] | 29 | .PHONY: all html pdf clean spell copy_html_figures |
Eric Kunze | 3309a53 | 2020-10-01 18:50:46 -0700 | [diff] [blame] | 30 | |
Eric Kunze | a3eded0 | 2021-12-13 15:40:04 -0800 | [diff] [blame] | 31 | all: spell html pdf |
Eric Kunze | 3309a53 | 2020-10-01 18:50:46 -0700 | [diff] [blame] | 32 | |
Eric Kunze | 44a1347 | 2021-08-12 11:01:14 -0700 | [diff] [blame] | 33 | html: copy_html_figures $(HTMLDIR)/tosa_spec.html |
Eric Kunze | 3309a53 | 2020-10-01 18:50:46 -0700 | [diff] [blame] | 34 | |
| 35 | pdf: $(PDFDIR)/tosa_spec.pdf |
| 36 | |
| 37 | clean: |
| 38 | $(RM) $(HTMLDIR)/tosa_spec.html |
Eric Kunze | 44a1347 | 2021-08-12 11:01:14 -0700 | [diff] [blame] | 39 | rm -rf $(HTMLDIR)/figures |
Eric Kunze | 3309a53 | 2020-10-01 18:50:46 -0700 | [diff] [blame] | 40 | $(RM) $(PDFDIR)/tosa_spec.pdf |
| 41 | |
Eric Kunze | a3eded0 | 2021-12-13 15:40:04 -0800 | [diff] [blame] | 42 | spell: out/spell.txt |
| 43 | |
Eric Kunze | 44a1347 | 2021-08-12 11:01:14 -0700 | [diff] [blame] | 44 | copy_html_figures: $(FIGURES) |
| 45 | $(MKDIR) -p $(HTMLDIR)/figures |
| 46 | cp $(FIGURES) $(HTMLDIR)/figures |
| 47 | |
Eric Kunze | a1ba656 | 2022-03-31 09:53:16 -0700 | [diff] [blame] | 48 | .PRECIOUS: out/spell.txt |
Eric Kunze | a3eded0 | 2021-12-13 15:40:04 -0800 | [diff] [blame] | 49 | out/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 Kunze | a1ba656 | 2022-03-31 09:53:16 -0700 | [diff] [blame] | 55 | @if [ -s $@ ] ; then \ |
| 56 | echo Spelling errors detected, check $@; exit 1; \ |
Eric Kunze | a3eded0 | 2021-12-13 15:40:04 -0800 | [diff] [blame] | 57 | else echo No spelling errors found ; \ |
| 58 | fi |
| 59 | |
Eric Kunze | 3309a53 | 2020-10-01 18:50:46 -0700 | [diff] [blame] | 60 | $(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 Kunze | a3eded0 | 2021-12-13 15:40:04 -0800 | [diff] [blame] | 67 | |
| 68 | .PHONY: FORCE |
| 69 | FORCE: |