make/UpdateBuildDocs.gmk
author rprotacio
Mon, 24 Apr 2017 12:08:28 -0400
changeset 46404 ae62ba99a1a7
parent 44511 f3c27401a860
child 44983 4e216c0475ee
permissions -rw-r--r--
8165896: Use "open" flag from JVM_DefineModule to export all module packages Summary: Implemented VM side of open modules, which export all their packages unqualifiedly. Automatic modules and unnamed modules are treated internally as open modules. Reviewed-by: alanb, hseigel, lfoltan
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
44078
673240c54c2e 8176509: Use pandoc for converting build readme to html
ihse
parents:
diff changeset
     1
#
673240c54c2e 8176509: Use pandoc for converting build readme to html
ihse
parents:
diff changeset
     2
# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
673240c54c2e 8176509: Use pandoc for converting build readme to html
ihse
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
673240c54c2e 8176509: Use pandoc for converting build readme to html
ihse
parents:
diff changeset
     4
#
673240c54c2e 8176509: Use pandoc for converting build readme to html
ihse
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
673240c54c2e 8176509: Use pandoc for converting build readme to html
ihse
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
673240c54c2e 8176509: Use pandoc for converting build readme to html
ihse
parents:
diff changeset
     7
# published by the Free Software Foundation.  Oracle designates this
673240c54c2e 8176509: Use pandoc for converting build readme to html
ihse
parents:
diff changeset
     8
# particular file as subject to the "Classpath" exception as provided
673240c54c2e 8176509: Use pandoc for converting build readme to html
ihse
parents:
diff changeset
     9
# by Oracle in the LICENSE file that accompanied this code.
673240c54c2e 8176509: Use pandoc for converting build readme to html
ihse
parents:
diff changeset
    10
#
673240c54c2e 8176509: Use pandoc for converting build readme to html
ihse
parents:
diff changeset
    11
# This code is distributed in the hope that it will be useful, but WITHOUT
673240c54c2e 8176509: Use pandoc for converting build readme to html
ihse
parents:
diff changeset
    12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
673240c54c2e 8176509: Use pandoc for converting build readme to html
ihse
parents:
diff changeset
    13
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
673240c54c2e 8176509: Use pandoc for converting build readme to html
ihse
parents:
diff changeset
    14
# version 2 for more details (a copy is included in the LICENSE file that
673240c54c2e 8176509: Use pandoc for converting build readme to html
ihse
parents:
diff changeset
    15
# accompanied this code).
673240c54c2e 8176509: Use pandoc for converting build readme to html
ihse
parents:
diff changeset
    16
#
673240c54c2e 8176509: Use pandoc for converting build readme to html
ihse
parents:
diff changeset
    17
# You should have received a copy of the GNU General Public License version
673240c54c2e 8176509: Use pandoc for converting build readme to html
ihse
parents:
diff changeset
    18
# 2 along with this work; if not, write to the Free Software Foundation,
673240c54c2e 8176509: Use pandoc for converting build readme to html
ihse
parents:
diff changeset
    19
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
673240c54c2e 8176509: Use pandoc for converting build readme to html
ihse
parents:
diff changeset
    20
#
673240c54c2e 8176509: Use pandoc for converting build readme to html
ihse
parents:
diff changeset
    21
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
673240c54c2e 8176509: Use pandoc for converting build readme to html
ihse
parents:
diff changeset
    22
# or visit www.oracle.com if you need additional information or have any
673240c54c2e 8176509: Use pandoc for converting build readme to html
ihse
parents:
diff changeset
    23
# questions.
673240c54c2e 8176509: Use pandoc for converting build readme to html
ihse
parents:
diff changeset
    24
#
673240c54c2e 8176509: Use pandoc for converting build readme to html
ihse
parents:
diff changeset
    25
673240c54c2e 8176509: Use pandoc for converting build readme to html
ihse
parents:
diff changeset
    26
default: all
673240c54c2e 8176509: Use pandoc for converting build readme to html
ihse
parents:
diff changeset
    27
673240c54c2e 8176509: Use pandoc for converting build readme to html
ihse
parents:
diff changeset
    28
include $(SPEC)
673240c54c2e 8176509: Use pandoc for converting build readme to html
ihse
parents:
diff changeset
    29
include MakeBase.gmk
673240c54c2e 8176509: Use pandoc for converting build readme to html
ihse
parents:
diff changeset
    30
673240c54c2e 8176509: Use pandoc for converting build readme to html
ihse
parents:
diff changeset
    31
################################################################################
673240c54c2e 8176509: Use pandoc for converting build readme to html
ihse
parents:
diff changeset
    32
# This makefile updates the generated build html documentation.
673240c54c2e 8176509: Use pandoc for converting build readme to html
ihse
parents:
diff changeset
    33
#
673240c54c2e 8176509: Use pandoc for converting build readme to html
ihse
parents:
diff changeset
    34
################################################################################
673240c54c2e 8176509: Use pandoc for converting build readme to html
ihse
parents:
diff changeset
    35
673240c54c2e 8176509: Use pandoc for converting build readme to html
ihse
parents:
diff changeset
    36
ifeq ($(PANDOC), )
673240c54c2e 8176509: Use pandoc for converting build readme to html
ihse
parents:
diff changeset
    37
  $(info No pandoc executable was detected by configure)
673240c54c2e 8176509: Use pandoc for converting build readme to html
ihse
parents:
diff changeset
    38
  $(error Cannot continue)
673240c54c2e 8176509: Use pandoc for converting build readme to html
ihse
parents:
diff changeset
    39
endif
673240c54c2e 8176509: Use pandoc for converting build readme to html
ihse
parents:
diff changeset
    40
673240c54c2e 8176509: Use pandoc for converting build readme to html
ihse
parents:
diff changeset
    41
################################################################################
673240c54c2e 8176509: Use pandoc for converting build readme to html
ihse
parents:
diff changeset
    42
# Setup make rules for converting a markdown file to html.
673240c54c2e 8176509: Use pandoc for converting build readme to html
ihse
parents:
diff changeset
    43
#
673240c54c2e 8176509: Use pandoc for converting build readme to html
ihse
parents:
diff changeset
    44
# Parameter 1 is the name of the rule. This name is used as variable prefix,
673240c54c2e 8176509: Use pandoc for converting build readme to html
ihse
parents:
diff changeset
    45
# and the targets generated are listed in a variable by that name.
673240c54c2e 8176509: Use pandoc for converting build readme to html
ihse
parents:
diff changeset
    46
#
673240c54c2e 8176509: Use pandoc for converting build readme to html
ihse
parents:
diff changeset
    47
# Remaining parameters are named arguments. These include:
673240c54c2e 8176509: Use pandoc for converting build readme to html
ihse
parents:
diff changeset
    48
#   SOURCE_FILE  The markdown source file
673240c54c2e 8176509: Use pandoc for converting build readme to html
ihse
parents:
diff changeset
    49
#   TARGET_DIR   The directory where to store the generated html file
44511
f3c27401a860 8177955: Add testing documentation
ihse
parents: 44078
diff changeset
    50
#   OPTIONS      Additional options to pandoc
44078
673240c54c2e 8176509: Use pandoc for converting build readme to html
ihse
parents:
diff changeset
    51
#
673240c54c2e 8176509: Use pandoc for converting build readme to html
ihse
parents:
diff changeset
    52
SetupMarkdownToHtml = $(NamedParamsMacroTemplate)
673240c54c2e 8176509: Use pandoc for converting build readme to html
ihse
parents:
diff changeset
    53
define SetupMarkdownToHtmlBody
673240c54c2e 8176509: Use pandoc for converting build readme to html
ihse
parents:
diff changeset
    54
  ifeq ($$($1_SOURCE_FILE), )
673240c54c2e 8176509: Use pandoc for converting build readme to html
ihse
parents:
diff changeset
    55
    $$(error SOURCE_FILE is missing in SetupMarkdownToHtml $1)
673240c54c2e 8176509: Use pandoc for converting build readme to html
ihse
parents:
diff changeset
    56
  endif
673240c54c2e 8176509: Use pandoc for converting build readme to html
ihse
parents:
diff changeset
    57
673240c54c2e 8176509: Use pandoc for converting build readme to html
ihse
parents:
diff changeset
    58
  ifeq ($$($1_TARGET_DIR), )
673240c54c2e 8176509: Use pandoc for converting build readme to html
ihse
parents:
diff changeset
    59
    $$(error TARGET_DIR is missing in SetupMarkdownToHtml $1)
673240c54c2e 8176509: Use pandoc for converting build readme to html
ihse
parents:
diff changeset
    60
  endif
673240c54c2e 8176509: Use pandoc for converting build readme to html
ihse
parents:
diff changeset
    61
673240c54c2e 8176509: Use pandoc for converting build readme to html
ihse
parents:
diff changeset
    62
  $1_BASENAME := $$(notdir $$(basename $$($1_SOURCE_FILE)))
673240c54c2e 8176509: Use pandoc for converting build readme to html
ihse
parents:
diff changeset
    63
  $1_OUTPUT_FILE := $$($1_TARGET_DIR)/$$($1_BASENAME).html
673240c54c2e 8176509: Use pandoc for converting build readme to html
ihse
parents:
diff changeset
    64
673240c54c2e 8176509: Use pandoc for converting build readme to html
ihse
parents:
diff changeset
    65
$$($1_OUTPUT_FILE): $$($1_SOURCE_FILE)
673240c54c2e 8176509: Use pandoc for converting build readme to html
ihse
parents:
diff changeset
    66
	$$(call LogInfo, Converting $$(notdir $1) to html)
673240c54c2e 8176509: Use pandoc for converting build readme to html
ihse
parents:
diff changeset
    67
	$$(call MakeDir, $$($1_TARGET_DIR) $$(MAKESUPPORT_OUTPUTDIR)/markdown)
673240c54c2e 8176509: Use pandoc for converting build readme to html
ihse
parents:
diff changeset
    68
	$$(call ExecuteWithLog, $$(MAKESUPPORT_OUTPUTDIR)/markdown/$1, \
44511
f3c27401a860 8177955: Add testing documentation
ihse
parents: 44078
diff changeset
    69
	    $$(PANDOC) $$($1_OPTIONS) -f markdown -t html --standalone \
f3c27401a860 8177955: Add testing documentation
ihse
parents: 44078
diff changeset
    70
	    --css 'http://openjdk.java.net/page.css' '$$<' -o '$$@')
f3c27401a860 8177955: Add testing documentation
ihse
parents: 44078
diff changeset
    71
	TOO_LONG_LINES=`$$(GREP) -E -e '^.{80}.+$$$$' $$<` || true ; \
f3c27401a860 8177955: Add testing documentation
ihse
parents: 44078
diff changeset
    72
	if [ "x$$$$TOO_LONG_LINES" != x ]; then \
44078
673240c54c2e 8176509: Use pandoc for converting build readme to html
ihse
parents:
diff changeset
    73
	  $$(ECHO) "Warning: Unsuitable markdown in $$<:" ; \
673240c54c2e 8176509: Use pandoc for converting build readme to html
ihse
parents:
diff changeset
    74
	  $$(ECHO) "The following lines are longer than 80 characters:" ; \
44511
f3c27401a860 8177955: Add testing documentation
ihse
parents: 44078
diff changeset
    75
	  $$(GREP) -E -n -e '^.{80}.+$$$$' $$< || true ; \
44078
673240c54c2e 8176509: Use pandoc for converting build readme to html
ihse
parents:
diff changeset
    76
	fi
673240c54c2e 8176509: Use pandoc for converting build readme to html
ihse
parents:
diff changeset
    77
673240c54c2e 8176509: Use pandoc for converting build readme to html
ihse
parents:
diff changeset
    78
  $1 := $$($1_OUTPUT_FILE)
673240c54c2e 8176509: Use pandoc for converting build readme to html
ihse
parents:
diff changeset
    79
673240c54c2e 8176509: Use pandoc for converting build readme to html
ihse
parents:
diff changeset
    80
  TARGETS += $$($1)
673240c54c2e 8176509: Use pandoc for converting build readme to html
ihse
parents:
diff changeset
    81
endef
673240c54c2e 8176509: Use pandoc for converting build readme to html
ihse
parents:
diff changeset
    82
673240c54c2e 8176509: Use pandoc for converting build readme to html
ihse
parents:
diff changeset
    83
################################################################################
673240c54c2e 8176509: Use pandoc for converting build readme to html
ihse
parents:
diff changeset
    84
44511
f3c27401a860 8177955: Add testing documentation
ihse
parents: 44078
diff changeset
    85
DOCS_DIR := $(TOPDIR)/common/doc
44078
673240c54c2e 8176509: Use pandoc for converting build readme to html
ihse
parents:
diff changeset
    86
673240c54c2e 8176509: Use pandoc for converting build readme to html
ihse
parents:
diff changeset
    87
$(eval $(call SetupMarkdownToHtml, building, \
44511
f3c27401a860 8177955: Add testing documentation
ihse
parents: 44078
diff changeset
    88
  SOURCE_FILE := $(DOCS_DIR)/building.md, \
f3c27401a860 8177955: Add testing documentation
ihse
parents: 44078
diff changeset
    89
  TARGET_DIR := $(DOCS_DIR), \
f3c27401a860 8177955: Add testing documentation
ihse
parents: 44078
diff changeset
    90
))
f3c27401a860 8177955: Add testing documentation
ihse
parents: 44078
diff changeset
    91
f3c27401a860 8177955: Add testing documentation
ihse
parents: 44078
diff changeset
    92
$(eval $(call SetupMarkdownToHtml, testing, \
f3c27401a860 8177955: Add testing documentation
ihse
parents: 44078
diff changeset
    93
  SOURCE_FILE := $(DOCS_DIR)/testing.md, \
f3c27401a860 8177955: Add testing documentation
ihse
parents: 44078
diff changeset
    94
  TARGET_DIR := $(DOCS_DIR), \
f3c27401a860 8177955: Add testing documentation
ihse
parents: 44078
diff changeset
    95
  OPTIONS := --toc, \
44078
673240c54c2e 8176509: Use pandoc for converting build readme to html
ihse
parents:
diff changeset
    96
))
673240c54c2e 8176509: Use pandoc for converting build readme to html
ihse
parents:
diff changeset
    97
673240c54c2e 8176509: Use pandoc for converting build readme to html
ihse
parents:
diff changeset
    98
################################################################################
673240c54c2e 8176509: Use pandoc for converting build readme to html
ihse
parents:
diff changeset
    99
673240c54c2e 8176509: Use pandoc for converting build readme to html
ihse
parents:
diff changeset
   100
$(eval $(call IncludeCustomExtension, , UpdateBuildDocs.gmk))
673240c54c2e 8176509: Use pandoc for converting build readme to html
ihse
parents:
diff changeset
   101
673240c54c2e 8176509: Use pandoc for converting build readme to html
ihse
parents:
diff changeset
   102
################################################################################
673240c54c2e 8176509: Use pandoc for converting build readme to html
ihse
parents:
diff changeset
   103
673240c54c2e 8176509: Use pandoc for converting build readme to html
ihse
parents:
diff changeset
   104
all: $(TARGETS)
673240c54c2e 8176509: Use pandoc for converting build readme to html
ihse
parents:
diff changeset
   105
673240c54c2e 8176509: Use pandoc for converting build readme to html
ihse
parents:
diff changeset
   106
.PHONY: all default