18c2aff776a775d34a4c9893a4c72e0434d68e36artem#
18c2aff776a775d34a4c9893a4c72e0434d68e36artem# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
18c2aff776a775d34a4c9893a4c72e0434d68e36artem# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
18c2aff776a775d34a4c9893a4c72e0434d68e36artem#
18c2aff776a775d34a4c9893a4c72e0434d68e36artem# This code is free software; you can redistribute it and/or modify it
18c2aff776a775d34a4c9893a4c72e0434d68e36artem# under the terms of the GNU General Public License version 2 only, as
ae7c44f85e4d160f633af16b1c85da812de7052cMilan Jurik# published by the Free Software Foundation. Oracle designates this
44faeccf479dbc70538c261f148f9ad6a8b5ed31artem# particular file as subject to the "Classpath" exception as provided
18c2aff776a775d34a4c9893a4c72e0434d68e36artem# by Oracle in the LICENSE file that accompanied this code.
18c2aff776a775d34a4c9893a4c72e0434d68e36artem#
18c2aff776a775d34a4c9893a4c72e0434d68e36artem# This code is distributed in the hope that it will be useful, but WITHOUT
18c2aff776a775d34a4c9893a4c72e0434d68e36artem# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18c2aff776a775d34a4c9893a4c72e0434d68e36artem# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
18c2aff776a775d34a4c9893a4c72e0434d68e36artem# version 2 for more details (a copy is included in the LICENSE file that
18c2aff776a775d34a4c9893a4c72e0434d68e36artem# accompanied this code).
18c2aff776a775d34a4c9893a4c72e0434d68e36artem#
18c2aff776a775d34a4c9893a4c72e0434d68e36artem# You should have received a copy of the GNU General Public License version
18c2aff776a775d34a4c9893a4c72e0434d68e36artem# 2 along with this work; if not, write to the Free Software Foundation,
18c2aff776a775d34a4c9893a4c72e0434d68e36artem# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18c2aff776a775d34a4c9893a4c72e0434d68e36artem#
18c2aff776a775d34a4c9893a4c72e0434d68e36artem# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
18c2aff776a775d34a4c9893a4c72e0434d68e36artem# or visit www.oracle.com if you need additional information or have any
18c2aff776a775d34a4c9893a4c72e0434d68e36artem# questions.
18c2aff776a775d34a4c9893a4c72e0434d68e36artem#
18c2aff776a775d34a4c9893a4c72e0434d68e36artem
18c2aff776a775d34a4c9893a4c72e0434d68e36artem#
18c2aff776a775d34a4c9893a4c72e0434d68e36artem# Makefile for building jobjc
18c2aff776a775d34a4c9893a4c72e0434d68e36artem
18c2aff776a775d34a4c9893a4c72e0434d68e36artemBUILDDIR = ../..
18c2aff776a775d34a4c9893a4c72e0434d68e36arteminclude $(BUILDDIR)/common/Defs.gmk
18c2aff776a775d34a4c9893a4c72e0434d68e36artemSRCDIR = $(JDK_TOPDIR)/src/macosx/native/jobjc
18c2aff776a775d34a4c9893a4c72e0434d68e36artem
18c2aff776a775d34a4c9893a4c72e0434d68e36artemifeq ($(PLATFORM),macosx)
18c2aff776a775d34a4c9893a4c72e0434d68e36artem
18c2aff776a775d34a4c9893a4c72e0434d68e36artem# FRAMEWORKS for which we want to build bridge support
18c2aff776a775d34a4c9893a4c72e0434d68e36artemFRAMEWORKS = Foundation CoreFoundation AppKit
18c2aff776a775d34a4c9893a4c72e0434d68e36artem
18c2aff776a775d34a4c9893a4c72e0434d68e36artem# metadata stuff
18c2aff776a775d34a4c9893a4c72e0434d68e36artemGEN_DIR = $(OUTPUTDIR)/bridge_metadata
18c2aff776a775d34a4c9893a4c72e0434d68e36artemSTABLE_GEN_DIR = $(OUTPUTDIR)/stable_bridge_metadata
18c2aff776a775d34a4c9893a4c72e0434d68e36artemSTABLE_METADATA_FILES = $(addsuffix Full.bridgesupport,$(addprefix $(STABLE_GEN_DIR)/,$(FRAMEWORKS)))
18c2aff776a775d34a4c9893a4c72e0434d68e36artem
18c2aff776a775d34a4c9893a4c72e0434d68e36artem# source files
18c2aff776a775d34a4c9893a4c72e0434d68e36artemCORE_SRC = $(shell $(FIND) $(SRCDIR) -type f -name "*.hs" -or -name "*.java" -or -name "*.m" -or -name "*.h" -print)
18c2aff776a775d34a4c9893a4c72e0434d68e36artemGENERATOR_SRC = $(shell $(FIND) $(SRCDIR) -type f -name "*.java" -print)
18c2aff776a775d34a4c9893a4c72e0434d68e36artemADDITIONS_SRC = $(shell $(FIND) $(SRCDIR) -type f -name "*.java" -or -name "*.m" -or -name "*.h" -print)
18c2aff776a775d34a4c9893a4c72e0434d68e36artemBUILD_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
18c2aff776a775d34a4c9893a4c72e0434d68e36artem
18c2aff776a775d34a4c9893a4c72e0434d68e36artem# jobjc products for jdk
18c2aff776a775d34a4c9893a4c72e0434d68e36artemBUILT_DYLIB = $(OUTPUTDIR)/JObjC.dst/Debug/libJObjC.dylib
18c2aff776a775d34a4c9893a4c72e0434d68e36artemBUILT_JAR = $(OUTPUTDIR)/JObjC.build/JObjC.jar
18c2aff776a775d34a4c9893a4c72e0434d68e36artem
18c2aff776a775d34a4c9893a4c72e0434d68e36artem$(GEN_DIR):
18c2aff776a775d34a4c9893a4c72e0434d68e36artem mkdir -p $(GEN_DIR)
18c2aff776a775d34a4c9893a4c72e0434d68e36artem
18c2aff776a775d34a4c9893a4c72e0434d68e36artemstabilize: $(GEN_DIR)
18c2aff776a775d34a4c9893a4c72e0434d68e36artem @echo Updating bridge support in $(GEN_DIR)
44faeccf479dbc70538c261f148f9ad6a8b5ed31artem ($(CD) $(GEN_DIR); $(MAKE) STABLE_GEN_DIR="$(STABLE_GEN_DIR)" FRAMEWORKS="$(FRAMEWORKS)" -f $(SRCDIR)/bridgesupport.gmk all)
44faeccf479dbc70538c261f148f9ad6a8b5ed31artem
44faeccf479dbc70538c261f148f9ad6a8b5ed31artem$(STABLE_METADATA_FILES): stabilize
44faeccf479dbc70538c261f148f9ad6a8b5ed31artem
44faeccf479dbc70538c261f148f9ad6a8b5ed31artemABS_OUTPUTDIR=$(realpath $(OUTPUTDIR))
44faeccf479dbc70538c261f148f9ad6a8b5ed31artemABS_STABLE_GEN_DIR=$(realpath $(STABLE_GEN_DIR))
44faeccf479dbc70538c261f148f9ad6a8b5ed31artem
44faeccf479dbc70538c261f148f9ad6a8b5ed31artem$(BUILT_DYLIB) $(BUILT_JAR): $(STABLE_METADATA_FILES) $(CORE_SRC) $(GENERATOR_SRC) $(ADDITIONS_SRC) $(BUILD_SRC)
44faeccf479dbc70538c261f148f9ad6a8b5ed31artem @echo JObjC dylib or jar out of data wrt FRAMEWORKS '(' $(FRAMEWORKS) ')' or JObjC source '(' core, generator, additions, build ')'
44faeccf479dbc70538c261f148f9ad6a8b5ed31artem @echo Running ant with java_home set to ${ALT_BOOTDIR}
44faeccf479dbc70538c261f148f9ad6a8b5ed31artem (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)
44faeccf479dbc70538c261f148f9ad6a8b5ed31artem
44faeccf479dbc70538c261f148f9ad6a8b5ed31artemall: $(BUILD_DYLIB) $(BUILT_JAR)
44faeccf479dbc70538c261f148f9ad6a8b5ed31artem $(CP) $(BUILT_DYLIB) $(LIB_LOCATION)/libJObjC.dylib
44faeccf479dbc70538c261f148f9ad6a8b5ed31artem
44faeccf479dbc70538c261f148f9ad6a8b5ed31artemclean clobber::
44faeccf479dbc70538c261f148f9ad6a8b5ed31artem (cd $(SRCDIR); export OBJROOT=$(OUTPUTDIR)/JObjC.build; export DSTROOT=$(OUTPUTDIR)/JObjC.dst; /usr/bin/ant clean)
44faeccf479dbc70538c261f148f9ad6a8b5ed31artem
b483d17c9bc8ef4fad5e72146d0a16739351e9b2Milan Jurikendif
b483d17c9bc8ef4fad5e72146d0a16739351e9b2Milan Jurik