12047
|
1 |
#
|
|
2 |
# Copyright (c) 2011, 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 |
#
|
|
27 |
# Makefile for building jobjc
|
|
28 |
|
|
29 |
BUILDDIR = ../..
|
|
30 |
include $(BUILDDIR)/common/Defs.gmk
|
|
31 |
SRCDIR = $(JDK_TOPDIR)/src/macosx/native/jobjc
|
|
32 |
|
|
33 |
ifeq ($(PLATFORM),macosx)
|
|
34 |
|
|
35 |
# FRAMEWORKS for which we want to build bridge support
|
|
36 |
FRAMEWORKS = Foundation CoreFoundation AppKit
|
|
37 |
|
|
38 |
# metadata stuff
|
|
39 |
GEN_DIR = $(OUTPUTDIR)/bridge_metadata
|
|
40 |
STABLE_GEN_DIR = $(OUTPUTDIR)/stable_bridge_metadata
|
|
41 |
STABLE_METADATA_FILES = $(addsuffix Full.bridgesupport,$(addprefix $(STABLE_GEN_DIR)/,$(FRAMEWORKS)))
|
|
42 |
|
|
43 |
# source files
|
|
44 |
CORE_SRC = $(shell $(FIND) $(SRCDIR) -type f -name "*.hs" -or -name "*.java" -or -name "*.m" -or -name "*.h" -print)
|
|
45 |
GENERATOR_SRC = $(shell $(FIND) $(SRCDIR) -type f -name "*.java" -print)
|
|
46 |
ADDITIONS_SRC = $(shell $(FIND) $(SRCDIR) -type f -name "*.java" -or -name "*.m" -or -name "*.h" -print)
|
|
47 |
BUILD_SRC = $(SRCDIR)/JObjC.xcodeproj/project.pbxproj $(SRCDIR)/bridgesupport.gmk $(SRCDIR)/build.xml $(SRCDIR)/extract_classes.pl $(SRCDIR)/run-and-write-if-okay $(SRCDIR)/rungen $(SRCDIR)/runjava
|
|
48 |
|
|
49 |
# jobjc products for jdk
|
|
50 |
BUILT_DYLIB = $(OUTPUTDIR)/JObjC.dst/Debug/libJObjC.dylib
|
|
51 |
BUILT_JAR = $(OUTPUTDIR)/JObjC.build/JObjC.jar
|
|
52 |
|
|
53 |
$(GEN_DIR):
|
|
54 |
mkdir -p $(GEN_DIR)
|
|
55 |
|
|
56 |
stabilize: $(GEN_DIR)
|
|
57 |
@echo Updating bridge support in $(GEN_DIR)
|
|
58 |
($(CD) $(GEN_DIR); $(MAKE) STABLE_GEN_DIR="$(STABLE_GEN_DIR)" FRAMEWORKS="$(FRAMEWORKS)" -f $(SRCDIR)/bridgesupport.gmk all)
|
|
59 |
|
|
60 |
$(STABLE_METADATA_FILES): stabilize
|
|
61 |
|
|
62 |
ABS_OUTPUTDIR=$(realpath $(OUTPUTDIR))
|
|
63 |
ABS_STABLE_GEN_DIR=$(realpath $(STABLE_GEN_DIR))
|
|
64 |
|
|
65 |
$(BUILT_DYLIB) $(BUILT_JAR): $(STABLE_METADATA_FILES) $(CORE_SRC) $(GENERATOR_SRC) $(ADDITIONS_SRC) $(BUILD_SRC)
|
|
66 |
@echo JObjC dylib or jar out of data wrt FRAMEWORKS '(' $(FRAMEWORKS) ')' or JObjC source '(' core, generator, additions, build ')'
|
|
67 |
@echo Running ant with java_home set to ${ALT_BOOTDIR}
|
|
68 |
(cd $(SRCDIR); OBJROOT="$(ABS_OUTPUTDIR)/JObjC.build" DSTROOT="$(ABS_OUTPUTDIR)/JObjC.dst" JAVA_HOME=${ALT_BOOTDIR} STABLE_GEN_DIR="$(ABS_STABLE_GEN_DIR)" /usr/bin/ant -verbose all)
|
|
69 |
|
|
70 |
all: $(BUILD_DYLIB) $(BUILT_JAR)
|
|
71 |
$(CP) $(BUILT_DYLIB) $(LIB_LOCATION)/libJObjC.dylib
|
|
72 |
|
|
73 |
clean clobber::
|
|
74 |
(cd $(SRCDIR); export OBJROOT=$(OUTPUTDIR)/JObjC.build; export DSTROOT=$(OUTPUTDIR)/JObjC.dst; /usr/bin/ant clean)
|
|
75 |
|
|
76 |
endif
|