Skip to content

Commit

Permalink
LaTeX version of s390x ABI document
Browse files Browse the repository at this point in the history
This is a LaTeX version of the s390x ABI specification.  It is based on
version 1.02 published as a "referenced specification" by the Linux
Foundation at https://refspecs.linuxbase.org/

In addition to converting from DocBook/SGML to LaTeX, lots of minor
corrections and clarifications have been made to version 1.02 as well.
  • Loading branch information
aarnez committed Jan 21, 2021
1 parent ec339b4 commit 64c1969
Show file tree
Hide file tree
Showing 9 changed files with 5,941 additions and 122 deletions.
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
lzsabi_*.pdf
lzsabi_*.txt
lzsabi.tar.gz
s390-html
s390-*-html
s390-pdf
s390-*-pdf
s390x-html
s390x-*-html
s390x-pdf
s390x-*-pdf
476 changes: 355 additions & 121 deletions LICENSE

Large diffs are not rendered by default.

80 changes: 80 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# s390x/s390 ABI specification -- Makefile
#
# Create various output formats from the source files. PDF is the
# default, others are experimental. While the s390x ABI (64 bit) is the
# main target, the s390 ABI (32 bit, preliminary) can be built as well.

MAIN = lzsabi
OTHERS = fdl-1.1 ibm-notices
INPUTS = $(MAIN) $(OTHERS)

TEX2PDF = latexmk -lualatex
TEX2HTML = make4ht --lua

# Conversion to plain text
HTML2TXT = elinks \
-dump -dump-charset ascii -dump-width 81 \
-no-references -no-numbering
# Sample command line with alternate tool
# HTML2TXT = w3m -dump -no-graph

LATEXDIFF = latexdiff --exclude-textcmd="section,subsection,subsubsection"

SUBDIRS = s390x-pdf s390-pdf s390x-html s390-html

PHONY := all tex pdf html txt

# Default target

all: $(MAIN)_s390x.pdf

# Prepare TeX source in separate subdirectories

$(SUBDIRS:=/$(MAIN).tex): $(INPUTS:=.tex)
mkdir -p $(dir $@) && cd $(dir $@) && \
ln -sf $(INPUTS:%=../%.tex) .

tex: $(SUBDIRS:=/index.tex)

s390x-%/index.tex: s390x-%/$(MAIN).tex $(OTHERS:=.tex)
printf '%s\n' '\newif\ifzseries\zseriestrue\input{lzsabi.tex}' > $@

s390-%/index.tex: s390-%/$(MAIN).tex $(OTHERS:=.tex)
printf '%s\n' '\newif\ifzseries\zseriesfalse\input{lzsabi.tex}' > $@

# PDF output
# Targets 'lzsabi_s390x.pdf', 'lzsabi_s390.pdf'

pdf: $(MAIN)_s390x.pdf $(MAIN)_s390.pdf

$(MAIN)_%.pdf: %-pdf/index.tex
cd $*-pdf && $(TEX2PDF) index.tex
mv $*-pdf/index.pdf $@

# HTML output
# Targets 's390x-html/index.html', 's390-html/index.html'

html: s390x-html/index.html s390-html/index.html

%-html/index.html: %-html/index.tex
cd $*-html && $(TEX2HTML) index.tex

# Plain text output
# Targets 'lzsabi_s390x.txt', 'lzsabi_s390.txt'

txt: $(MAIN)_s390x.txt $(MAIN)_s390.txt

$(MAIN)_%.txt: %-html/index.html
$(HTML2TXT) $< \
| sed 's/━/-/g; s/ *$$//' | cat - local-vars.txt > $@ \
|| rm -f $@

# Other targets

$(MAIN).tar.gz : $(MAIN).tex $(INPUTS:=.tex) $(MAIN).mk4 \
Makefile README.md LICENSE
tar -czf $@ $^

clean:
rm -rf $(SUBDIRS) s390x-*-html s390-*-html s390x-*-pdf s390-*-pdf
rm -rf *.patch $(MAIN)_*.pdf $(MAIN)_*.txt $(MAIN).tar.gz
47 changes: 46 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,47 @@
# s390x-abi
s390/s390x ABI specification

## Scope

This repository contains the LaTeX source for the s390x ELF ABI document.

## Usage

For advertised versions of the s390x ELF ABI specification, see the
project's ["Releases"][releases] section.

In order to build the PDF yourself from source, you need:

* a full TeX installation (such as [TeX Live][texlive])
* the [IBM Plex][plex] fonts
* GNU Make

Then just typing

$ make

should generate `lzsabi_s390x.pdf`.

Experimental support for other targets exists, such as for HTML output via
[TeX4ht][tex4ht], and for plain text with [ELinks][elinks]. See the
Makefile for more information.

## Reporting Issues

If you find an issue in the specification or in the LaTeX source, please
report it by creating a new [issue here][new-issue].

## License

This project is licensed under the GNU Free Documentation License, Version
1.1; with no Invariant Sections, with no Front-Cover Texts, and with no
Back-Cover Texts. More information can be found in the LICENSE file or
online at

https://www.gnu.org/licenses/old-licenses/fdl-1.1.txt

[elinks]: http://elinks.or.cz
[new-issue]: https://github.com/ibm/s390x-abi/issues/new
[plex]: https://github.com/IBM/plex
[releases]: https://github.com/IBM/s390x-abi/releases
[tex4ht]: https://tug.org/tex4ht
[texlive]: https://www.tug.org/texlive
Loading

0 comments on commit 64c1969

Please sign in to comment.