< prev index next >

make/Docs.gmk

Print this page
rev 52919 : 8189861: Refactor CacheFind
Reviewed-by: sgehwolf


 324   $$(eval $$(call create_overview_file,$1))
 325   $1_OPTIONS += -overview $$($1_OVERVIEW)
 326 
 327   $$(foreach g, $$($1_GROUPS), \
 328     $$(eval $1_OPTIONS += -group "$$($$g_GROUP_NAME)" "$$($$g_GROUP_MODULES)") \
 329   )
 330 
 331   ifeq ($$($1_JAVADOC_CMD), )
 332     $1_JAVADOC_CMD := $$(JAVA) -Djava.awt.headless=true $$($1_JAVA_ARGS) \
 333         $$(NEW_JAVADOC)
 334   else
 335     $1_OPTIONS += $$(addprefix -J, $$($1_JAVA_ARGS)) 
 336   endif
 337 
 338   $1_VARDEPS := $$($1_JAVA_ARGS) $$($1_OPTIONS) $$(MODULES_SOURCE_PATH) \
 339       $$($1_ALL_MODULES) $$($1_JAVADOC_CMD)
 340   $1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, \
 341       $$(SUPPORT_OUTPUTDIR)/docs/$1.vardeps)
 342 
 343   # Get a list of all files in all the source dirs for all included modules
 344   $1_SOURCE_DEPS := $$(call CacheFind, $$(wildcard $$(foreach module, \
 345       $$($1_ALL_MODULES), $$(call FindModuleSrcDirs, $$(module)))))
 346 
 347   # Javadoc creates a lot of files but use index.html as a marker
 348   $$($1_TARGET_DIR)/index.html: $$(BUILD_TOOLS_JDK) $$($1_VARDEPS_FILE) \
 349       $$($1_SOURCE_DEPS) $$($1_OVERVIEW)
 350         $$(call LogWarn, Generating $1 javadoc for \
 351             $$(words $$($1_ALL_MODULES)) modules)
 352         $$(call LogInfo, Javadoc modules: $$($1_ALL_MODULES))
 353         $$(call MakeDir, $$($1_TARGET_DIR))
 354         $$(call ExecuteWithLog, $$(SUPPORT_OUTPUTDIR)/docs/$1, \
 355             $$($1_JAVADOC_CMD) -d $$($1_TARGET_DIR) \
 356                 $$($1_OPTIONS) $$($1_LOG_OPTION))
 357 
 358   $1_JAVADOC_TARGETS := $$($1_TARGET_DIR)/index.html
 359 
 360   ifeq ($$(ENABLE_FULL_DOCS), true)
 361     # We have asked ModuleGraph to generate links to png files. Now we must
 362     # produce the png files.
 363 
 364     # Locate which modules has the @moduleGraph tag in their module-info.java


 479     OPTIONS := $(REFERENCE_OPTIONS), \
 480     TAGS := $(REFERENCE_TAGS), \
 481 ))
 482 
 483 # Targets generated are returned in REFERENCE_API_JAVADOC_TARGETS and
 484 # REFERENCE_API_MODULEGRAPH_TARGETS.
 485 
 486 ################################################################################
 487 
 488 JDK_INDEX_HTML := $(DOCS_OUTPUTDIR)/index.html
 489 
 490 $(JDK_INDEX_HTML):
 491         $(ECHO) '$(JDK_INDEX_CONTENT)' > $@
 492 
 493 JDK_INDEX_TARGETS += $(JDK_INDEX_HTML)
 494 
 495 # Copy the global resources
 496 GLOBAL_SPECS_RESOURCES_DIR := $(TOPDIR)/make/data/docs-resources/
 497 $(eval $(call SetupCopyFiles, COPY_GLOBAL_RESOURCES, \
 498     SRC := $(GLOBAL_SPECS_RESOURCES_DIR), \
 499     FILES := $(call CacheFind, $(GLOBAL_SPECS_RESOURCES_DIR)), \
 500     DEST := $(DOCS_OUTPUTDIR), \
 501 ))
 502 JDK_INDEX_TARGETS += $(COPY_GLOBAL_RESOURCES)
 503 
 504 # Copy the legal notices distributed with the docs bundle
 505 $(eval $(call SetupCopyFiles, COPY_DOCS_LEGAL_NOTICES, \
 506     SRC := $(TOPDIR)/src/jdk.javadoc/share/legal, \
 507     FILES := $(wildcard $(TOPDIR)/src/jdk.javadoc/share/legal/*), \
 508     DEST := $(DOCS_OUTPUTDIR)/legal, \
 509 ))
 510 JDK_INDEX_TARGETS += $(COPY_DOCS_LEGAL_NOTICES)
 511 
 512 ################################################################################
 513 # Copy JDK specs files
 514 
 515 # For all html documentation in $module/share/specs directories, copy it
 516 # unmodified
 517 
 518 ALL_MODULES := $(call FindAllModules)
 519 COPY_SPEC_FILTER := %.html %.gif %.jpg %.mib %.css
 520 
 521 $(foreach m, $(ALL_MODULES), \
 522   $(eval SPECS_$m := $(call FindModuleSpecsDirs, $m)) \
 523   $(foreach d, $(SPECS_$m), \
 524     $(if $(filter $(COPY_SPEC_FILTER), $(call CacheFind, $d)), \
 525       $(eval $(call SetupCopyFiles, COPY_$m, \
 526           SRC := $d, \
 527           FILES := $(filter $(COPY_SPEC_FILTER), $(call CacheFind, $d)), \
 528           DEST := $(DOCS_OUTPUTDIR)/specs/, \
 529       )) \
 530       $(eval JDK_SPECS_TARGETS += $(COPY_$m)) \
 531     ) \
 532   ) \
 533 )
 534 
 535 ifeq ($(ENABLE_FULL_DOCS), true)
 536   # For all markdown files in $module/share/specs directories, convert them to
 537   # html.
 538 
 539   GLOBAL_SPECS_DEFAULT_CSS_FILE := $(DOCS_OUTPUTDIR)/resources/jdk-default.css
 540 
 541   $(foreach m, $(ALL_MODULES), \
 542     $(eval SPECS_$m := $(call FindModuleSpecsDirs, $m)) \
 543     $(foreach d, $(SPECS_$m), \
 544       $(if $(filter %.md, $(call CacheFind, $d)), \
 545         $(eval $m_$d_NAME := CONVERT_MARKDOWN_$m_$(strip $(call RelativePath, $d, $(TOPDIR)))) \
 546         $(eval $(call SetupProcessMarkdown, $($m_$d_NAME), \
 547             SRC := $d, \
 548             FILES := $(filter %.md, $(call CacheFind, $d)), \
 549             DEST := $(DOCS_OUTPUTDIR)/specs/, \
 550             CSS := $(GLOBAL_SPECS_DEFAULT_CSS_FILE), \
 551         )) \
 552         $(eval JDK_SPECS_TARGETS += $($($m_$d_NAME))) \
 553       ) \
 554     ) \
 555   )
 556 endif
 557 
 558 # Special treatment for generated documentation
 559 
 560 JDWP_PROTOCOL := $(SUPPORT_OUTPUTDIR)/gensrc/jdk.jdi/jdwp-protocol.html
 561 $(eval $(call SetupCopyFiles, COPY_JDWP_PROTOCOL, \
 562     FILES := $(JDWP_PROTOCOL), \
 563     DEST := $(DOCS_OUTPUTDIR)/specs/jdwp, \
 564 ))
 565 JDK_SPECS_TARGETS += $(COPY_JDWP_PROTOCOL)
 566 
 567 # Get jvmti.html from the main jvm variant (all variants' jvmti.html are identical).
 568 JVMTI_HTML ?= $(HOTSPOT_OUTPUTDIR)/variant-$(JVM_VARIANT_MAIN)/gensrc/jvmtifiles/jvmti.html




 324   $$(eval $$(call create_overview_file,$1))
 325   $1_OPTIONS += -overview $$($1_OVERVIEW)
 326 
 327   $$(foreach g, $$($1_GROUPS), \
 328     $$(eval $1_OPTIONS += -group "$$($$g_GROUP_NAME)" "$$($$g_GROUP_MODULES)") \
 329   )
 330 
 331   ifeq ($$($1_JAVADOC_CMD), )
 332     $1_JAVADOC_CMD := $$(JAVA) -Djava.awt.headless=true $$($1_JAVA_ARGS) \
 333         $$(NEW_JAVADOC)
 334   else
 335     $1_OPTIONS += $$(addprefix -J, $$($1_JAVA_ARGS)) 
 336   endif
 337 
 338   $1_VARDEPS := $$($1_JAVA_ARGS) $$($1_OPTIONS) $$(MODULES_SOURCE_PATH) \
 339       $$($1_ALL_MODULES) $$($1_JAVADOC_CMD)
 340   $1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, \
 341       $$(SUPPORT_OUTPUTDIR)/docs/$1.vardeps)
 342 
 343   # Get a list of all files in all the source dirs for all included modules
 344   $1_SOURCE_DEPS := $$(call FindFiles, $$(wildcard $$(foreach module, \
 345       $$($1_ALL_MODULES), $$(call FindModuleSrcDirs, $$(module)))))
 346 
 347   # Javadoc creates a lot of files but use index.html as a marker
 348   $$($1_TARGET_DIR)/index.html: $$(BUILD_TOOLS_JDK) $$($1_VARDEPS_FILE) \
 349       $$($1_SOURCE_DEPS) $$($1_OVERVIEW)
 350         $$(call LogWarn, Generating $1 javadoc for \
 351             $$(words $$($1_ALL_MODULES)) modules)
 352         $$(call LogInfo, Javadoc modules: $$($1_ALL_MODULES))
 353         $$(call MakeDir, $$($1_TARGET_DIR))
 354         $$(call ExecuteWithLog, $$(SUPPORT_OUTPUTDIR)/docs/$1, \
 355             $$($1_JAVADOC_CMD) -d $$($1_TARGET_DIR) \
 356                 $$($1_OPTIONS) $$($1_LOG_OPTION))
 357 
 358   $1_JAVADOC_TARGETS := $$($1_TARGET_DIR)/index.html
 359 
 360   ifeq ($$(ENABLE_FULL_DOCS), true)
 361     # We have asked ModuleGraph to generate links to png files. Now we must
 362     # produce the png files.
 363 
 364     # Locate which modules has the @moduleGraph tag in their module-info.java


 479     OPTIONS := $(REFERENCE_OPTIONS), \
 480     TAGS := $(REFERENCE_TAGS), \
 481 ))
 482 
 483 # Targets generated are returned in REFERENCE_API_JAVADOC_TARGETS and
 484 # REFERENCE_API_MODULEGRAPH_TARGETS.
 485 
 486 ################################################################################
 487 
 488 JDK_INDEX_HTML := $(DOCS_OUTPUTDIR)/index.html
 489 
 490 $(JDK_INDEX_HTML):
 491         $(ECHO) '$(JDK_INDEX_CONTENT)' > $@
 492 
 493 JDK_INDEX_TARGETS += $(JDK_INDEX_HTML)
 494 
 495 # Copy the global resources
 496 GLOBAL_SPECS_RESOURCES_DIR := $(TOPDIR)/make/data/docs-resources/
 497 $(eval $(call SetupCopyFiles, COPY_GLOBAL_RESOURCES, \
 498     SRC := $(GLOBAL_SPECS_RESOURCES_DIR), \
 499     FILES := $(call FindFiles, $(GLOBAL_SPECS_RESOURCES_DIR)), \
 500     DEST := $(DOCS_OUTPUTDIR), \
 501 ))
 502 JDK_INDEX_TARGETS += $(COPY_GLOBAL_RESOURCES)
 503 
 504 # Copy the legal notices distributed with the docs bundle
 505 $(eval $(call SetupCopyFiles, COPY_DOCS_LEGAL_NOTICES, \
 506     SRC := $(TOPDIR)/src/jdk.javadoc/share/legal, \
 507     FILES := $(wildcard $(TOPDIR)/src/jdk.javadoc/share/legal/*), \
 508     DEST := $(DOCS_OUTPUTDIR)/legal, \
 509 ))
 510 JDK_INDEX_TARGETS += $(COPY_DOCS_LEGAL_NOTICES)
 511 
 512 ################################################################################
 513 # Copy JDK specs files
 514 
 515 # For all html documentation in $module/share/specs directories, copy it
 516 # unmodified
 517 
 518 ALL_MODULES := $(call FindAllModules)
 519 COPY_SPEC_FILTER := %.html %.gif %.jpg %.mib %.css
 520 
 521 $(foreach m, $(ALL_MODULES), \
 522   $(eval SPECS_$m := $(call FindModuleSpecsDirs, $m)) \
 523   $(foreach d, $(SPECS_$m), \
 524     $(if $(filter $(COPY_SPEC_FILTER), $(call FindFiles, $d)), \
 525       $(eval $(call SetupCopyFiles, COPY_$m, \
 526           SRC := $d, \
 527           FILES := $(filter $(COPY_SPEC_FILTER), $(call FindFiles, $d)), \
 528           DEST := $(DOCS_OUTPUTDIR)/specs/, \
 529       )) \
 530       $(eval JDK_SPECS_TARGETS += $(COPY_$m)) \
 531     ) \
 532   ) \
 533 )
 534 
 535 ifeq ($(ENABLE_FULL_DOCS), true)
 536   # For all markdown files in $module/share/specs directories, convert them to
 537   # html.
 538 
 539   GLOBAL_SPECS_DEFAULT_CSS_FILE := $(DOCS_OUTPUTDIR)/resources/jdk-default.css
 540 
 541   $(foreach m, $(ALL_MODULES), \
 542     $(eval SPECS_$m := $(call FindModuleSpecsDirs, $m)) \
 543     $(foreach d, $(SPECS_$m), \
 544       $(if $(filter %.md, $(call FindFiles, $d)), \
 545         $(eval $m_$d_NAME := CONVERT_MARKDOWN_$m_$(strip $(call RelativePath, $d, $(TOPDIR)))) \
 546         $(eval $(call SetupProcessMarkdown, $($m_$d_NAME), \
 547             SRC := $d, \
 548             FILES := $(filter %.md, $(call FindFiles, $d)), \
 549             DEST := $(DOCS_OUTPUTDIR)/specs/, \
 550             CSS := $(GLOBAL_SPECS_DEFAULT_CSS_FILE), \
 551         )) \
 552         $(eval JDK_SPECS_TARGETS += $($($m_$d_NAME))) \
 553       ) \
 554     ) \
 555   )
 556 endif
 557 
 558 # Special treatment for generated documentation
 559 
 560 JDWP_PROTOCOL := $(SUPPORT_OUTPUTDIR)/gensrc/jdk.jdi/jdwp-protocol.html
 561 $(eval $(call SetupCopyFiles, COPY_JDWP_PROTOCOL, \
 562     FILES := $(JDWP_PROTOCOL), \
 563     DEST := $(DOCS_OUTPUTDIR)/specs/jdwp, \
 564 ))
 565 JDK_SPECS_TARGETS += $(COPY_JDWP_PROTOCOL)
 566 
 567 # Get jvmti.html from the main jvm variant (all variants' jvmti.html are identical).
 568 JVMTI_HTML ?= $(HOTSPOT_OUTPUTDIR)/variant-$(JVM_VARIANT_MAIN)/gensrc/jvmtifiles/jvmti.html


< prev index next >