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