< prev index next >
make/CompileToolsJdk.gmk
Print this page
*** 27,36 ****
--- 27,37 ----
include $(SPEC)
include MakeBase.gmk
include JavaCompilation.gmk
include SetupJavaCompilers.gmk
+ include TextFileProcessing.gmk
################################################################################
$(eval $(call IncludeCustomExtension, CompileTools.gmk))
*** 85,90 ****
--- 86,117 ----
TARGETS += $(COMPILE_DEPEND) $(DEPEND_SERVICE_PROVIDER)
################################################################################
+ # To be able to call the javascript filter when generating man pages using
+ # pandoc, we need to create this executable wrapper script.
+ ifneq ($(PANDOC), )
+ # PANDOC_FILTER is duplicated for export in ToolsJdk.gmk.
+ PANDOC_FILTER := $(BUILDTOOLS_OUTPUTDIR)/manpages/pandoc-manpage-filter
+ PANDOC_FILTER_SETUP := $(BUILDTOOLS_OUTPUTDIR)/manpages/_pandoc_filter_setup.marker
+
+ # Create a usable instance of the wrapper script that calls the pandoc filter
+ # (which is written in javascript).
+ $(eval $(call SetupTextFileProcessing, CREATE_PANDOC_FILTER, \
+ SOURCE_FILES := $(TOPDIR)/make/scripts/pandoc-manpage-filter.sh.template, \
+ OUTPUT_FILE := $(PANDOC_FILTER), \
+ REPLACEMENTS := \
+ @@BOOT_JDK@@ => $(BOOT_JDK) ; \
+ @@TOPDIR@@ => $(TOPDIR) ; \
+ @@JJS_FLAGS@@ => $(addprefix -J, $(JAVA_FLAGS_SMALL)), \
+ ))
+
+ # Created script must be made executable
+ $(PANDOC_FILTER_SETUP): $(CREATE_PANDOC_FILTER)
+ $(CHMOD) a+rx $(PANDOC_FILTER)
+ $(TOUCH) $@
+
+ TARGETS += $(PANDOC_FILTER_SETUP)
+ endif
+
all: $(TARGETS)
< prev index next >