Skip to content

Commit

Permalink
Add Makefile.am to doc
Browse files Browse the repository at this point in the history
  • Loading branch information
madeye committed Jul 10, 2016
1 parent 2ca39fa commit 09b55d4
Show file tree
Hide file tree
Showing 4 changed files with 695 additions and 95 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ libsodium/src/libsodium/include/sodium/version.h
*.swp

# Documentation files
doc/*.1
doc/*.8
doc/*.gz
doc/*.xml
doc/*.html
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ AC_CONFIG_AUX_DIR(auto)
AC_CONFIG_MACRO_DIR([m4])
AC_USE_SYSTEM_EXTENSIONS

AM_INIT_AUTOMAKE([subdir-objects foreign -Wall -Werror])
AM_INIT_AUTOMAKE([subdir-objects foreign -Wno-gnu -Werror])
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
AM_MAINTAINER_MODE
Expand Down
62 changes: 62 additions & 0 deletions doc/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
ASCIIDOC = @ASCIIDOC@
ASCIIDOC_EXTRA =
MANPAGE_XSL = manpage-normal.xsl
XMLTO = @XMLTO@
XMLTO_EXTRA = -m manpage-bold-literal.xsl
GZIPCMD = @GZIP@
INSTALL = @INSTALL@
RM = @RM@
MV = @MV@
SED = @SED@
VERSION = `$(SED) -n 's/.*PACKAGE_VERSION "\(.*\)"/\1/p'\
../config.h`

# Guard against environment variables
if ENABLE_DOCUMENTATION
MAN1_DOC =
MAN1_DOC += ss-local.1
MAN1_DOC += ss-manager.1
MAN1_DOC += ss-nat.1
MAN1_DOC += ss-redir.1
MAN1_DOC += ss-server.1
MAN1_DOC += ss-tunnel.1

MAN8_DOC =
MAN8_DOC += shadowsocks-libev.8
else
MAN1_DOC =
MAN8_DOC =
endif

MAN8_XML = $(MAN8_DOC:%.8=%.xml)
MAN1_XML = $(MAN1_DOC:%.1=%.xml)
MAN_XML = $(MAN8_XML) $(MAN1_XML)

MAN8_HTML = $(MAN8_DOC:%.8=%.html)
MAN1_HTML = $(MAN1_DOC:%.1=%.html)
MAN_HTML = $(MAN8_HTML) $(MAN1_HTML)

MAN8_TXT = $(MAN8_DOC:%.8=%.asciidoc)
MAN1_TXT = $(MAN1_DOC:%.1=%.asciidoc)
MAN_TXT = $(MAN8_TXT) $(MAN1_TXT)

man_MANS = $(MAN8_DOC) $(MAN1_DOC)

html-local: $(MAN_HTML)

%.1: %.xml
$(AM_V_GEN)$(XMLTO) -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $<

%.8: %.xml
$(AM_V_GEN)$(XMLTO) -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $<

%.xml: %.asciidoc
$(AM_V_GEN)$(ASCIIDOC) -b docbook -d manpage -f asciidoc.conf \
-aversion=$(VERSION) $(ASCIIDOC_EXTRA) -o $@ $<

%.html: %.asciidoc
$(AM_V_GEN)$(ASCIIDOC) -b html -d article -f asciidoc.conf \
-aversion=$(VERSION) $(ASCIIDOC_EXTRA) -o $@ $<

doc_DATA = $(MAN_HTML)
CLEANFILES = $(MAN_XML) $(man_MANS) $(MAN_HTML)
Loading

0 comments on commit 09b55d4

Please sign in to comment.