make/ModuleWrapper.gmk
author mbaesken
Wed, 09 Oct 2019 14:07:44 +0200
changeset 58548 430b9a492a05
parent 53683 48ff68e2fe5c
child 58908 73bb9c4002cc
permissions -rw-r--r--
8232052: use string literal for format string when handling PauseAtStartupFile Reviewed-by: clanger, stuefe
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
27560
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
     1
#
52714
2e52aa822c57 8178317: Create man pages using pandoc from markdown sources
ihse
parents: 52022
diff changeset
     2
# Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
27560
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
     4
#
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
     7
# published by the Free Software Foundation.  Oracle designates this
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
     8
# particular file as subject to the "Classpath" exception as provided
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
     9
# by Oracle in the LICENSE file that accompanied this code.
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    10
#
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    11
# This code is distributed in the hope that it will be useful, but WITHOUT
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    13
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    14
# version 2 for more details (a copy is included in the LICENSE file that
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    15
# accompanied this code).
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    16
#
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    17
# You should have received a copy of the GNU General Public License version
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    18
# 2 along with this work; if not, write to the Free Software Foundation,
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    19
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    20
#
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    21
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    22
# or visit www.oracle.com if you need additional information or have any
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    23
# questions.
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    24
#
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    25
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    26
################################################################################
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    27
# This makefile is called from Main.gmk, through a macro in MakeHelpers.gmk
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    28
# and wraps calls to makefiles for specific modules and build phases. Having
28356
3b985eeacb08 8066769: Fix merge errors following JDK-8049367
ihse
parents: 27560
diff changeset
    29
# this wrapper reduces the need for boilerplate code. It also provides
27560
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    30
# opportunity for automatic copying of files to an interim exploded runnable
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    31
# image.
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    32
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    33
default: all
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    34
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    35
include $(SPEC)
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    36
include MakeBase.gmk
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    37
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    38
# All makefiles should add the targets to be built to this variable.
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    39
TARGETS :=
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    40
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    41
# Include the file being wrapped.
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    42
include $(MAKEFILE_PREFIX)-$(MODULE).gmk
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    43
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    44
# Setup copy rules from the modules directories to the jdk image directory.
53683
48ff68e2fe5c 8218431: Improved platform checking in makefiles
ihse
parents: 52714
diff changeset
    45
ifeq ($(call isTargetOs, windows), true)
27560
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    46
  TO_BIN_FILTER := %$(SHARED_LIBRARY_SUFFIX) %.diz %.pdb %.map
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    47
41260
4f71f07b30d1 8150736: Excessive disk space used by build system
erikj
parents: 28356
diff changeset
    48
  $(eval $(call SetupCopyFiles, COPY_LIBS_TO_BIN, \
27560
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    49
      SRC := $(SUPPORT_OUTPUTDIR)/modules_libs/$(MODULE), \
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    50
      DEST := $(JDK_OUTPUTDIR)/bin, \
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    51
      FILES := $(filter $(TO_BIN_FILTER), \
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    52
          $(filter $(SUPPORT_OUTPUTDIR)/modules_libs/$(MODULE)/%, \
41260
4f71f07b30d1 8150736: Excessive disk space used by build system
erikj
parents: 28356
diff changeset
    53
          $(TARGETS))), \
4f71f07b30d1 8150736: Excessive disk space used by build system
erikj
parents: 28356
diff changeset
    54
  ))
27560
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    55
41260
4f71f07b30d1 8150736: Excessive disk space used by build system
erikj
parents: 28356
diff changeset
    56
  $(eval $(call SetupCopyFiles, COPY_LIBS_TO_LIB, \
27560
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    57
      SRC := $(SUPPORT_OUTPUTDIR)/modules_libs/$(MODULE), \
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    58
      DEST := $(JDK_OUTPUTDIR)/lib, \
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    59
      FILES := $(filter-out $(TO_BIN_FILTER), \
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    60
          $(filter $(SUPPORT_OUTPUTDIR)/modules_libs/$(MODULE)/%, \
41260
4f71f07b30d1 8150736: Excessive disk space used by build system
erikj
parents: 28356
diff changeset
    61
          $(TARGETS))), \
4f71f07b30d1 8150736: Excessive disk space used by build system
erikj
parents: 28356
diff changeset
    62
  ))
27560
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    63
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    64
else
41260
4f71f07b30d1 8150736: Excessive disk space used by build system
erikj
parents: 28356
diff changeset
    65
  $(eval $(call SetupCopyFiles, COPY_LIBS_TO_LIB, \
27560
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    66
      SRC := $(SUPPORT_OUTPUTDIR)/modules_libs/$(MODULE), \
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    67
      DEST := $(JDK_OUTPUTDIR)/lib, \
41260
4f71f07b30d1 8150736: Excessive disk space used by build system
erikj
parents: 28356
diff changeset
    68
      FILES := $(filter %$(SHARED_LIBRARY_SUFFIX), \
4f71f07b30d1 8150736: Excessive disk space used by build system
erikj
parents: 28356
diff changeset
    69
          $(filter $(SUPPORT_OUTPUTDIR)/modules_libs/$(MODULE)/%, \
4f71f07b30d1 8150736: Excessive disk space used by build system
erikj
parents: 28356
diff changeset
    70
          $(TARGETS))), \
4f71f07b30d1 8150736: Excessive disk space used by build system
erikj
parents: 28356
diff changeset
    71
  ))
4f71f07b30d1 8150736: Excessive disk space used by build system
erikj
parents: 28356
diff changeset
    72
  $(eval $(call SetupCopyFiles, LINK_LIBS_TO_LIB, \
4f71f07b30d1 8150736: Excessive disk space used by build system
erikj
parents: 28356
diff changeset
    73
      SRC := $(SUPPORT_OUTPUTDIR)/modules_libs/$(MODULE), \
4f71f07b30d1 8150736: Excessive disk space used by build system
erikj
parents: 28356
diff changeset
    74
      DEST := $(JDK_OUTPUTDIR)/lib, \
4f71f07b30d1 8150736: Excessive disk space used by build system
erikj
parents: 28356
diff changeset
    75
      FILES := $(filter-out %$(SHARED_LIBRARY_SUFFIX), \
4f71f07b30d1 8150736: Excessive disk space used by build system
erikj
parents: 28356
diff changeset
    76
          $(filter $(SUPPORT_OUTPUTDIR)/modules_libs/$(MODULE)/%, \
4f71f07b30d1 8150736: Excessive disk space used by build system
erikj
parents: 28356
diff changeset
    77
          $(TARGETS))), \
4f71f07b30d1 8150736: Excessive disk space used by build system
erikj
parents: 28356
diff changeset
    78
      MACRO := link-file-relative, \
42983
7bf4468cdbc4 8172037: Change log message of SetupCopyFiles
erikj
parents: 41260
diff changeset
    79
      LOG_ACTION := Creating symlink, \
41260
4f71f07b30d1 8150736: Excessive disk space used by build system
erikj
parents: 28356
diff changeset
    80
  ))
27560
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    81
endif
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    82
41260
4f71f07b30d1 8150736: Excessive disk space used by build system
erikj
parents: 28356
diff changeset
    83
$(eval $(call SetupCopyFiles, COPY_INCLUDE, \
27560
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    84
    SRC := $(SUPPORT_OUTPUTDIR)/modules_include/$(MODULE), \
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    85
    DEST := $(JDK_OUTPUTDIR)/include, \
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    86
    FILES := $(filter $(SUPPORT_OUTPUTDIR)/modules_include/$(MODULE)/%, \
41260
4f71f07b30d1 8150736: Excessive disk space used by build system
erikj
parents: 28356
diff changeset
    87
        $(TARGETS)), \
4f71f07b30d1 8150736: Excessive disk space used by build system
erikj
parents: 28356
diff changeset
    88
))
27560
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    89
41260
4f71f07b30d1 8150736: Excessive disk space used by build system
erikj
parents: 28356
diff changeset
    90
$(eval $(call SetupCopyFiles, COPY_CMDS, \
27560
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    91
    SRC := $(SUPPORT_OUTPUTDIR)/modules_cmds/$(MODULE), \
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    92
    DEST := $(JDK_OUTPUTDIR)/bin, \
41260
4f71f07b30d1 8150736: Excessive disk space used by build system
erikj
parents: 28356
diff changeset
    93
    FILES := $(filter $(SUPPORT_OUTPUTDIR)/modules_cmds/$(MODULE)/%, $(TARGETS)), \
4f71f07b30d1 8150736: Excessive disk space used by build system
erikj
parents: 28356
diff changeset
    94
))
27560
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    95
52714
2e52aa822c57 8178317: Create man pages using pandoc from markdown sources
ihse
parents: 52022
diff changeset
    96
$(eval $(call SetupCopyFiles, COPY_MAN, \
2e52aa822c57 8178317: Create man pages using pandoc from markdown sources
ihse
parents: 52022
diff changeset
    97
    SRC := $(SUPPORT_OUTPUTDIR)/modules_man/$(MODULE), \
2e52aa822c57 8178317: Create man pages using pandoc from markdown sources
ihse
parents: 52022
diff changeset
    98
    DEST := $(JDK_OUTPUTDIR)/man, \
2e52aa822c57 8178317: Create man pages using pandoc from markdown sources
ihse
parents: 52022
diff changeset
    99
    FILES := $(filter $(SUPPORT_OUTPUTDIR)/modules_man/$(MODULE)/%, $(TARGETS)), \
2e52aa822c57 8178317: Create man pages using pandoc from markdown sources
ihse
parents: 52022
diff changeset
   100
))
2e52aa822c57 8178317: Create man pages using pandoc from markdown sources
ihse
parents: 52022
diff changeset
   101
41260
4f71f07b30d1 8150736: Excessive disk space used by build system
erikj
parents: 28356
diff changeset
   102
$(eval $(call SetupCopyFiles, COPY_CONF, \
27560
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
   103
    SRC := $(SUPPORT_OUTPUTDIR)/modules_conf/$(MODULE), \
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
   104
    DEST := $(JDK_OUTPUTDIR)/conf, \
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
   105
    FILES := $(filter $(SUPPORT_OUTPUTDIR)/modules_conf/$(MODULE)/%, \
41260
4f71f07b30d1 8150736: Excessive disk space used by build system
erikj
parents: 28356
diff changeset
   106
        $(TARGETS)), \
4f71f07b30d1 8150736: Excessive disk space used by build system
erikj
parents: 28356
diff changeset
   107
))
27560
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
   108
52022
804792ce736f 8210459: Add support for generating compile_commands.json
rwestberg
parents: 42983
diff changeset
   109
ifeq ($(GENERATE_COMPILE_COMMANDS_ONLY), true)
804792ce736f 8210459: Add support for generating compile_commands.json
rwestberg
parents: 42983
diff changeset
   110
  all: $(filter $(MAKESUPPORT_OUTPUTDIR)/compile-commands/%, $(TARGETS))
804792ce736f 8210459: Add support for generating compile_commands.json
rwestberg
parents: 42983
diff changeset
   111
else
804792ce736f 8210459: Add support for generating compile_commands.json
rwestberg
parents: 42983
diff changeset
   112
  all: $(TARGETS) $(COPY_LIBS_TO_BIN) $(COPY_LIBS_TO_LIB) \
52714
2e52aa822c57 8178317: Create man pages using pandoc from markdown sources
ihse
parents: 52022
diff changeset
   113
      $(COPY_INCLUDE) $(COPY_CMDS) $(COPY_MAN) $(COPY_CONF) $(LINK_LIBS_TO_LIB)
52022
804792ce736f 8210459: Add support for generating compile_commands.json
rwestberg
parents: 42983
diff changeset
   114
endif