make/CompileToolsJdk.gmk
branchihse-manpages-branch
changeset 57051 d8697832a650
parent 57049 d13c49f43710
equal deleted inserted replaced
57050:746a7ee75caa 57051:d8697832a650
    89 ################################################################################
    89 ################################################################################
    90 
    90 
    91 # To be able to call the javascript filter when generating man pages using
    91 # To be able to call the javascript filter when generating man pages using
    92 # pandoc, we need to create this executable wrapper script.
    92 # pandoc, we need to create this executable wrapper script.
    93 ifneq ($(PANDOC), )
    93 ifneq ($(PANDOC), )
    94   # PANDOC_FILTER is duplicated for export in ToolsJdk.gmk.
    94   # PANDOC_TROFF_MANPAGE_FILTER is duplicated for export in ToolsJdk.gmk.
    95   PANDOC_FILTER := $(BUILDTOOLS_OUTPUTDIR)/manpages/pandoc-manpage-filter
    95   PANDOC_TROFF_MANPAGE_FILTER := \
    96   PANDOC_FILTER_SETUP := $(BUILDTOOLS_OUTPUTDIR)/manpages/_pandoc_filter_setup.marker
    96       $(BUILDTOOLS_OUTPUTDIR)/manpages/pandoc-troff-manpage-filter
       
    97   PANDOC_TROFF_MANPAGE_FILTER_SETUP := \
       
    98       $(BUILDTOOLS_OUTPUTDIR)/manpages/_pandoc_troff_manpage_filter_setup.marker
    97 
    99 
    98   # Create a usable instance of the wrapper script that calls the pandoc filter
   100   # Create a usable instance of the wrapper script that calls the pandoc filter
    99   # (which is written in javascript).
   101   # (which is written in javascript).
   100   $(eval $(call SetupTextFileProcessing, CREATE_PANDOC_FILTER, \
   102   $(eval $(call SetupTextFileProcessing, CREATE_PANDOC_TROFF_MANPAGE_FILTER, \
   101       SOURCE_FILES := $(TOPDIR)/make/scripts/pandoc-manpage-filter.sh.template, \
   103       SOURCE_FILES := $(TOPDIR)/make/scripts/pandoc-troff-manpage-filter.sh.template, \
   102       OUTPUT_FILE := $(PANDOC_FILTER), \
   104       OUTPUT_FILE := $(PANDOC_TROFF_MANPAGE_FILTER), \
   103       REPLACEMENTS := \
   105       REPLACEMENTS := \
   104           @@BOOT_JDK@@ => $(BOOT_JDK) ; \
   106           @@BOOT_JDK@@ => $(BOOT_JDK) ; \
   105           @@TOPDIR@@ => $(TOPDIR) ; \
   107           @@TOPDIR@@ => $(TOPDIR) ; \
   106           @@JJS_FLAGS@@ => $(addprefix -J, $(JAVA_FLAGS_SMALL)), \
   108           @@JJS_FLAGS@@ => $(addprefix -J, $(JAVA_FLAGS_SMALL)), \
   107   ))
   109   ))
   108 
   110 
   109   # Created script must be made executable
   111   # Created script must be made executable
   110   $(PANDOC_FILTER_SETUP): $(CREATE_PANDOC_FILTER)
   112   $(PANDOC_TROFF_MANPAGE_FILTER_SETUP): $(CREATE_PANDOC_TROFF_MANPAGE_FILTER)
   111 	$(CHMOD) a+rx $(PANDOC_FILTER)
   113 	$(CHMOD) a+rx $(PANDOC_TROFF_MANPAGE_FILTER)
   112 	$(TOUCH) $@
   114 	$(TOUCH) $@
   113 
   115 
   114   TARGETS += $(PANDOC_FILTER_SETUP)
   116   TARGETS += $(PANDOC_TROFF_MANPAGE_FILTER_SETUP)
       
   117 
       
   118   # PANDOC_HTML_MANPAGE_FILTER is duplicated for export in ToolsJdk.gmk.
       
   119   PANDOC_HTML_MANPAGE_FILTER := \
       
   120       $(BUILDTOOLS_OUTPUTDIR)/manpages/pandoc-html-manpage-filter
       
   121   PANDOC_HTML_MANPAGE_FILTER_SETUP := \
       
   122       $(BUILDTOOLS_OUTPUTDIR)/manpages/_pandoc_html_manpage_filter_setup.marker
       
   123 
       
   124   # Create a usable instance of the wrapper script that calls the pandoc filter
       
   125   # (which is written in javascript).
       
   126   $(eval $(call SetupTextFileProcessing, CREATE_PANDOC_HTML_MANPAGE_FILTER, \
       
   127       SOURCE_FILES := $(TOPDIR)/make/scripts/pandoc-html-manpage-filter.sh.template, \
       
   128       OUTPUT_FILE := $(PANDOC_HTML_MANPAGE_FILTER), \
       
   129       REPLACEMENTS := \
       
   130           @@BOOT_JDK@@ => $(BOOT_JDK) ; \
       
   131           @@TOPDIR@@ => $(TOPDIR) ; \
       
   132           @@JJS_FLAGS@@ => $(addprefix -J, $(JAVA_FLAGS_SMALL)), \
       
   133   ))
       
   134 
       
   135   # Created script must be made executable
       
   136   $(PANDOC_HTML_MANPAGE_FILTER_SETUP): $(CREATE_PANDOC_HTML_MANPAGE_FILTER)
       
   137 	$(CHMOD) a+rx $(PANDOC_HTML_MANPAGE_FILTER)
       
   138 	$(TOUCH) $@
       
   139 
       
   140   TARGETS += $(PANDOC_HTML_MANPAGE_FILTER_SETUP)
   115 endif
   141 endif
   116 
   142 
   117 all: $(TARGETS)
   143 all: $(TARGETS)