make/InterimImage.gmk
author dcubed
Thu, 11 Aug 2016 21:35:09 +0200
changeset 40360 437ce272aa84
parent 37770 9f040cf69078
child 40241 59abac94e4f2
permissions -rw-r--r--
Merge
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
37770
9f040cf69078 8150044: Generate classlists at build-time
redestad
parents:
diff changeset
     1
#
9f040cf69078 8150044: Generate classlists at build-time
redestad
parents:
diff changeset
     2
# Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
9f040cf69078 8150044: Generate classlists at build-time
redestad
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
9f040cf69078 8150044: Generate classlists at build-time
redestad
parents:
diff changeset
     4
#
9f040cf69078 8150044: Generate classlists at build-time
redestad
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
9f040cf69078 8150044: Generate classlists at build-time
redestad
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
9f040cf69078 8150044: Generate classlists at build-time
redestad
parents:
diff changeset
     7
# published by the Free Software Foundation.  Oracle designates this
9f040cf69078 8150044: Generate classlists at build-time
redestad
parents:
diff changeset
     8
# particular file as subject to the "Classpath" exception as provided
9f040cf69078 8150044: Generate classlists at build-time
redestad
parents:
diff changeset
     9
# by Oracle in the LICENSE file that accompanied this code.
9f040cf69078 8150044: Generate classlists at build-time
redestad
parents:
diff changeset
    10
#
9f040cf69078 8150044: Generate classlists at build-time
redestad
parents:
diff changeset
    11
# This code is distributed in the hope that it will be useful, but WITHOUT
9f040cf69078 8150044: Generate classlists at build-time
redestad
parents:
diff changeset
    12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
9f040cf69078 8150044: Generate classlists at build-time
redestad
parents:
diff changeset
    13
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
9f040cf69078 8150044: Generate classlists at build-time
redestad
parents:
diff changeset
    14
# version 2 for more details (a copy is included in the LICENSE file that
9f040cf69078 8150044: Generate classlists at build-time
redestad
parents:
diff changeset
    15
# accompanied this code).
9f040cf69078 8150044: Generate classlists at build-time
redestad
parents:
diff changeset
    16
#
9f040cf69078 8150044: Generate classlists at build-time
redestad
parents:
diff changeset
    17
# You should have received a copy of the GNU General Public License version
9f040cf69078 8150044: Generate classlists at build-time
redestad
parents:
diff changeset
    18
# 2 along with this work; if not, write to the Free Software Foundation,
9f040cf69078 8150044: Generate classlists at build-time
redestad
parents:
diff changeset
    19
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
9f040cf69078 8150044: Generate classlists at build-time
redestad
parents:
diff changeset
    20
#
9f040cf69078 8150044: Generate classlists at build-time
redestad
parents:
diff changeset
    21
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
9f040cf69078 8150044: Generate classlists at build-time
redestad
parents:
diff changeset
    22
# or visit www.oracle.com if you need additional information or have any
9f040cf69078 8150044: Generate classlists at build-time
redestad
parents:
diff changeset
    23
# questions.
9f040cf69078 8150044: Generate classlists at build-time
redestad
parents:
diff changeset
    24
#
9f040cf69078 8150044: Generate classlists at build-time
redestad
parents:
diff changeset
    25
9f040cf69078 8150044: Generate classlists at build-time
redestad
parents:
diff changeset
    26
default: all
9f040cf69078 8150044: Generate classlists at build-time
redestad
parents:
diff changeset
    27
9f040cf69078 8150044: Generate classlists at build-time
redestad
parents:
diff changeset
    28
include $(SPEC)
9f040cf69078 8150044: Generate classlists at build-time
redestad
parents:
diff changeset
    29
include MakeBase.gmk
9f040cf69078 8150044: Generate classlists at build-time
redestad
parents:
diff changeset
    30
include Modules.gmk
9f040cf69078 8150044: Generate classlists at build-time
redestad
parents:
diff changeset
    31
9f040cf69078 8150044: Generate classlists at build-time
redestad
parents:
diff changeset
    32
################################################################################
9f040cf69078 8150044: Generate classlists at build-time
redestad
parents:
diff changeset
    33
9f040cf69078 8150044: Generate classlists at build-time
redestad
parents:
diff changeset
    34
# Use this file inside the image as target for make rule
9f040cf69078 8150044: Generate classlists at build-time
redestad
parents:
diff changeset
    35
JIMAGE_TARGET_FILE := bin/java$(EXE_SUFFIX)
9f040cf69078 8150044: Generate classlists at build-time
redestad
parents:
diff changeset
    36
9f040cf69078 8150044: Generate classlists at build-time
redestad
parents:
diff changeset
    37
INTERIM_MODULES_LIST := $(call CommaList, $(INTERIM_IMAGE_MODULES))
9f040cf69078 8150044: Generate classlists at build-time
redestad
parents:
diff changeset
    38
9f040cf69078 8150044: Generate classlists at build-time
redestad
parents:
diff changeset
    39
JMODS := $(patsubst %, $(IMAGES_OUTPUTDIR)/jmods/%.jmod, $(INTERIM_IMAGE_MODULES))
9f040cf69078 8150044: Generate classlists at build-time
redestad
parents:
diff changeset
    40
9f040cf69078 8150044: Generate classlists at build-time
redestad
parents:
diff changeset
    41
JLINK_TOOL := $(JLINK) \
9f040cf69078 8150044: Generate classlists at build-time
redestad
parents:
diff changeset
    42
    --modulepath $(IMAGES_OUTPUTDIR)/jmods \
9f040cf69078 8150044: Generate classlists at build-time
redestad
parents:
diff changeset
    43
    --endian $(OPENJDK_BUILD_CPU_ENDIAN)
9f040cf69078 8150044: Generate classlists at build-time
redestad
parents:
diff changeset
    44
9f040cf69078 8150044: Generate classlists at build-time
redestad
parents:
diff changeset
    45
$(INTERIM_IMAGE_DIR)/$(JIMAGE_TARGET_FILE): $(JMODS) \
9f040cf69078 8150044: Generate classlists at build-time
redestad
parents:
diff changeset
    46
    $(call DependOnVariable, INTERIM_MODULES_LIST)
9f040cf69078 8150044: Generate classlists at build-time
redestad
parents:
diff changeset
    47
	$(ECHO) Creating interim jimage
9f040cf69078 8150044: Generate classlists at build-time
redestad
parents:
diff changeset
    48
	$(RM) -r $(INTERIM_IMAGE_DIR)
9f040cf69078 8150044: Generate classlists at build-time
redestad
parents:
diff changeset
    49
	$(JLINK_TOOL) \
9f040cf69078 8150044: Generate classlists at build-time
redestad
parents:
diff changeset
    50
	    --output $(INTERIM_IMAGE_DIR) \
9f040cf69078 8150044: Generate classlists at build-time
redestad
parents:
diff changeset
    51
	    --addmods $(INTERIM_MODULES_LIST)
9f040cf69078 8150044: Generate classlists at build-time
redestad
parents:
diff changeset
    52
	$(TOUCH) $@
9f040cf69078 8150044: Generate classlists at build-time
redestad
parents:
diff changeset
    53
9f040cf69078 8150044: Generate classlists at build-time
redestad
parents:
diff changeset
    54
TARGETS += $(INTERIM_IMAGE_DIR)/$(JIMAGE_TARGET_FILE)
9f040cf69078 8150044: Generate classlists at build-time
redestad
parents:
diff changeset
    55
9f040cf69078 8150044: Generate classlists at build-time
redestad
parents:
diff changeset
    56
################################################################################
9f040cf69078 8150044: Generate classlists at build-time
redestad
parents:
diff changeset
    57
9f040cf69078 8150044: Generate classlists at build-time
redestad
parents:
diff changeset
    58
all: $(TARGETS)
9f040cf69078 8150044: Generate classlists at build-time
redestad
parents:
diff changeset
    59
9f040cf69078 8150044: Generate classlists at build-time
redestad
parents:
diff changeset
    60
.PHONY: all