354 |
355 |
355 # For all html documentation in $module/share/specs directories, copy it |
356 # For all html documentation in $module/share/specs directories, copy it |
356 # unmodified |
357 # unmodified |
357 |
358 |
358 ALL_MODULES := $(call FindAllModules) |
359 ALL_MODULES := $(call FindAllModules) |
359 COPY_SPEC_FILTER := %.html %.gif %.jpg %.mib |
360 COPY_SPEC_FILTER := %.html %.gif %.jpg %.mib %.css |
360 |
361 |
361 $(foreach m, $(ALL_MODULES), \ |
362 $(foreach m, $(ALL_MODULES), \ |
362 $(eval SPECS_$m := $(call FindModuleSpecsDirs, $m)) \ |
363 $(eval SPECS_$m := $(call FindModuleSpecsDirs, $m)) \ |
363 $(if $(SPECS_$m), \ |
364 $(if $(SPECS_$m), \ |
364 $(eval $(call SetupCopyFiles, COPY_$m, \ |
365 $(eval $(call SetupCopyFiles, COPY_$m, \ |
368 )) \ |
369 )) \ |
369 $(eval JDK_SPECS_TARGETS += $(COPY_$m)) \ |
370 $(eval JDK_SPECS_TARGETS += $(COPY_$m)) \ |
370 ) \ |
371 ) \ |
371 ) |
372 ) |
372 |
373 |
|
374 # Copy the global resources |
|
375 GLOBAL_SPECS_RESOURCES_DIR := $(JDK_TOPDIR)/make/data/docs-resources/specs |
|
376 $(eval $(call SetupCopyFiles, COPY_GLOBAL_RESOURCES, \ |
|
377 SRC := $(GLOBAL_SPECS_RESOURCES_DIR), \ |
|
378 FILES := $(call CacheFind, $(GLOBAL_SPECS_RESOURCES_DIR)), \ |
|
379 DEST := $(JAVADOC_OUTPUTDIR)/specs/, \ |
|
380 )) |
|
381 JDK_SPECS_TARGETS += $(COPY_GLOBAL_RESOURCES) |
|
382 |
373 ifeq ($(ENABLE_FULL_DOCS), true) |
383 ifeq ($(ENABLE_FULL_DOCS), true) |
374 # For all markdown files in $module/share/specs directories, convert them to |
384 # For all markdown files in $module/share/specs directories, convert them to |
375 # html. |
385 # html. |
376 MARKDOWN_SPEC_FILTER := %.md |
386 |
377 |
387 GLOBAL_SPECS_DEFAULT_CSS_FILE := $(JAVADOC_OUTPUTDIR)/specs/resources/jdk-default.css |
378 # Macro for SetupCopyFiles that converts from markdown to html using pandoc. |
|
379 define markdown-to-html |
|
380 $(call MakeDir, $(@D)) |
|
381 $(RM) $@ |
|
382 $(PANDOC) -t html -s -o $@ $< |
|
383 endef |
|
384 |
|
385 rename-md-to-html = \ |
|
386 $(patsubst %.md,%.html,$1) |
|
387 |
388 |
388 $(foreach m, $(ALL_MODULES), \ |
389 $(foreach m, $(ALL_MODULES), \ |
389 $(eval SPECS_$m := $(call FindModuleSpecsDirs, $m)) \ |
390 $(eval SPECS_$m := $(call FindModuleSpecsDirs, $m)) \ |
390 $(if $(SPECS_$m), \ |
391 $(foreach d, $(SPECS_$m), \ |
391 $(eval $(call SetupCopyFiles, CONVERT_MARKDOWN_$m, \ |
392 $(if $(filter %.md, $(call CacheFind, $d)), \ |
392 SRC := $(SPECS_$m), \ |
393 $(eval $(call SetupProcessMarkdown, CONVERT_MARKDOWN_$m_$d, \ |
393 FILES := $(filter $(MARKDOWN_SPEC_FILTER), $(call CacheFind, $(SPECS_$m))), \ |
394 SRC := $d, \ |
394 DEST := $(JAVADOC_OUTPUTDIR)/specs/, \ |
395 FILES := $(filter %.md, $(call CacheFind, $d)), \ |
395 MACRO := markdown-to-html, \ |
396 DEST := $(JAVADOC_OUTPUTDIR)/specs/, \ |
396 NAME_MACRO := rename-md-to-html, \ |
397 CSS := $(GLOBAL_SPECS_DEFAULT_CSS_FILE), \ |
397 LOG_ACTION := Converting from markdown, \ |
398 )) \ |
398 )) \ |
399 ) \ |
399 $(eval JDK_SPECS_TARGETS += $(CONVERT_MARKDOWN_$m)) \ |
400 $(eval JDK_SPECS_TARGETS += $(CONVERT_MARKDOWN_$m_$d)) \ |
400 ) \ |
401 ) \ |
401 ) |
402 ) |
402 |
|
403 endif |
403 endif |
404 |
404 |
405 # Special treatment for generated documentation |
405 # Special treatment for generated documentation |
406 |
406 |
407 JDWP_PROTOCOL := $(SUPPORT_OUTPUTDIR)/gensrc/jdk.jdi/jdwp-protocol.html |
407 JDWP_PROTOCOL := $(SUPPORT_OUTPUTDIR)/gensrc/jdk.jdi/jdwp-protocol.html |