jdk/make/common/internal/BinaryPlugs.gmk
author ohair
Tue, 25 May 2010 15:58:33 -0700
changeset 5506 202f599c92aa
parent 4665 d14dc3d9e1fa
permissions -rw-r--r--
6943119: Rebrand source copyright notices Reviewed-by: darcy, weijun
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
#
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4665
diff changeset
     2
# Copyright (c) 2007, 2008, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4665
diff changeset
     7
# published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
# particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4665
diff changeset
     9
# by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
# This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
# version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
# accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
# You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
# 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
#
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4665
diff changeset
    21
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4665
diff changeset
    22
# or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4665
diff changeset
    23
# questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
########################################################################
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
# Definitions for openjdk plugs (used by both import and export)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
# Names of native shared libraries
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
1846
4a53d636e2f4 6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents: 916
diff changeset
    32
PLUG_LIBRARY_NAMES=
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
# Sub-directory where native shared libraries are located (e.g. jre/bin or...)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
PLUG_LOCATION_SUBDIR=$(ARCH_VM_SUBDIR)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
# Explicit classfile lists
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
# WARNING: These classlists will not work with pattern rules, only used in 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
#          shell commands.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
#          The \$$ patterns will fail in pattern rules, which want $$, 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
#          but the $$ fails in shell commands. 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
#          The shell commands are more important.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
#          Also, the $1 pattern in these names causes problems with the 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
#          GNU make define feature, so you can't use these in define's.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
PLUG_JMF_CLASS_NAMES = \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
com/sun/jmx/snmp/SnmpDataTypeEnums.class \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
com/sun/jmx/snmp/SnmpDefinitions.class \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
com/sun/jmx/snmp/SnmpOid.class \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
com/sun/jmx/snmp/SnmpOidDatabase.class \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
com/sun/jmx/snmp/SnmpOidDatabaseSupport.class \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
com/sun/jmx/snmp/SnmpOidRecord.class \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
com/sun/jmx/snmp/SnmpOidTable.class \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
com/sun/jmx/snmp/SnmpOidTableSupport.class \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
com/sun/jmx/snmp/SnmpParameters.class \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
com/sun/jmx/snmp/SnmpPduPacket.class \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
com/sun/jmx/snmp/SnmpPeer.class \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
com/sun/jmx/snmp/SnmpTimeticks.class \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
com/sun/jmx/snmp/SnmpVarBind.class \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
com/sun/jmx/snmp/SnmpVarBindList.class \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
com/sun/jmx/snmp/Timestamp.class \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
com/sun/jmx/snmp/daemon/SendQ.class \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
com/sun/jmx/snmp/daemon/SnmpInformRequest.class \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
com/sun/jmx/snmp/daemon/SnmpQManager.class \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
com/sun/jmx/snmp/daemon/SnmpRequestCounter.class \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
com/sun/jmx/snmp/daemon/SnmpResponseHandler.class \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
com/sun/jmx/snmp/daemon/SnmpSendServer.class \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
com/sun/jmx/snmp/daemon/SnmpSession.class \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
com/sun/jmx/snmp/daemon/SnmpSocket.class \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
com/sun/jmx/snmp/daemon/SnmpTimerServer.class \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
com/sun/jmx/snmp/daemon/WaitQ.class
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
# Class list temp files (used by both import and export of plugs)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
PLUG_TEMPDIR=$(ABS_TEMPDIR)/plugs
1846
4a53d636e2f4 6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents: 916
diff changeset
    78
PLUG_CLASS_AREAS = jmf
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
PLUG_CLISTS = $(PLUG_CLASS_AREAS:%=$(PLUG_TEMPDIR)/%.clist)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
# Create jargs file command
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
define plug-create-jargs
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
@$(prep-target)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
$(SED) -e "s@^@-C $(CLASSDESTDIR) @" $< > $@
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
endef # plug-create-clist-jargs
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
# Create clist (class name list) and jargs file (input to jar)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
#   Need these files to avoid long command lines which fail on some systems.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
$(PLUG_TEMPDIR)/jmf.clist:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
	@$(prep-target)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
	@for i in $(PLUG_JMF_CLASS_NAMES) ; do \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
	  $(ECHO) "$$i" >> $@; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
	done
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
$(PLUG_TEMPDIR)/all.clist: $(PLUG_CLISTS)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
	@$(prep-target)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
	$(CAT) $(PLUG_CLISTS) > $@
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
$(PLUG_TEMPDIR)/jmf.jargs: $(PLUG_TEMPDIR)/jmf.clist
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
	$(plug-create-jargs)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
$(PLUG_TEMPDIR)/all.jargs: $(PLUG_TEMPDIR)/all.clist
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
	$(plug-create-jargs)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
# Specific to OPENJDK import of binary plugs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
ifdef OPENJDK
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
# Import 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
PLUG_IMPORT_DIR=$(BINARY_PLUGS_PATH)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
PLUG_IMPORT_JARFILE=$(BINARY_PLUGS_JARFILE)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
# Import file command
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
define import-binary-plug-file
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
@$(ECHO) "PLUG IMPORT: $(@F)"
4665
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 1846
diff changeset
   119
$(install-non-module-file)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
endef # import-binary-plug-file
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
# Import classes command
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
define import-binary-plug-classes
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
@$(MKDIR) -p $(CLASSDESTDIR)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
@$(CAT) $1 | $(SED) -e 's/^/PLUG IMPORT: /'
916
867515b155b5 6728161: Add SKIP_BOOT_CYCLE feature to create boot jdk and use it during build
ohair
parents: 715
diff changeset
   127
($(CD) $(CLASSDESTDIR) && $(BOOT_JAR_CMD) xf $(PLUG_IMPORT_JARFILE) @$1 $(BOOT_JAR_JFLAGS) )
867515b155b5 6728161: Add SKIP_BOOT_CYCLE feature to create boot jdk and use it during build
ohair
parents: 715
diff changeset
   128
($(CD) $(CLASSDESTDIR) && $(java-vm-cleanup) )
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
endef # import-binary-plug-classes
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
# Import specific area classes (the classes are always created)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
import-binary-plug-jmf-classes: $(PLUG_IMPORT_JARFILE) $(PLUG_TEMPDIR)/jmf.clist
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
	$(call import-binary-plug-classes,$(PLUG_TEMPDIR)/jmf.clist)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
# Import all classes from the jar file
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
import-binary-plug-jar: \
1846
4a53d636e2f4 6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents: 916
diff changeset
   139
	     import-binary-plug-jmf-classes
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
# Binary plug start/complete messages
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
import-binary-plugs-started:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
	@$(ECHO) "BinaryPlugs import started: `date`"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
	@$(ECHO) "BINARY_PLUGS_PATH=$(BINARY_PLUGS_PATH)"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
import-binary-plugs-completed:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
	@$(ECHO) "BinaryPlugs import completed: `date`"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
# Import lib files (only if they don't exist already)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
import-binary-plugs-libs: \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
    $(PLUG_LIBRARY_NAMES:%=$(LIB_LOCATION)/%)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
# Import everything
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
import-binary-plugs: \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
    import-binary-plugs-started \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
    import-binary-plugs-libs \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
    import-binary-plug-jar \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
    import-binary-plugs-completed
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
# All these targets are phony (no filenames)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
.PHONY: import-binary-plugs-started  \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
	import-binary-plugs-completed \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
	import-binary-plugs-libs \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
	import-binary-plugs \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
	import-binary-plug-jar \
1846
4a53d636e2f4 6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents: 916
diff changeset
   169
	import-binary-plug-jmf-classes
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
else # !OPENJDK
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
# Specific to exporting binary plugs for OPENJDK (e.g. OPENJDK is NOT defined)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
# Export names (See make/common/Defs.gmk for BINARY_PLUGS_JARNAME definition)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
PLUG_EXPORT_DIRNAME=openjdk-binary-plugs-image
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
PLUG_EXPORT_DIR=$(OUTPUTDIR)/$(PLUG_EXPORT_DIRNAME)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
PLUG_EXPORT_JARFILE=$(PLUG_EXPORT_DIR)/jre/lib/$(BINARY_PLUGS_JARNAME)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
# Export file command
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
define export-binary-plug-file
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
@$(ECHO) "PLUG EXPORT: $(@F)"
4665
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 1846
diff changeset
   187
$(install-non-module-file)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
endef # export-binary-plug-file
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
# OpenJDK Binary Plug License
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
$(PLUG_EXPORT_DIR)/LICENSE: $(CLOSED_SHARE_SRC)/doc/openjdk/binary-plugs/LICENSE
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
	$(export-binary-plug-file)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
export-binary-plugs-license: $(PLUG_EXPORT_DIR)/LICENSE
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
# Create jar file of plug classes (always created)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
$(PLUG_EXPORT_JARFILE): $(PLUG_TEMPDIR)/all.clist $(PLUG_TEMPDIR)/all.jargs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
	@$(prep-target)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
	@$(ECHO) "PLUG EXPORT: $(@F)"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
	@$(CAT) $(PLUG_TEMPDIR)/all.clist | $(SED) -e 's/^/PLUG EXPORT: /'
916
867515b155b5 6728161: Add SKIP_BOOT_CYCLE feature to create boot jdk and use it during build
ohair
parents: 715
diff changeset
   202
	$(BOOT_JAR_CMD) cf $@ @$(PLUG_TEMPDIR)/all.jargs $(BOOT_JAR_JFLAGS)
867515b155b5 6728161: Add SKIP_BOOT_CYCLE feature to create boot jdk and use it during build
ohair
parents: 715
diff changeset
   203
	@$(java-vm-cleanup)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
export-binary-plugs-jar: $(PLUG_EXPORT_JARFILE)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
# Export binary plug start/complete messages
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
export-binary-plugs-started:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
	@$(ECHO) "BinaryPlugs export started: `date`"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
	@$(ECHO) "PLUG_EXPORT_DIR=$(PLUG_EXPORT_DIR)"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
	$(RM) -r $(PLUG_EXPORT_DIR)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
	@$(MKDIR) -p $(PLUG_EXPORT_DIR)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
	@$(MKDIR) -p $(PLUG_TEMPDIR)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
export-binary-plugs-completed:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
	@$(RM) -r $(PLUG_TEMPDIR)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
	@$(ECHO) "BinaryPlugs export completed: `date`"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
# Export lib files (only if they don't exist already)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
export-binary-plugs-libs: \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
    $(PLUG_LIBRARY_NAMES:%=$(PLUG_EXPORT_DIR)/$(PLUG_LOCATION_SUBDIR)/%)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
# Export everything
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
export-binary-plugs: \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
    export-binary-plugs-started \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
    export-binary-plugs-libs \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
    export-binary-plugs-license \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
    export-binary-plugs-jar \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
    export-binary-plugs-completed
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
# All these targets are phony (no filenames)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
.PHONY: export-binary-plugs-started \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
        export-binary-plugs-license \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
        export-binary-plugs-jar \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
        export-binary-plugs-libs \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
        export-binary-plugs-completed \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
        export-binary-plugs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
# Rules that test the export and import of plugs (only when you can export)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
TEST_OUTPUTDIR=$(ABS_OUTPUTDIR)/../$(PLATFORM)-$(ARCH)-testing-plugs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
TEST_PLUG_COPY=$(TEST_OUTPUTDIR)/$(PLUG_EXPORT_DIRNAME)-testcopy
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
# Run export-binary-plugs first, then use this rule to test an import
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
test-binary-plugs: $(TEST_PLUG_COPY)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
	$(RM) -r $(TEST_OUTPUTDIR)/$(PLUG_EXPORT_DIRNAME)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
	$(MKDIR) -p $(TEST_OUTPUTDIR)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
	@$(ECHO) "Testing import of plugs"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
	($(CD) $(JDK_TOPDIR)/make && \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
	    $(MAKE) OPENJDK=true \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
		ALT_OUTPUTDIR=$(TEST_OUTPUTDIR) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
		ALT_JDK_IMPORT_PATH=$(JDK_IMPORT_PATH) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
		ALT_BINARY_PLUGS_PATH=$(TEST_PLUG_COPY) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
		import-binary-plugs )
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
	$(RM) -r $(TEST_OUTPUTDIR)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
	@$(ECHO) "Testing of plugs was successful"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
$(TEST_PLUG_COPY):
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
	@$(ECHO) "Creating test plug copy"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
	$(RM) -r $@
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
	$(MKDIR) -p $(@D)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
	$(CP) -r -p $(PLUG_EXPORT_DIR) $@
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
.PHONY: test-binary-plugs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
endif # !OPENJDK
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270