Commit Graph

22 Commits

Author SHA1 Message Date
Oliver Smith 5275f262c8 Makefile.asciidoc.inc: warnings check not default
Only check for asciidoc warnings in "make check" if
ASCIIDOC_WARNINGS_CHECK is set. Enable it in jenkins.sh by using the
new ./configure --enable-asciidoc-warnings-check parameter (similar to
--enable-werror in other Osmocom projects' configure.ac files).

Related: OS#4140
Change-Id: Iac993a0d1b17205397a1f1ef1a7bd3f9df739e36
2019-08-05 17:50:35 +00:00
Oliver Smith 2d5d6c54e8 Makefile.asciidoc.inc: always run verbose asciidoc
a2x is a "toolchain manager" for asciidoc, that runs the asciidoc
command internally. Replace the previous logic of first running a2x
without any verbose flags, and on failure running asciidoc standalone,
with a verbose flag, to print the errors the occured. Always run a2x
with -vv, so it runs asciidoc in verbose mode.

This prevents losing the error message in case asciidoc or a2x fail
when running with a2x, but then asciidoc succeeds when running
standalone.

Related: OS#4132
Change-Id: I2cbd2985645ecdecc7851849be6a9a95d4b3246e
2019-08-05 17:50:35 +00:00
Pau Espin 66f7bea317 Makefile.asciidoc.inc: Export commondir attribute to asciidoc files
Otherwise, adoc files in osmo-*/doc/manuals/chapters/*.adoc cannot
include files from osmo-gsm-manuals/common/chapters/*.adoc, since
symbolic link to common/ is only available in builddir, but not in
srcdir.

This way, those files can include commons files like this:
include::{commondir}/chapters/foobar.adoc

Change-Id: Ifc2fdaf1a87d0715213b4eab13c6c9a4f8a987fd
2019-07-19 16:39:13 +02:00
Oliver Smith 99b7cd1775 *.adoc: use {srcdir} for out-of-tree builds
Define a new {srcdir} variable in Makefile.asciidoc.inc, that can be
used in all adoc files. The value is the same as the Makefile variable
$(srcdir). Use {srcdir} in the "include::" lines of all adoc files.

(moving manuals to project repositories 13/19)

Related: OS#3385
Change-Id: I823e3d534cbc9ffceb68d3ab14c9f6710ff2eb2a
2018-11-21 14:37:49 +01:00
Oliver Smith 2682f14611 Makefile.*.inc: adjust to out-of-tree building
Makefile.asciidoc.inc: create a symlink for the root adoc file, from
which a PDF gets generated, from the srcdir to the builddir. This file
may include other adoc files, which do not get symlinked. We need to do
this, because a2x (the program generating the PDF file) does not have a
parameter for the output file, and will otherwise generate the PDF in
the srcdir instead of the builddir. Do the same in the check target, so
the relative include paths work the same.

Makefile.asciidoc.inc, Makefile.docbook.inc: set the include paths for
the xstl parser, as well as the LaTeX compiler, so they can find the
files they need from both OSMO_GSM_MANUALS_DIR and builddir.

Makefile.asciidoc.inc, Makefile.docbook.inc: refer to the output file
$@ with $(notdir $@). This removes the path from the file, like
basename from coreutils. The output file will then be placed in the
builddir instead of the srcdir.

Makefile.vty-reference.inc: use $(srcdir) in references to vty/*.xml
files.

(moving manuals to project repositories 12/19)

Related: OS#3385
Change-Id: Ie6b212a6518f0fc29fae610a37ae6c533189278d
2018-11-21 14:35:03 +01:00
Oliver Smith e388d006f3 Osmo*/Makefile.am: use $(srcdir), $(top_srcdir)
Use $(srcdir) infront of all relative paths, which reference other
files in the repository. Use $(top_srcdir) as OSMO_GSM_MANUALS_DIR.
This is needed for out-of-tree building.

(moving manuals to project repositories 11/19)

Related: OS#3385
Change-Id: I2454d7507fae4e1c47458a1adf36f68e637f4bbc
2018-11-21 14:29:11 +01:00
Oliver Smith 06d1805c5b *filter.conf/*.sty: use symlinks to build, common
$(OSMO_GSM_MANUALS_DIR) is used in most places to reference to the top
dir, which contains "build" and "common". But not in the asciidoc
mscgen filter configurations, and in the custom LaTeX style. They have
../common or ../build hardcoded, which won't work anymore when the
project specific files will be in another repository.

Update the Makefiles to create symlinks to "build" and "common" in the
dir where the build was started. Use ./common in the files that had
../common hardcoded, and do the same for ./build.

Update the Makefile.common.inc comment to refer to common targets in
general, so we don't need to list each single one there (like the new
'common' and 'build' targets).

I've also thought about using variables there, but this would only work
for the asciidoc files, not for the .sty file. We would need to
generate the latter from another file and replace the variable
dynamically. Having the symlinks instead seemed to be slightly easier.

(moving manuals to project repositories 7/19)

Related: OS#3385
Change-Id: I4cfd1a9ef482d382f10cdf060e8e2cba81852864
2018-11-21 14:29:11 +01:00
Oliver Smith 8d282762d9 cosmetic: update usage of OSMO_GSM_MANUALS_DIR
OSMO_GSM_MANUALS_DIR should use pkg-config to figure out the location
of the shared osmo-gsm-manuals files.

(moving manuals to project repositories 6/19)

Related: OS#3385
Change-Id: I64cfffb5104edcf7a20f41aeb5bf8ee6988b57c4
2018-11-21 14:29:11 +01:00
Oliver Smith dec39cdea9 s/TOPDIR/OSMO_GSM_MANUALS_DIR/g
Replace TOPDIR with OSMO_GSM_MANUALS_DIR. When the project specific
manuals will be built out of this repository, we still need to refer to
the top directory of the shared content. But it will be in another
repository, so we need to rename the variable to avoid confusion.

(moving manuals to project repositories 3/19)

Related: OS#3385
Change-Id: I2af797546de048a6ab19a5cbc755e5e15575d7ab
2018-11-20 17:13:25 +01:00
Oliver Smith 712e2a2e3f make check: properly reference dependencies
Use $(ASCIIDOC_DEPS) instead of assuming that the value would be
"chapters/*.adoc". The variable exists already, but it was not used
yet in 'make check' of  Makefile.asciidoc.inc.

This allows creating a tests dir without its own chapters subdir
(follow-up commit), which is part of a larger effort to move manuals to
project repositories.

The reason for moving manuals to project repositories is that we can
have documentation changes together with code changes in the same
patches. Not part of this patchset, but possible in the future, is
optionally building UNIX man pages in the project repositories
(OS#3386) as well as generating the VTY documentation on the fly from
running the project binaries (OS#3695).

(moving manuals to project repositories 1/19)

Related: OS#3386
Change-Id: Id8b26759607a3490d6cbd93c68ba1f89aa8ef1f2
2018-11-20 17:13:25 +01:00
Oliver Smith e65d9efb31 Makefile.asciidoc.inc: make clean: also rm *.html
HTML files get created when a2x fails and asciidoc runs.

Change-Id: I4d5e9c36f75141ce88d11b16c89809be4dce87d8
2018-11-12 11:01:43 +01:00
Oliver Smith 0b9d46f883 Makefile.asciidoc.inc: always exit 1 on a2x error
a2x wraps asciidoc. When a2x fails, we run asciidoc without a2x to
print verbose output. Make sure that 'make' fails at this point, even
if asciidoc runs through.

Change-Id: I30931303ecc6094efaedcb08380433a34211a169
2018-11-12 10:58:04 +01:00
Neels Hofmeyr c481a988e3 refactor Makefile build rules, don't use the FORCE
The initial goal was to make sure we don't have overall FORCE rules causing
unnecessary rebuilds -- annoying while writing documentation. As I looked
through possible dependencies, I finally understood what's going on here.

Remove code dup and nicely sort which belongs where in build/Makefile.*.inc. In
each, describe in a top comment how to use it, and also unify how they are
used:

- Rename Makefile.inc to Makefile.docbook.inc and refactor
- Add Makefile.vty-reference.inc
- Add Makefile.common.inc

Make sure that we accurately pick up all dependencies.

Drop use of the macro called 'command', that silenced the actual command lines
invoked and replaced them with short strings: it obscures what is actually
going on and makes the Makefiles hard to read and understand.

Each manual's makefile is greatly reduced to few definitions and a Makefile
include, e.g. one for asciidoc, one for VTY reference.

Move common/bsc_vty_additions.xml to OsmoBSC/vty/libbsc_vty_additions.xml, link
from OsmoNITB. It applies only to OsmoBSC and OsmoNITB.

Add a script that combines a VTY reference file with *all* additions files
found in a manual's vty/ dir. Call this from Makefile.vty-reference.inc.

Change-Id: I9758e04162a480e28c7dc83475b514cf7fd25ec0
2017-10-25 16:51:55 +00:00
Neels Hofmeyr 0e3e4c217a fix make deps: join hint_to_remove_draft_mode to build step
Change-Id: Iecf8e18ce2f1dac61bf55019e1fec601b33abb95
2017-09-19 02:43:28 +02:00
Pau Espin 36cc3e748c osmux-reference: Add traffic saving plot
Change-Id: I8fa60c1f95436c39fd1ff9424a907876d367484e
2017-07-19 16:24:29 +02:00
Neels Hofmeyr 3e646810f0 all: show 'DRAFT' watermark on the first page
Unconditionally show a 'DRAFT' watermark only on the first page of each
document.

I would have liked to make this conditional based on the BUILD_RELEASE=*
variable, but could not figure out how to switch off a .sty code segment based
on command line parameters.

Since we only seem to render all manuals in DRAFT mode all the time, it seems
reasonable to include the DRAFT watermark always, requiring manual .sty editing
if anyone wanted to build a non-DRAFT version.

In the makefile, add an echo to say so in case of non-draft builds.

Change-Id: Ia71795481c2467aab11ab344517df74775b2a852
2017-06-12 22:15:30 +00:00
Neels Hofmeyr 3341330f3a all: show 'DRAFT' in page header, disable DRAFT watermark
The 'DRAFT' watermark in the page background is a hindrance when trying to
copy-paste text from the rendered PDFs. It segments the texts so that many code
lines cannot be marked in whole to copy.

So drop the watermark and instead just show 'DRAFT' in the page header.

Change-Id: Ie22cdddf46bf7640e7f027940a6db904bf639142
2017-06-12 22:15:12 +00:00
Neels Hofmeyr 6dc47a8dd9 cosmetic: build: on a2x failure, use asciidoc -v and $ASCIIDOC_OPTS
This is only used to output warnings in case the a2x build failed.
Use ASCIIDOC_OPTS instead of repeating the same options (with one missing)
and add verbose output by asciidoc.

Change-Id: I6135ba1a3e46610eea6089e2218f1024c49054be
2016-10-18 17:11:22 +02:00
Neels Hofmeyr b156e76469 add 'make check' target
Generate *.check files from asciidoc output and grep for WARNINGs.
Add *.check files to gitignore and to 'make clean'.

Change-Id: Ibccc83a3415930a528f2e8e4e4dda3b81c6d0b64
2016-10-18 17:11:21 +02:00
Neels Hofmeyr e2ba56ccce portability: use py script instead of 'date -d @1234'
On FreeBSD, the 'date' command's -d option has a completely different meaning.
Instead, use a small python script to do the date format conversion, which
should be more portable.

As a side effect, we now also use UTC instead of the build server's timezone,
which may be considered a more international choice.

Add build/unix-time-to-fmt.py, call in build/Makefile.asciidoc.inc.

Change-Id: I91a40656184f553ee375216d8ba5c7788fe9990d
2016-10-18 14:27:53 +02:00
Harald Welte 5fcea8028d Ensure the git version + commit date ends up in PDF
This is a bit awkward, as the 'revnumber' asciidoc variable so far
doesn't seem to end up in the docbook-xml.  We now put it into
'releaseinfo' which gets then put into \DBKreleeaseinfo by dblatex.

makefile watermark fixup
2016-02-20 18:28:37 +01:00
Harald Welte 37ba7a9825 initial checkin of manuals to public repo
The manuals existed in different form for several years in an internal
sysmocom repository.  However, since they had just recently been
converted from docboox-xml to asciidoc and all files have been
re-shuffled for enabling the public release, there's not much point in
keeping the history with git-filter-branch.
2016-02-20 15:01:50 +01:00