You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

105 lines
2.5 KiB

Asciidoc man page rework (#699) * Add 'tunnel_address' support for json config parser And allow ss-tunnel to use the newly introduced parser. Signed-off-by: Adam Anonymous <anonymous_temp_user@yahoo.co.jp> * Add "mode" support for jconf Now jconf supports "mode" setting, allowed values are "tcp_only", "tcp_and_udp" and "udp_only". Signed-off-by: Adam Anonymous <anonymous_temp_mail@yahoo.co.jp> * Use jconf "mode" for server/local/tunnel/manager Signed-off-by: Adam Anonymous <anonymous_temp_mail@yahoo.co.jp> * Add per-project vimrc to gitignore As the coding style differs from kernel and other projects, so such project vimrc should be helpful. Signed-off-by: Adam Anonymous <anonymous_temp_mail@yahoo.co.jp> * Doc: Introduce asciidoc based documentation framework Use asciidoc for new documentation framework, which could not only output man pages, but also htmls. And asciidoc documentation is much more human-readable than roff man pages. Signed-off-by: Adam Anonymous <anonymous_temp_mail@yahoo.co.jp> * Doc: Convert shadowsocks-libev man page to asciidoc The port to asciidoc has some format change compared to old one. The most obvious one is the options listed in SYNOPSIS. Now the options list is not split into 2/3 columns, or we must use asciidoc tables and introduce table frames. Other small change includes the removal of AUTHOR sector, as it's not an expendable method to update AUTHOR sector every time it gets updated. Signed-off-by: Adam Anonymous <anonymous_temp_mail@yahoo.co.jp> * Doc: Convert ss-local man page to asciidoc Also modify gitignore, since it use too generic rules to ignore such documentation. Signed-off-by: Adam Anonymous <anonymous_temp_mail@yahoo.co.jp> * Doc: Convert ss-manager man page to asciidoc Signed-off-by: Adam Anonymous <anonymous_temp_mail@yahoo.co.jp> * Doc: Convert ss-nat man page to asciidoc Signed-off-by: Adam Anonymous <anonymous_temp_mail@yahoo.co.jp> * Doc: Convert ss-redir man page to asciidoc Signed-off-by: Adam Anonymous <anonymous_temp_mail@yahoo.co.jp> * Doc: Convert ss-server man page to asciidoc Signed-off-by: Adam Anonymous <anonymous_temp_mail@yahoo.co.jp> * Doc: Convert ss-tunnel man page to asciidoc Signed-off-by: Adam Anonymous <anonymous_temp_mail@yahoo.co.jp> * Doc: Remove old roff man pages Welcome to the new age of asciidoc. Signed-off-by: Adam Anonymous <anonymous_temp_mail@yahoo.co.jp> * Doc: Add equivalent tables for command line options and config file Now user can get a more clear view of config file and command line options. Signed-off-by: Adam Anonymous <anonymous_temp_mail@yahoo.co.jp>
8 years ago
  1. ASCIIDOC = @ASCIIDOC@
  2. ASCIIDOC_EXTRA =
  3. MANPAGE_XSL = manpage-normal.xsl
  4. XMLTO = @XMLTO@
  5. XMLTO_EXTRA = -m manpage-bold-literal.xsl
  6. GZIPCMD = @GZIP@
  7. INSTALL = @INSTALL@
  8. RM = @RM@
  9. MV = @MV@
  10. SED = @SED@
  11. VERSION = $(shell $(SED) -n 's/.*PACKAGE_VERSION "\(.*\)"/\1/p'\
  12. ../config.h)
  13. # Guard against environment variables
  14. MAN1_TXT =
  15. MAN1_TXT += ss-local.asciidoc
  16. MAN1_TXT += ss-manager.asciidoc
  17. MAN1_TXT += ss-nat.asciidoc
  18. MAN1_TXT += ss-redir.asciidoc
  19. MAN1_TXT += ss-server.asciidoc
  20. MAN1_TXT += ss-tunnel.asciidoc
  21. MAN8_TXT =
  22. MAN8_TXT += shadowsocks-libev.asciidoc
  23. ifeq ($(DISABLE_DOCUMENTATION),1)
  24. MAN1_TXT =
  25. MAN8_TXT =
  26. endif
  27. MAN_TXT = $(MAN8_TXT) $(MAN1_TXT)
  28. MAN_XML = $(patsubst %.asciidoc,%.xml,$(MAN_TXT))
  29. MAN_HTML = $(patsubst %.asciidoc,%.html,$(MAN_TXT))
  30. DOC_MAN1 = $(patsubst %.asciidoc,%.1,$(MAN1_TXT))
  31. GZ_MAN1 = $(patsubst %.asciidoc,%.1.gz,$(MAN1_TXT))
  32. DOC_MAN8 = $(patsubst %.asciidoc,%.8,$(MAN8_TXT))
  33. GZ_MAN8 = $(patsubst %.asciidoc,%.8.gz,$(MAN8_TXT))
  34. prefix = @prefix@
  35. mandir ?= $(prefix)/share/man
  36. man1dir = $(mandir)/man1
  37. man8dir = $(mandir)/man8
  38. ifneq ($(findstring $(MAKEFLAGS),s),s)
  39. ifndef V
  40. QUIET_RM = @
  41. QUIET_ASCIIDOC = @echo " [ASCII] $@";
  42. QUIET_XMLTO = @echo " [XMLTO] $@";
  43. QUIET_GZIP = @echo " [GZ] $@";
  44. QUIET_STDERR = 2> /dev/null
  45. QUIET_SUBDIR0 = +@subdir=
  46. QUIET_SUBDIR1 = ;$(NO_SUBDIR) echo ' ' SUBDIR $$subdir; \
  47. $(MAKE) $(PRINT_DIR) -C $$subdir
  48. export V
  49. endif
  50. endif
  51. all: man
  52. man: man1 man8
  53. man1: $(GZ_MAN1)
  54. man8: $(GZ_MAN8)
  55. html: $(MAN_HTML)
  56. install: install-man
  57. install-man: man
  58. $(INSTALL) -d -m 755 $(DESTDIR)$(man1dir)
  59. $(INSTALL) -d -m 755 $(DESTDIR)$(man8dir)
  60. ifdef GZ_MAN1
  61. $(INSTALL) -m 644 $(GZ_MAN1) $(DESTDIR)$(man1dir)
  62. endif
  63. ifdef GZ_MAN8
  64. $(INSTALL) -m 644 $(GZ_MAN8) $(DESTDIR)$(man8dir)
  65. endif
  66. clean:
  67. $(QUIET_RM)$(RM) -f *.xml *.xml+ *.1 *.1.gz *.8 *.8.gz *.html
  68. %.1.gz : %.1
  69. $(QUIET_GZIP)$(GZIPCMD) -n -c $< > $@
  70. %.8.gz : %.8
  71. $(QUIET_GZIP)$(GZIPCMD) -n -c $< > $@
  72. %.1 : %.xml
  73. $(QUIET_XMLTO)$(RM) -f $@ && \
  74. $(XMLTO) -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $<
  75. %.8 : %.xml
  76. $(QUIET_XMLTO)$(RM) -f $@ && \
  77. $(XMLTO) -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $<
  78. %.xml : %.asciidoc asciidoc.conf
  79. $(QUIET_ASCIIDOC)$(RM) -f $@+ $@ && \
  80. $(ASCIIDOC) -b docbook -d manpage -f asciidoc.conf \
  81. -aversion=$(VERSION) $(ASCIIDOC_EXTRA) -o $@+ $< && \
  82. $(MV) $@+ $@
  83. %.html : %.asciidoc asciidoc.conf
  84. $(QUIET_ASCIIDOC)$(RM) -f $@+ $@ && \
  85. $(ASCIIDOC) -b html -d article -f asciidoc.conf \
  86. -aversion=$(VERSION) $(ASCIIDOC_EXTRA) -o $@+ $< && \
  87. $(MV) $@+ $@