This machinery is taken from the TrIPE project.
###--------------------------------------------------------------------------
### Subdirectories to build
+## Common infrastructure.
+SUBDIRS += common
+
## The SOD translator.
SUBDIRS += src
--- /dev/null
+### -*-makefile-*-
+###
+### Makefile for Sod common source files
+###
+### (c) 2020 Straylight/Edgeware
+###
+
+###----- Licensing notice ---------------------------------------------------
+###
+### This file is part of the Sensible Object Design, an object system for C.
+###
+### SOD is free software: you can redistribute it and/or modify it under
+### the terms of the GNU General Public License as published by the Free
+### Software Foundation; either version 2 of the License, or (at your
+### option) any later version.
+###
+### SOD is distributed in the hope that it will be useful, but WITHOUT ANY
+### WARRANTY; without even the implied warranty of MERCHANTABILITY or
+### FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+### for more details.
+###
+### You should have received a copy of the GNU General Public License
+### along with SOD. If not, write to the Free Software Foundation, Inc.,
+### 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+include $(top_srcdir)/vars.am
+
+###--------------------------------------------------------------------------
+### Documentation.
+
+## Standard manpage preamble.
+EXTRA_DIST += defs.man
+
+###----- That's all, folks --------------------------------------------------
--- /dev/null
+.\" -*-nroff-*-
+.\"
+.\" Common definitions for Sod manpages
+.\"
+.\" (c) 2008 Straylight/Edgeware
+.\"
+.
+.\"----- Licensing notice ---------------------------------------------------
+.\"
+.\" This file is part of the Sensible Object Design, an object system for C.
+.\"
+.\" SOD is free software; you can redistribute it and/or modify
+.\" it under the terms of the GNU Library General Public License as
+.\" published by the Free Software Foundation; either version 2 of the
+.\" License, or (at your option) any later version.
+.\"
+.\" SOD is distributed in the hope that it will be useful,
+.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
+.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+.\" GNU Library General Public License for more details.
+.\"
+.\" You should have received a copy of the GNU Library General Public
+.\" License along with SOD; if not, write to the Free
+.\" Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+.\" MA 02111-1307, USA.
+.
+.\"--------------------------------------------------------------------------
+.\" Preliminary definitions.
+.
+.\" Font selection.
+.ie t \{\
+. if \n(.g \{\
+. fam P
+. ev an-1
+. fam P
+. ev
+. \}
+.\}
+.
+.\" Character definitions.
+.ie t \{\
+. ds o \(bu \" bullet for lists
+. ds e \(*e \" empty nonterminal
+. ds ^ \v'-.3m'\s'\\n(.s*7/10' \" begin superscript
+. ds ^e \s0\v'.3m' \" end superscript
+. ds _ \v'.3m'\s'\\n(.s*7/10' \" begin subscript
+. ds _e \s0\v'-.3m' \" end subscript
+.\}
+.el \{\
+. ds o o \" bullet for lists
+. ds e \fIe\fR \" empty nonterminal
+. ds ^ ^ \" begin superscript
+. ds ^e \" end superscript
+. ds _ _ \" begin subscript
+. ds _e \" end subscript
+.\}
+.ds * \*^\(**\*(^e \" superscript `*' (zero or more)
+.ds + \*^+\*(^e \" superscript `+' (one or more)
+.
+.\" .hP TEXT -- start an indented paragraph with TEXT hanging off to the left
+.de hP
+.IP
+\h'-\w'\fB\\$1\ \fP'u'\fB\\$1\ \fP\c
+..
+.
+.\" .SP -- equivalent to .TP, but indicates item should be summarized
+.de SP
+.TP
+..
+.
+.\" .VS ... .VE -- present a code example
+.de VS
+.sp 1
+.RS
+.nf
+.ft B
+..
+.de VE
+.ft R
+.fi
+.RE
+.sp 1
+..
+.
+.\" .t( ... .t) -- tabbing: align contents at current horizontal position
+.de t(
+'in +\\n(.ku
+..
+.de t)
+.in
+..
+.
+.\" .| -- syntax alternative on a new line
+.de |
+.br
+\h'4n'|
+..
+.
+.\" .< -- newline and indent only in nroff mode (for shorter lines)
+.ie t \{\
+. de <
+..
+.\}
+.el \{
+. de <
+. br
+\h'4n'
+..
+.\}
+.
+.\"----- That's all, folks --------------------------------------------------
AC_CONFIG_FILES(
[Makefile]
+ [common/Makefile]
[src/Makefile]
[lib/Makefile]
[doc/Makefile]
pkginclude_HEADERS += keyword.h
libsod_la_SOURCES += keyword.c keyword-hosted.c
-dist_man_MANS += keyword.3
+man_MANS += keyword.3
+CLEANFILES += keyword.3
+EXTRA_DIST += keyword.3.in
pkginclude_HEADERS += sod.h
libsod_la_SOURCES += sod.c sod-hosted.c
-dist_man_MANS += sod.3
+man_MANS += sod.3
+CLEANFILES += sod.3
+EXTRA_DIST += sod.3.in
###--------------------------------------------------------------------------
### Generated builtin module.
###--------------------------------------------------------------------------
### Other manual pages.
-dist_man_MANS += sod-structs.3
+man_MANS += sod-structs.3
+CLEANFILES += sod-structs.3
+EXTRA_DIST += sod-structs.3.in
###----- That's all, folks --------------------------------------------------
.\" Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
.\" MA 02111-1307, USA.
.
-.\" Highlight using terminal escapes, rather than overstriking.
-.\"\X'tty: sgr 1'
-.
-.\" String definitions and font selection.
-.ie t \{\
-. ds o \(bu
-. if \n(.g .fam P
-.\}
-.el \{\
-. ds o o
-.\}
-.
-.\" .hP TEXT -- start an indented paragraph with TEXT hanging off to the left
-.de hP
-.IP
-\h'-\w'\fB\\$1\ \fP'u'\fB\\$1\ \fP\c
-..
-.
-.de t(
-'in +\\n(.ku
-..
-.de t)
-.in
-..
+.\"--------------------------------------------------------------------------
+.so ../common/defs.man \" @@@PRE@@@
.
.\"--------------------------------------------------------------------------
.TH keyword 3 "16 December 2015" "Straylight/Edgeware" "Sensible Object Design"
.\" Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
.\" MA 02111-1307, USA.
.
-.\" Highlight using terminal escapes, rather than overstriking.
-.\"\X'tty: sgr 1'
-.
-.\" String definitions and font selection.
-.ie t \{\
-. ds o \(bu
-. if \n(.g .fam P
-.\}
-.el \{\
-. ds o o
-.\}
-.
-.\" .hP TEXT -- start an indented paragraph with TEXT hanging off to the left
-.de hP
-.IP
-\h'-\w'\fB\\$1\ \fP'u'\fB\\$1\ \fP\c
-..
+.\"--------------------------------------------------------------------------
+.so ../common/defs.man \" @@@PRE@@@
.
.\"--------------------------------------------------------------------------
.TH sod-structs 3 "8 September 2015" "Straylight/Edgeware" "Sensible Object Design"
.\" Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
.\" MA 02111-1307, USA.
.
-.\" Highlight using terminal escapes, rather than overstriking.
-.\"\X'tty: sgr 1'
-.
-.\" String definitions and font selection.
-.ie t \{\
-. ds o \(bu
-. if \n(.g .fam P
-.\}
-.el \{\
-. ds o o
-.\}
-.
-.\" .hP TEXT -- start an indented paragraph with TEXT hanging off to the left
-.de hP
-.IP
-\h'-\w'\fB\\$1\ \fP'u'\fB\\$1\ \fP\c
-..
+.\"--------------------------------------------------------------------------
+.so ../common/defs.man \" @@@PRE@@@
.
.\"--------------------------------------------------------------------------
.TH sod 3 "8 September 2015" "Straylight/Edgeware" "Sensible Object Design"
###--------------------------------------------------------------------------
### Manual pages.
-dist_man_MANS += sod.1
-dist_man_MANS += sod-module.5
+man_MANS += sod.1 sod-module.5
+CLEANFILES += sod.1 sod-module.5
+EXTRA_DIST += sod.1.in sod-module.5.in
###--------------------------------------------------------------------------
### Installation.
.\" along with SOD; if not, write to the Free Software Foundation,
.\" Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
.
-.\" Highlight using terminal escapes, rather than overstriking.
-.\"\X'tty: sgr 1'
-.
-.\" String definitions and font selection.
-.ie t \{\
-. ds o \(bu
-. if \n(.g .fam P
-.\}
-.el \{\
-. ds o o
-.\}
-.
-.\" .hP TEXT -- start an indented paragraph with TEXT hanging off to the left
-.de hP
-.IP
-\h'-\w'\fB\\$1\ \fP'u'\fB\\$1\ \fP\c
-..
-.
-.\" An epsilon, or e.
-.ie t \{\
-. ds e \(*e
-. ds ^ \v'-.3m'\s'\\n(.s*7/10'
-. ds ^e \s0\v'.3m'
-. ds _ \v'.3m'\s'\\n(.s*7/10'
-. ds _e \s0\v'-.3m'
-.\}
-.el \{
-. ds e \fIe\fR
-. ds ^ ^
-. ds ^e
-. ds _ _
-. ds _e
-.\}
-.ds * \*^\(**\*(^e
-.ds + \*^+\*(^e
-.
-.de |
-.br
-\h'4n'|
-..
-.ie t \{\
-. de <
-..
-.\}
-.el
-. de <
-. br
-\h'4n'
-..
-.\}
+.\"--------------------------------------------------------------------------
+.so ../common/defs.man \" @@@PRE@@@
.
.\"--------------------------------------------------------------------------
.TH sod 5 "11 October 2015" "Straylight/Edgeware" "Sensible Object Design"
.\" along with SOD; if not, write to the Free Software Foundation,
.\" Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
.
-.\" Highlight using terminal escapes, rather than overstriking.
-.\"\X'tty: sgr 1'
-.
-.\" String definitions and font selection.
-.ie t \{\
-. ds o \(bu
-. if \n(.g .fam P
-.\}
-.el \{\
-. ds o o
-.\}
-.
-.\" .hP TEXT -- start an indented paragraph with TEXT hanging off to the left
-.de hP
-.IP
-\h'-\w'\fB\\$1\ \fP'u'\fB\\$1\ \fP\c
-..
+.\"--------------------------------------------------------------------------
+.so ../common/defs.man \" @@@PRE@@@
.
.\"--------------------------------------------------------------------------
.TH sod 1 "11 October 2015" "Straylight/Edgeware" "Sensible Object Design"
noinst_DATA =
TESTS =
-dist_man_MANS =
+man_MANS =
CLEANFILES += $(BUILT_SOURCES)
V_TEST_ = $(V_TEST_@AM_DEFAULT_V@)
V_TEST_0 = @echo " TEST $@";
+###--------------------------------------------------------------------------
+### Manpage substitutions.
+
+SUFFIXES += .1.in .1
+SUFFIXES += .3.in .3
+SUFFIXES += .5.in .5
+
+mandefs = $(top_srcdir)/common/defs.man
+
+V_MAN = $(V_MAN_@AM_V@)
+V_MAN_ = $(V_MAN_@AM_DEFAULT_V@)
+V_MAN_0 = @echo " MAN $@";
+
+.1.in.1 .3.in.3 .5.in.5:
+ $(V_MAN)
+ $(AM_V_at)sed '/^\.$$/ d; /^\.\\"/ d' $(mandefs) >$@.defs
+ $(AM_V_at)sed -e '/@@@PRE@@@/ {' -e 'r$@.defs' -e 'd' -e '}' \
+ $< >$@.merge
+ $(AM_V_at)$(confsubst) $@.merge >$@.subst $(SUBSTITUTIONS)
+ $(AM_V_at)rm -f $@.merge && mv $@.subst $@
+
+
###----- That's all, folks --------------------------------------------------