make/CompileDemos.gmk
author prr
Fri, 22 Jun 2018 13:21:23 -0700
changeset 50831 59c6972e39fa
parent 50830 5500595d8ebf
child 52804 28094715ae71
child 56963 eaca4369b068
permissions -rw-r--r--
8205494: Convert or remove all AWT applet demos Reviewed-by: serb, erikj
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
12317
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
     1
#
41353
910288d26d83 8150736: Excessive disk space used by build system
erikj
parents: 35241
diff changeset
     2
# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
12317
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
     4
#
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
     7
# published by the Free Software Foundation.  Oracle designates this
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
     8
# particular file as subject to the "Classpath" exception as provided
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
     9
# by Oracle in the LICENSE file that accompanied this code.
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    10
#
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    11
# This code is distributed in the hope that it will be useful, but WITHOUT
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    13
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    14
# version 2 for more details (a copy is included in the LICENSE file that
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    15
# accompanied this code).
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    16
#
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    17
# You should have received a copy of the GNU General Public License version
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    18
# 2 along with this work; if not, write to the Free Software Foundation,
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    19
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    20
#
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    21
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    22
# or visit www.oracle.com if you need additional information or have any
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    23
# questions.
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    24
#
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    25
33502
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
    26
################################################################################
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
    27
# Build demos for the JDK into $(SUPPORT_OUTPUTDIR)/demos/image.
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
    28
################################################################################
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
    29
12317
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    30
default: all
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    31
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    32
include $(SPEC)
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    33
include MakeBase.gmk
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    34
include JavaCompilation.gmk
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    35
include NativeCompilation.gmk
26191
a0ff4b39d34b 8055188: General cleanup of minor issues from source restructure
erikj
parents: 25859
diff changeset
    36
include SetupJavaCompilers.gmk
30654
3c2e826aa5ea 8080630: Stop doing sed manipulation of manifest files in SetupJavaCompilation
ihse
parents: 30434
diff changeset
    37
include TextFileProcessing.gmk
33502
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
    38
include ZipArchive.gmk
12317
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    39
47336
6694369ed3f9 8189229: Remove references to $(TOPDIR)/src/*/$(MODULE)
ihse
parents: 47314
diff changeset
    40
# Hook to include the corresponding custom file, if present.
6694369ed3f9 8189229: Remove references to $(TOPDIR)/src/*/$(MODULE)
ihse
parents: 47314
diff changeset
    41
$(eval $(call IncludeCustomExtension, CompileDemos-pre.gmk))
6694369ed3f9 8189229: Remove references to $(TOPDIR)/src/*/$(MODULE)
ihse
parents: 47314
diff changeset
    42
25859
3317bb8137f4 8054834: Modular Source Code
chegar
parents: 24967
diff changeset
    43
# Prepare the find cache.
47336
6694369ed3f9 8189229: Remove references to $(TOPDIR)/src/*/$(MODULE)
ihse
parents: 47314
diff changeset
    44
DEMO_SRC_DIRS += $(TOPDIR)/src/demo
6694369ed3f9 8189229: Remove references to $(TOPDIR)/src/*/$(MODULE)
ihse
parents: 47314
diff changeset
    45
6694369ed3f9 8189229: Remove references to $(TOPDIR)/src/*/$(MODULE)
ihse
parents: 47314
diff changeset
    46
$(eval $(call FillCacheFind, $(wildcard $(DEMO_SRC_DIRS))))
15126
bceb690ccf35 8005540: build-infra: Improve incremental build speed on windows by caching find results
erikj
parents: 14596
diff changeset
    47
12317
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    48
# Append demo goals to this variable.
33502
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
    49
TARGETS =
12317
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    50
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    51
# The demo structure and contents should really be cleaned up.
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    52
# Now every other demo has its own quirks where to put the
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    53
# READMEs and other files.
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    54
47217
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
    55
DEMO_SHARE_SRC := $(TOPDIR)/src/demo/share
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
    56
GLOBAL_VERSION_INFO_RESOURCE := $(TOPDIR)/src/java.base/windows/native/common/version.rc
25859
3317bb8137f4 8054834: Modular Source Code
chegar
parents: 24967
diff changeset
    57
33502
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
    58
DEMO_MANIFEST := $(SUPPORT_OUTPUTDIR)/demos/java-main-manifest.mf
12317
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    59
33502
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
    60
# This rule will be depended on due to the MANIFEST line in SetupBuildDemo
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
    61
# and SetupBuildJvmtiDemo.
30654
3c2e826aa5ea 8080630: Stop doing sed manipulation of manifest files in SetupJavaCompilation
ihse
parents: 30434
diff changeset
    62
$(eval $(call SetupTextFileProcessing, BUILD_JAVA_MANIFEST, \
47217
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
    63
  SOURCE_FILES := $(TOPDIR)/make/data/mainmanifest/manifest.mf, \
33502
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
    64
  OUTPUT_FILE := $(DEMO_MANIFEST), \
30654
3c2e826aa5ea 8080630: Stop doing sed manipulation of manifest files in SetupJavaCompilation
ihse
parents: 30434
diff changeset
    65
  REPLACEMENTS := \
33984
2333676816eb 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents: 30654
diff changeset
    66
      @@VERSION_SPECIFICATION@@ => $(VERSION_SPECIFICATION) ; \
2333676816eb 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents: 30654
diff changeset
    67
      @@VERSION_SHORT@@ => $(VERSION_SHORT) ; \
30654
3c2e826aa5ea 8080630: Stop doing sed manipulation of manifest files in SetupJavaCompilation
ihse
parents: 30434
diff changeset
    68
      @@COMPANY_NAME@@ => $(COMPANY_NAME) , \
3c2e826aa5ea 8080630: Stop doing sed manipulation of manifest files in SetupJavaCompilation
ihse
parents: 30434
diff changeset
    69
))
3c2e826aa5ea 8080630: Stop doing sed manipulation of manifest files in SetupJavaCompilation
ihse
parents: 30434
diff changeset
    70
33502
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
    71
################################################################################
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
    72
# Build normal demos.
12317
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    73
33502
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
    74
COPY_TO_JAR := .html .txt .properties .js .gif .jpg .theme .data .opt .c .h \
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
    75
    .png .ttf .xyz .obj README COPYRIGHT
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
    76
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
    77
COPY_TO_IMAGE := *.html *.txt *.png *.xml README*
12317
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    78
33502
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
    79
# Setup make rules for building a demo.
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
    80
#
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
    81
# Parameter 1 is the name of the rule. This name is used as variable prefix,
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
    82
# and the targets generated are listed in a variable by that name.
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
    83
#
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
    84
# Remaining parameters are named arguments. These include:
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
    85
# DEMO_SUBDIR   The name of the subdir of the demo, below the demo top dir.
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
    86
# EXTRA_SRC_DIR   Additional source directory.
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
    87
# SRC_SUB_DIR   Optional subdir to locate source code in
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
    88
# SRC_DIR   Alternative source directory to use for the demos.
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
    89
# EXCLUDE_FILES   Exclude file list
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
    90
# JAR_NAME   Base name of jar file. Defaults to $1.
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
    91
# MAIN_CLASS   The main class for the jar. Defaults to $1.
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
    92
# EXTRA_COPY_TO_JAR   Additional files to copy to jar (as patterns)
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
    93
# EXTRA_COPY_TO_IMAGE   Additional files to copy to images (as wildcards)
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
    94
# EXTRA_MANIFEST_ATTR   Extra manifest attribute
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
    95
# SKIP_COMPILATION   Skip Java compilation iff true
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
    96
# DISABLE_SJAVAC   Passed to SetupJavaCompilation
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
    97
SetupBuildDemo = $(NamedParamsMacroTemplate)
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
    98
define SetupBuildDemoBody
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
    99
  ifeq ($$($1_SRC_DIR), )
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   100
    $1_SRC_DIR := $(DEMO_SHARE_SRC)
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   101
  endif
12317
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
   102
33502
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   103
  $1_SRC_BASE := $$($1_SRC_DIR)/$$($1_DEMO_SUBDIR)/$1
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   104
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   105
  # In some demos the source is found in a subdir
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   106
  ifneq ($$($1_SRC_SUB_DIR), )
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   107
    $1_MAIN_SRC := $$($1_SRC_BASE)/$$($1_SRC_SUB_DIR)
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   108
  else
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   109
    # for allmost all
25859
3317bb8137f4 8054834: Modular Source Code
chegar
parents: 24967
diff changeset
   110
    $1_MAIN_SRC := $$($1_SRC_BASE)
20547
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 20116
diff changeset
   111
  endif
12317
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
   112
33502
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   113
  # Default is to use demo name as jar file name.
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   114
  ifeq ($$($1_JAR_NAME), )
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   115
    $1_JAR_NAME := $1
20547
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 20116
diff changeset
   116
  endif
12317
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
   117
33502
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   118
  # Default is to use demo name as jar main class.
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   119
  ifeq ($$($1_MAIN_CLASS), )
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   120
    $1_MAIN_CLASS := $1
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   121
  else ifeq ($$($1_MAIN_CLASS), NONE)
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   122
    $1_MAIN_CLASS :=
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   123
    $1_EXTRA_MANIFEST_ATTR += Main-Class: \n
20547
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 20116
diff changeset
   124
  endif
12317
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
   125
33502
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   126
  ifneq ($$($1_SKIP_COMPILATION), true)
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   127
    $$(eval $$(call SetupJavaCompilation, BUILD_DEMO_$1, \
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   128
        SETUP := GENERATE_USINGJDKBYTECODE, \
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   129
        SRC := $$($1_MAIN_SRC) $$($1_EXTRA_SRC_DIR), \
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   130
        BIN := $(SUPPORT_OUTPUTDIR)/demos/classes/$$($1_DEMO_SUBDIR)/$1, \
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   131
        COPY := $(COPY_TO_JAR) $$($1_EXTRA_COPY_TO_JAR), \
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   132
        JAR := $(SUPPORT_OUTPUTDIR)/demos/image/$$($1_DEMO_SUBDIR)/$1/$$($1_JAR_NAME).jar, \
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   133
        JARMAIN := $$($1_MAIN_CLASS), \
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   134
        MANIFEST := $(DEMO_MANIFEST), \
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   135
        EXTRA_MANIFEST_ATTR := $$($1_EXTRA_MANIFEST_ATTR), \
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   136
        SRCZIP := $(SUPPORT_OUTPUTDIR)/demos/image/$$($1_DEMO_SUBDIR)/$1/src.zip, \
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   137
        EXCLUDE_FILES := $$($1_EXCLUDE_FILES), \
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   138
        DISABLE_SJAVAC := $$($1_DISABLE_SJAVAC), \
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   139
    ))
12317
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
   140
33502
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   141
    $1 += $$(BUILD_DEMO_$1)
20547
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 20116
diff changeset
   142
  endif
12317
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
   143
33502
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   144
  # Copy files. Sort is needed to remove duplicates.
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   145
  $1_COPY_FILES := $$(sort $$(wildcard $$(addprefix $$($1_SRC_BASE)/, \
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   146
      $(COPY_TO_IMAGE) $$($1_EXTRA_COPY_TO_IMAGE))))
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   147
  $$(eval $$(call SetupCopyFiles, COPY_DEMO_$1, \
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   148
      SRC :=  $$($1_SRC_BASE), \
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   149
      DEST := $(SUPPORT_OUTPUTDIR)/demos/image/$$($1_DEMO_SUBDIR)/$1, \
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   150
      FILES := $$($1_COPY_FILES), \
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   151
  ))
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   152
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   153
  $1 += $$(COPY_DEMO_$1)
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   154
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   155
  TARGETS += $$($1)
12317
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
   156
endef
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
   157
33502
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   158
CODEPOINT_SERVICE := java.awt.im.spi.InputMethodDescriptor
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   159
CODEPOINT_METAINF_SERVICE_FILE := \
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   160
    $(SUPPORT_OUTPUTDIR)/demos/classes/jfc/CodePointIM/META-INF/services/$(CODEPOINT_SERVICE)
12317
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
   161
33502
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   162
$(eval $(call SetupBuildDemo, CodePointIM, \
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   163
    DEMO_SUBDIR := jfc, \
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   164
    EXTRA_COPY_TO_JAR := $(CODEPOINT_SERVICE), \
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   165
))
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   166
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   167
# We also need to copy the CODEPOINT_SERVICE file to the META-INF/services
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   168
# location, and make sure the jar depends on that file to get it included.
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   169
$(CODEPOINT_METAINF_SERVICE_FILE): $(DEMO_SHARE_SRC)/jfc/CodePointIM/$(CODEPOINT_SERVICE)
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   170
	$(call install-file)
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   171
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   172
$(BUILD_DEMO_CodePointIM_JAR): $(CODEPOINT_METAINF_SERVICE_FILE)
12317
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
   173
33502
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   174
$(eval $(call SetupBuildDemo, FileChooserDemo, \
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   175
    DEMO_SUBDIR := jfc, \
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   176
))
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   177
49495
f46bfa7a2956 8198990: Move SwingSet2 from closed to OpenJDK
prr
parents: 47354
diff changeset
   178
$(eval $(call SetupBuildDemo, SwingSet2, \
f46bfa7a2956 8198990: Move SwingSet2 from closed to OpenJDK
prr
parents: 47354
diff changeset
   179
    DEMO_SUBDIR := jfc, \
f46bfa7a2956 8198990: Move SwingSet2 from closed to OpenJDK
prr
parents: 47354
diff changeset
   180
    EXTRA_COPY_TO_JAR := .java, \
f46bfa7a2956 8198990: Move SwingSet2 from closed to OpenJDK
prr
parents: 47354
diff changeset
   181
    EXTRA_MANIFEST_ATTR := SplashScreen-Image: resources/images/splash.png, \
f46bfa7a2956 8198990: Move SwingSet2 from closed to OpenJDK
prr
parents: 47354
diff changeset
   182
    DISABLE_SJAVAC := true, \
f46bfa7a2956 8198990: Move SwingSet2 from closed to OpenJDK
prr
parents: 47354
diff changeset
   183
))
f46bfa7a2956 8198990: Move SwingSet2 from closed to OpenJDK
prr
parents: 47354
diff changeset
   184
33502
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   185
$(eval $(call SetupBuildDemo, Font2DTest, \
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   186
    DEMO_SUBDIR := jfc, \
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   187
))
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   188
50146
0bb0e464ee76 8198991: Move Java2D demo to the open repository
prr
parents: 49495
diff changeset
   189
$(eval $(call SetupBuildDemo, J2Ddemo, \
0bb0e464ee76 8198991: Move Java2D demo to the open repository
prr
parents: 49495
diff changeset
   190
    DEMO_SUBDIR := jfc, \
0bb0e464ee76 8198991: Move Java2D demo to the open repository
prr
parents: 49495
diff changeset
   191
    MAIN_CLASS := java2d.J2Ddemo, \
0bb0e464ee76 8198991: Move Java2D demo to the open repository
prr
parents: 49495
diff changeset
   192
    JAR_NAME := J2Ddemo, \
0bb0e464ee76 8198991: Move Java2D demo to the open repository
prr
parents: 49495
diff changeset
   193
))
0bb0e464ee76 8198991: Move Java2D demo to the open repository
prr
parents: 49495
diff changeset
   194
33502
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   195
$(eval $(call SetupBuildDemo, Metalworks, \
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   196
    DEMO_SUBDIR := jfc, \
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   197
))
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   198
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   199
$(eval $(call SetupBuildDemo, Notepad, \
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   200
    DEMO_SUBDIR := jfc, \
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   201
))
12317
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
   202
50830
5500595d8ebf 8205136: Move StylePad demo to the open repository
prr
parents: 50828
diff changeset
   203
$(eval $(call SetupBuildDemo, Stylepad, \
5500595d8ebf 8205136: Move StylePad demo to the open repository
prr
parents: 50828
diff changeset
   204
    DEMO_SUBDIR := jfc, \
5500595d8ebf 8205136: Move StylePad demo to the open repository
prr
parents: 50828
diff changeset
   205
    EXTRA_SRC_DIR := $(DEMO_SHARE_SRC)/jfc/Notepad, \
5500595d8ebf 8205136: Move StylePad demo to the open repository
prr
parents: 50828
diff changeset
   206
    EXCLUDE_FILES := $(DEMO_SHARE_SRC)/jfc/Notepad/README.txt, \
5500595d8ebf 8205136: Move StylePad demo to the open repository
prr
parents: 50828
diff changeset
   207
))
5500595d8ebf 8205136: Move StylePad demo to the open repository
prr
parents: 50828
diff changeset
   208
33502
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   209
$(eval $(call SetupBuildDemo, SampleTree, \
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   210
    DEMO_SUBDIR := jfc, \
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   211
))
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   212
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   213
$(eval $(call SetupBuildDemo, TableExample, \
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   214
    DEMO_SUBDIR := jfc, \
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   215
))
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   216
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   217
$(eval $(call SetupBuildDemo, TransparentRuler, \
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   218
    DEMO_SUBDIR := jfc, \
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   219
    MAIN_CLASS := transparentruler.Ruler, \
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   220
))
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   221
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   222
################################################################################
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   223
# Copy html and README files.
12892
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents: 12317
diff changeset
   224
33502
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   225
$(SUPPORT_OUTPUTDIR)/demos/image/README: $(DEMO_SHARE_SRC)/README
16636
1cc691bcfe50 8008373: JFR JTReg tests fail with CompilationError on MacOSX; missing '._sunec.jar'
erikj
parents: 15676
diff changeset
   226
	$(call install-file)
12892
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents: 12317
diff changeset
   227
44744
333a815987e2 8173801: Modify makefiles to not build demos and samples bundles.
shurailine
parents: 41353
diff changeset
   228
TARGETS += $(SUPPORT_OUTPUTDIR)/demos/image/README
33502
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   229
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   230
################################################################################
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   231
# Copy netbeans project files.
12892
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents: 12317
diff changeset
   232
33502
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   233
$(SUPPORT_OUTPUTDIR)/demos/image/nbproject/%: $(DEMO_SHARE_SRC)/nbproject/%
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   234
	$(call install-file)
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   235
	$(CHMOD) -f ug+w $@
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   236
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   237
ifeq ($(OPENJDK_TARGET_OS), solaris)
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   238
  TARGETS += $(patsubst $(DEMO_SHARE_SRC)/nbproject/%, \
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   239
    $(SUPPORT_OUTPUTDIR)/demos/image/nbproject/%, \
50828
1ab8e3b0cee2 8205498: Typo in fix for 8205119 breaks Solaris demo build
prr
parents: 50827
diff changeset
   240
    $(call CacheFind, $(DEMO_SHARE_SRC)/nbproject))
33502
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   241
else
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   242
  TARGETS += $(patsubst $(DEMO_SHARE_SRC)/nbproject/%, \
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   243
    $(SUPPORT_OUTPUTDIR)/demos/image/nbproject/%, \
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   244
    $(call CacheFind, $(DEMO_SHARE_SRC)/nbproject))
12892
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents: 12317
diff changeset
   245
endif
12317
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
   246
33502
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   247
################################################################################
12892
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents: 12317
diff changeset
   248
45120
ba4c8ba79c19 8179867: JDK9 b167: demos exist in JDK bundles
erikj
parents: 44744
diff changeset
   249
ifneq ($(filter images, $(MAKECMDGOALS)), )
ba4c8ba79c19 8179867: JDK9 b167: demos exist in JDK bundles
erikj
parents: 44744
diff changeset
   250
  $(eval $(call SetupCopyFiles, COPY_TO_TEST_IMAGE, \
ba4c8ba79c19 8179867: JDK9 b167: demos exist in JDK bundles
erikj
parents: 44744
diff changeset
   251
      SRC := $(SUPPORT_OUTPUTDIR)/demos/image, \
ba4c8ba79c19 8179867: JDK9 b167: demos exist in JDK bundles
erikj
parents: 44744
diff changeset
   252
      DEST := $(TEST_IMAGE_DIR)/jdk/demos, \
47354
e8bda13da40b 8189434: SetupCopyFiles does not handle files with $ in them
erikj
parents: 47336
diff changeset
   253
      FILES := $(call CacheFind, $(SUPPORT_OUTPUTDIR)/demos/image), \
45120
ba4c8ba79c19 8179867: JDK9 b167: demos exist in JDK bundles
erikj
parents: 44744
diff changeset
   254
  ))
ba4c8ba79c19 8179867: JDK9 b167: demos exist in JDK bundles
erikj
parents: 44744
diff changeset
   255
ba4c8ba79c19 8179867: JDK9 b167: demos exist in JDK bundles
erikj
parents: 44744
diff changeset
   256
  IMAGES_TARGETS := $(COPY_TO_TEST_IMAGE)
ba4c8ba79c19 8179867: JDK9 b167: demos exist in JDK bundles
erikj
parents: 44744
diff changeset
   257
endif
ba4c8ba79c19 8179867: JDK9 b167: demos exist in JDK bundles
erikj
parents: 44744
diff changeset
   258
ba4c8ba79c19 8179867: JDK9 b167: demos exist in JDK bundles
erikj
parents: 44744
diff changeset
   259
################################################################################
33502
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   260
# Hook to include the corresponding custom file, if present.
47336
6694369ed3f9 8189229: Remove references to $(TOPDIR)/src/*/$(MODULE)
ihse
parents: 47314
diff changeset
   261
$(eval $(call IncludeCustomExtension, CompileDemos-post.gmk))
16636
1cc691bcfe50 8008373: JFR JTReg tests fail with CompilationError on MacOSX; missing '._sunec.jar'
erikj
parents: 15676
diff changeset
   262
33502
61feec1d58aa 8141261: Clean up building of demos
ihse
parents: 33406
diff changeset
   263
all: $(TARGETS)
45120
ba4c8ba79c19 8179867: JDK9 b167: demos exist in JDK bundles
erikj
parents: 44744
diff changeset
   264
images: $(IMAGES_TARGETS)
12317
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
   265
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
   266
.PHONY: all