2
0
mirror of https://github.com/erlang/spec.git synced 2026-04-15 01:13:34 +00:00

Make it build

This commit is contained in:
Rickard Green
2017-10-19 15:02:16 +02:00
parent 9582ee3935
commit 250d76180d
6 changed files with 175 additions and 21 deletions

16
.gitignore vendored Normal file
View File

@@ -0,0 +1,16 @@
aux-files
TAGS
*-gram.tex
*.aux
*.bbl
*.dvi
*.idx
*.ind
*.log
*.toc
*.ilg
*.ps
*.pdf
*.blg
*.prev

43
Makefile Normal file
View File

@@ -0,0 +1,43 @@
#
# %CopyrightBegin%
#
# Copyright Ericsson AB 2017. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# %CopyrightEnd%
#
RM_F=/bin/rm -f
CP=/bin/cp
.SECONDARY:
.PHONY: src_ps src_pdf
ps: src_ps erlang-spec.ps
pdf: src_pdf erlang-spec.pdf
src_ps:
(cd src && $(MAKE) es.ps)
src_pdf:
(cd src && $(MAKE) es.pdf)
erlang-spec.%: src/es.%
$(CP) $< $@
clean:
(cd src && $(MAKE) clean)
$(RM_F) erlang-spec.ps erlang-spec.pdf

66
bin/fixpoint Executable file
View File

@@ -0,0 +1,66 @@
#!/bin/sh
#
# %CopyrightBegin%
#
# Copyright Ericsson AB 2017. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# %CopyrightEnd%
#
#
# Usage:
# fixpoint <output files> -- <command>
#
# This script repeatedly runs <command> until all <output files>
# stops changing between runs. This of course does not work well
# with any arbitrary command :-)
#
files=
while [ $# -gt 0 ]; do
if [ "$1" = "--" ]; then
shift
cmd=${1+"$@"}
break;
fi
files="$files $1"
shift
done
if [ "$cmd" = "" ]; then
echo "$prog: Missing command" 1>&2
exit 1
fi
changed=true
echo $files
while [ $changed = true ]; do
echo $cmd
eval $cmd 1>/dev/null 2>/dev/null
changed=false
for f in $files; do
[ -e "$f" ] || { echo "Missing $f" 1>&2; exit 1; }
if [ -e "$f.prev" ]; then
diff "$f" "$f.prev" 1>/dev/null 2>/dev/null || changed=true
else
changed=true
fi
cp "$f" "$f.prev"
done
done

View File

@@ -19,15 +19,13 @@
#
LATEX=latex
#LATEX=/opt/texmf/bin/latex
DVIPS=dvips -r0
#DVIPS=/opt/texmf/bin/dvips -r0
BIBTEX=bibtex
#BIBTEX=/opt/texmf/bin/bibtex
MAKEINDEX=makeindex
TWOPAGE=${HOME}/Bin/2up
#EXTRACT=${HOME}/Bin/extract_grrules
EXTRACT=extract_grrules
TWOPAGE=2up
EXTRACT=../bin/extract_grrules
FIXPOINT=../bin/fixpoint
RM_F=/bin/rm -f
SOURC1=es-lexical-structure.tex
@@ -59,6 +57,13 @@ SOURC0=es-release-notes.tex \
SOURCE=es.tex $(SOURC0) $(SOURC1) $(SOURC2) $(SOURC3)
SOURCE_TEX=$(filter %.tex,$(SOURCE))
GEN_GRAM_TEX=es-lex-gram.tex \
es-main-gram.tex \
es-preproc-gram.tex
AUX_FILES=$(patsubst %.tex,%.aux,$(SOURCE_TEX)) es.idx
all: full TAGS
full: es.ps
@@ -67,6 +72,10 @@ full: es.ps
TAGS: $(SOURCE)
etags $(SOURCE)
aux-files: $(GEN_GRAM_TEX)
$(LATEX) es 1>/dev/null 2>/dev/null
touch aux-files
es.2up.ps: es.ps
$(TWOPAGE) es.ps > es.2up.ps
@@ -74,8 +83,11 @@ es.ps: es.dvi
$(DVIPS) -o es.ps es
chmod a+r es.ps
es.dvi: $(SOURCE) es-lex-gram.tex es-main-gram.tex es-preproc-gram.tex es.bbl es.ind
$(LATEX) es
es.dvi: $(SOURCE) aux-files $(GEN_GRAM_TEX) es.bbl es.ind
$(FIXPOINT) $(AUX_FILES) -- $(LATEX) es
es.pdf: $(SOURCE) aux-files $(GEN_GRAM_TEX) es.bbl es.ind
$(FIXPOINT) $(AUX_FILES) -- pdflatex es
old.2up.ps: old.ps
$(TWOPAGE) old.ps > old.2up.ps
@@ -84,7 +96,7 @@ old.ps: old.dvi
$(DVIPS) -o old.ps old
chmod a+r old.ps
old.dvi: $(SOURCE) es-lex-gram.tex es-main-gram.tex es-preproc-gram.tex old.bbl old.ind
old.dvi: $(SOURCE) $(GEN_GRAM_TEX) old.bbl old.ind
$(LATEX) old
std.2up.ps: std.ps
@@ -94,7 +106,7 @@ std.ps: std.dvi
$(DVIPS) -o std.ps std
chmod a+r std.ps
std.dvi: $(SOURCE) es-lex-gram.tex es-main-gram.tex es-preproc-gram.tex std.bbl std.ind
std.dvi: $(SOURCE) $(GEN_GRAM_TEX) std.bbl std.ind
$(LATEX) std
es-lex-gram.tex: $(EXTRACT) $(SOURC1)
@@ -106,13 +118,13 @@ es-main-gram.tex: $(EXTRACT) $(SOURC2)
es-preproc-gram.tex: $(EXTRACT) $(SOURC3)
$(EXTRACT) $(SOURC3) > es-preproc-gram.tex
es.bbl: es.bib $(SOURCE)
es.bbl: aux-files es.bib $(SOURCE)
$(BIBTEX) es
es.ind: es.idx
es.ind: aux-files
$(MAKEINDEX) es
es.idx: $(SOURCE) es-lex-gram.tex es-main-gram.tex es-preproc-gram.tex
es.idx: $(SOURCE) $(GEN_GRAM_TEX)
old.bbl: es.bib $(SOURCE)
$(BIBTEX) old
@@ -120,7 +132,7 @@ old.bbl: es.bib $(SOURCE)
old.ind: old.idx
$(MAKEINDEX) old
old.idx: $(SOURCE) es-lex-gram.tex es-main-gram.tex es-preproc-gram.tex
old.idx: $(SOURCE) $(GEN_GRAM_TEX)
std.bbl: es.bib $(SOURCE)
$(BIBTEX) std
@@ -128,7 +140,7 @@ std.bbl: es.bib $(SOURCE)
std.ind: std.idx
$(MAKEINDEX) std
std.idx: $(SOURCE) es-lex-gram.tex es-main-gram.tex es-preproc-gram.tex
std.idx: $(SOURCE) $(GEN_GRAM_TEX)
es-separate-grammar.ps: es-separate-grammar.dvi
$(DVIPS) -o es-separate-grammar.ps es-separate-grammar
@@ -136,3 +148,20 @@ es-separate-grammar.ps: es-separate-grammar.dvi
es-separate-grammar.dvi: es-separate-grammar.tex
$(LATEX) es-separate-grammar.tex
clean:
$(RM_F) aux-files
$(RM_F) TAGS
$(RM_F) *-gram.tex
$(RM_F) *.aux
$(RM_F) *.prev
$(RM_F) *.bbl
$(RM_F) *.dvi
$(RM_F) *.idx
$(RM_F) *.ind
$(RM_F) *.log
$(RM_F) *.toc
$(RM_F) *.ilg
$(RM_F) *.ps
$(RM_F) *.pdf
$(RM_F) *.blg

View File

@@ -20,7 +20,7 @@
% Choose one of the following
%\newcommand{\STYLE}{0} % For \OldErlang
%\newcommand{\STYLE}{1} % For \StdErlang
\newcommand{\STYLE}{1} % For \StdErlang
%Choose draft until we're almost there.
\newif\ifdraft
@@ -60,10 +60,10 @@
% Not yet available!
%\usepackage{pict2e} % Better pictures.
\usepackage{grammar} % Grammar rules.
\ifdraft
\usepackage{draftstamp} % Print ``Draft'' shaded on pages.
\usepackage{drafthead} % Print ``Draft'' etc as page header.
\fi
%\ifdraft
%\usepackage{draftstamp} % Print ``Draft'' shaded on pages.
%\usepackage{drafthead} % Print ``Draft'' etc as page header.
%\fi
%\usepackage{calc}
\usepackage{ifthen}
\usepackage{makeidx}
@@ -72,7 +72,7 @@
\ifdraft
\newcommand{\draftvsn}{0.7}
\newcommand{\Draft}[1]{\textsc{Draft}~#1}
\renewcommand{\draftheadnote}{\Draft{\draftvsn}}
%\renewcommand{\draftheadnote}{\Draft{\draftvsn}}
\fi
\newif\ifOld \if1\STYLE\Oldfalse\else\Oldtrue\fi