jdk/makefiles/GensrcJObjC.gmk
author amurillo
Wed, 15 Aug 2012 16:49:38 -0700
changeset 13465 d3fc5d192448
parent 13164 72c5d01a857d
child 13702 efd6a05935b2
permissions -rw-r--r--
7191765: make jdk8 the default jprt release for hs24 Reviewed-by: jcoomes
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
13164
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents:
diff changeset
     1
#
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents:
diff changeset
     2
# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents:
diff changeset
     4
#
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents:
diff changeset
     7
# published by the Free Software Foundation.  Oracle designates this
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents:
diff changeset
     8
# particular file as subject to the "Classpath" exception as provided
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents:
diff changeset
     9
# by Oracle in the LICENSE file that accompanied this code.
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents:
diff changeset
    10
#
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents:
diff changeset
    11
# This code is distributed in the hope that it will be useful, but WITHOUT
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents:
diff changeset
    12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents:
diff changeset
    13
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents:
diff changeset
    14
# version 2 for more details (a copy is included in the LICENSE file that
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents:
diff changeset
    15
# accompanied this code).
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents:
diff changeset
    16
#
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents:
diff changeset
    17
# You should have received a copy of the GNU General Public License version
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents:
diff changeset
    18
# 2 along with this work; if not, write to the Free Software Foundation,
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents:
diff changeset
    19
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents:
diff changeset
    20
#
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents:
diff changeset
    21
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents:
diff changeset
    22
# or visit www.oracle.com if you need additional information or have any
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents:
diff changeset
    23
# questions.
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents:
diff changeset
    24
#
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents:
diff changeset
    25
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents:
diff changeset
    26
GENSRC_JOBJC :=
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents:
diff changeset
    27
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents:
diff changeset
    28
JOBJC_FRAMEWORKS := Foundation CoreFoundation AppKit
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents:
diff changeset
    29
FRAMEWORKS_DIR := /System/Library/Frameworks
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents:
diff changeset
    30
GBM := /usr/bin/gen_bridge_metadata
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents:
diff changeset
    31
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents:
diff changeset
    32
JOBJC_SRC := $(JDK_TOPDIR)/src/macosx/native/jobjc
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents:
diff changeset
    33
JOBJC_TMP := $(JDK_OUTPUTDIR)/gensrc_jobjc
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents:
diff changeset
    34
JOBJC_DST := $(JDK_OUTPUTDIR)/gensrc_jobjc/src
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents:
diff changeset
    35
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents:
diff changeset
    36
#
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents:
diff changeset
    37
# Build generator
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents:
diff changeset
    38
#
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents:
diff changeset
    39
$(eval $(call SetupJavaCompilation,BUILD_JOBJC_PRIMITIVE_CODER,\
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents:
diff changeset
    40
		SETUP:=GENERATE_OLDBYTECODE,\
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents:
diff changeset
    41
		INCLUDES:=core/java \
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents:
diff changeset
    42
                          com/apple,\
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents:
diff changeset
    43
                HEADERS :=$(JOBJC_DST)/jni_headers/core ,\
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents:
diff changeset
    44
		SRC:=$(JOBJC_SRC)/src \
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents:
diff changeset
    45
                     $(JOBJC_SRC)/src/generator/java, \
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents:
diff changeset
    46
		BIN:=$(JOBJC_TMP)/bin))
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents:
diff changeset
    47
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents:
diff changeset
    48
GENSRC_JOBJC += $(JOBJC_TMP)/bin/_the.batch
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents:
diff changeset
    49
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents:
diff changeset
    50
#
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents:
diff changeset
    51
# Generate bridge support
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents:
diff changeset
    52
#
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents:
diff changeset
    53
BRIDGESUPPORT := $(addprefix $(JOBJC_TMP)/bridge/,$(addsuffix Full.bridgesupport,$(JOBJC_FRAMEWORKS)))
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents:
diff changeset
    54
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents:
diff changeset
    55
$(JOBJC_TMP)/bridge/%Full.bridgesupport : $(FRAMEWORKS_DIR)/%.framework/Headers/*.h
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents:
diff changeset
    56
	$(MKDIR) -p $(@D)
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents:
diff changeset
    57
	if [ -f $(FRAMEWORKS_DIR)/$*.framework/Resources/BridgeSupport/$(@F) ]; then \
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents:
diff changeset
    58
		cp $(FRAMEWORKS_DIR)/$*.framework/Resources/BridgeSupport/$(@F) $@ ;\
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents:
diff changeset
    59
	else \
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents:
diff changeset
    60
		$(GBM) -F complete --framework $* -o $@ ; \
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents:
diff changeset
    61
	fi
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents:
diff changeset
    62
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents:
diff changeset
    63
#
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents:
diff changeset
    64
# Find Xbootclasspath
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents:
diff changeset
    65
#
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents:
diff changeset
    66
$(JOBJC_TMP)/_the.generator_bootclasspath : $(JOBJC_TMP)/bin/_the.batch
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents:
diff changeset
    67
	$(JAVA) -cp $(JOBJC_TMP)/bin com.apple.internal.jobjc.generator.BootClassPathMinus JObjC.jar > $@.tmp
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents:
diff changeset
    68
	$(MV) $@.tmp $@
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents:
diff changeset
    69
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents:
diff changeset
    70
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents:
diff changeset
    71
#
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents:
diff changeset
    72
# Run generator
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents:
diff changeset
    73
#
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents:
diff changeset
    74
TOOL_JOBJC := $(JAVA) -cp $(JOBJC_TMP)/bin -ea com.apple.internal.jobjc.generator.Generator
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents:
diff changeset
    75
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents:
diff changeset
    76
$(JOBJC_TMP)/_the.generator : $(JOBJC_TMP)/bin/_the.batch $(JOBJC_TMP)/_the.generator_bootclasspath $(BRIDGESUPPORT)
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents:
diff changeset
    77
	$(JAVA) -d64 -Xbootclasspath:`$(CAT) $(JOBJC_TMP)/_the.generator_bootclasspath` -cp $(JOBJC_TMP)/bin -ea com.apple.internal.jobjc.generator.Generator dst=$(JOBJC_DST) frameworks=$(JOBJC_TMP)/bridge
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents:
diff changeset
    78
	$(TOUCH) $@
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents:
diff changeset
    79
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents:
diff changeset
    80
GENSRC_JOBJC += $(JOBJC_TMP)/_the.generator