2013-01-27 03:07:18 +00:00
|
|
|
MAKEFLAGS = -s
|
2007-06-03 23:16:07 +00:00
|
|
|
|
2008-02-19 18:06:52 +00:00
|
|
|
name = avian
|
2014-07-23 22:36:19 +00:00
|
|
|
version := $(shell grep version gradle.properties | cut -d'=' -f2)
|
2008-01-19 00:54:36 +00:00
|
|
|
|
2016-04-28 08:03:52 +00:00
|
|
|
java-version := $(shell "$(JAVA_HOME)/bin/java" -version 2>&1 \
|
2017-09-11 21:41:06 +00:00
|
|
|
| grep 'version "1' \
|
2015-08-06 23:23:14 +00:00
|
|
|
| sed 's/.*version "1.\([^.]*\).*/\1/')
|
|
|
|
|
2011-02-26 19:45:22 +00:00
|
|
|
build-arch := $(shell uname -m \
|
|
|
|
| sed 's/^i.86$$/i386/' \
|
2012-07-18 00:21:17 +00:00
|
|
|
| sed 's/^x86pc$$/i386/' \
|
2012-08-02 16:49:32 +00:00
|
|
|
| sed 's/amd64/x86_64/' \
|
2014-11-26 01:36:34 +00:00
|
|
|
| sed 's/^arm.*$$/arm/' \
|
|
|
|
| sed 's/aarch64/arm64/')
|
2007-06-29 16:42:39 +00:00
|
|
|
|
2009-09-05 21:21:45 +00:00
|
|
|
build-platform := \
|
2008-11-11 15:20:49 +00:00
|
|
|
$(shell uname -s | tr [:upper:] [:lower:] \
|
2014-06-22 18:30:52 +00:00
|
|
|
| sed \
|
2016-04-28 08:03:52 +00:00
|
|
|
-e 's/^mingw64.*$$/mingw32/' \
|
2016-04-27 01:06:25 +00:00
|
|
|
-e 's/^mingw32.*$$/mingw32/' \
|
2014-06-22 18:30:52 +00:00
|
|
|
-e 's/^cygwin.*$$/cygwin/' \
|
|
|
|
-e 's/^darwin.*$$/macosx/')
|
2007-09-21 14:16:43 +00:00
|
|
|
|
2007-10-22 20:56:27 +00:00
|
|
|
arch = $(build-arch)
|
2012-05-01 19:16:32 +00:00
|
|
|
target-arch = $(arch)
|
2014-06-22 18:30:52 +00:00
|
|
|
|
2009-06-01 18:12:29 +00:00
|
|
|
bootimage-platform = \
|
2016-04-27 01:06:25 +00:00
|
|
|
$(subst cygwin,windows,$(subst mingw32,windows,$(build-platform)))
|
2014-06-22 18:30:52 +00:00
|
|
|
|
2009-06-01 18:12:29 +00:00
|
|
|
platform = $(bootimage-platform)
|
2007-09-19 16:22:19 +00:00
|
|
|
|
2013-02-12 15:15:30 +00:00
|
|
|
codegen-targets = native
|
|
|
|
|
2008-01-12 00:35:27 +00:00
|
|
|
mode = fast
|
2008-01-03 19:49:42 +00:00
|
|
|
process = compile
|
2007-07-16 01:03:02 +00:00
|
|
|
|
2009-03-14 21:16:05 +00:00
|
|
|
ifneq ($(process),compile)
|
|
|
|
options := -$(process)
|
|
|
|
endif
|
|
|
|
ifneq ($(mode),fast)
|
|
|
|
options := $(options)-$(mode)
|
|
|
|
endif
|
2012-06-02 15:06:22 +00:00
|
|
|
ifneq ($(lzma),)
|
|
|
|
options := $(options)-lzma
|
|
|
|
endif
|
2009-03-14 21:16:05 +00:00
|
|
|
ifeq ($(bootimage),true)
|
|
|
|
options := $(options)-bootimage
|
2015-10-19 21:10:53 +00:00
|
|
|
ifeq ($(bootimage-test),true)
|
2016-02-15 22:39:31 +00:00
|
|
|
# this option indicates that we should AOT-compile the test
|
|
|
|
# classes as well as the class library
|
2015-10-19 21:10:53 +00:00
|
|
|
options := $(options)-test
|
|
|
|
endif
|
2009-03-14 21:16:05 +00:00
|
|
|
endif
|
2009-05-26 05:27:10 +00:00
|
|
|
ifeq ($(tails),true)
|
|
|
|
options := $(options)-tails
|
|
|
|
endif
|
|
|
|
ifeq ($(continuations),true)
|
|
|
|
options := $(options)-continuations
|
|
|
|
endif
|
2013-02-12 15:15:30 +00:00
|
|
|
ifeq ($(codegen-targets),all)
|
|
|
|
options := $(options)-all
|
|
|
|
endif
|
2010-09-10 21:05:29 +00:00
|
|
|
|
2014-06-30 17:33:51 +00:00
|
|
|
ifeq ($(filter debug debug-fast fast stress stress-major small,$(mode)),)
|
|
|
|
x := $(error "'$(mode)' is not a valid mode (choose one of: debug debug-fast fast stress stress-major small)")
|
2014-05-07 19:01:07 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(filter compile interpret,$(process)),)
|
|
|
|
x := $(error "'$(process)' is not a valid process (choose one of: compile interpret)")
|
|
|
|
endif
|
|
|
|
|
2014-11-26 01:36:34 +00:00
|
|
|
ifeq ($(filter x86_64 i386 arm arm64,$(arch)),)
|
|
|
|
x := $(error "'$(arch)' is not a supported architecture (choose one of: x86_64 i386 arm arm64)")
|
2014-05-07 19:01:07 +00:00
|
|
|
endif
|
|
|
|
|
2014-06-22 18:30:52 +00:00
|
|
|
ifeq ($(platform),darwin)
|
2014-10-28 20:49:50 +00:00
|
|
|
x := $(error "please use 'platform=macosx' or 'platform=ios' instead of 'platform=$(platform)'")
|
2014-06-22 18:30:52 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(ios),)
|
|
|
|
x := $(error "please use 'platform=ios' instead of 'ios=true'")
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(filter linux windows macosx ios freebsd,$(platform)),)
|
|
|
|
x := $(error "'$(platform)' is not a supported platform (choose one of: linux windows macosx ios freebsd)")
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(platform),macosx)
|
2014-11-27 03:05:46 +00:00
|
|
|
ifneq ($(filter arm arm64,$(arch)),)
|
2014-12-09 21:44:28 +00:00
|
|
|
x := $(error "please use ('arch=arm' or 'arch=arm64') 'platform=ios' to build for ios-arm")
|
2014-06-22 18:30:52 +00:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(platform),ios)
|
2015-03-16 17:32:35 +00:00
|
|
|
ifeq ($(filter i386 x86_64 arm arm64,$(arch)),)
|
|
|
|
x := $(error "please specify 'arch=i386', 'arch=x86_64', 'arch=arm', or 'arch=arm64' with 'platform=ios'")
|
2014-06-22 18:30:52 +00:00
|
|
|
endif
|
2014-05-07 19:01:07 +00:00
|
|
|
endif
|
|
|
|
|
2015-10-20 14:33:17 +00:00
|
|
|
ifeq ($(bootimage-test),true)
|
|
|
|
ifneq ($(bootimage),true)
|
|
|
|
x := $(error "bootimage-test=true only works when bootimage=true")
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2013-01-30 05:31:02 +00:00
|
|
|
aot-only = false
|
2010-09-20 23:31:23 +00:00
|
|
|
root := $(shell (cd .. && pwd))
|
|
|
|
build = build/$(platform)-$(arch)$(options)
|
2013-01-28 17:15:29 +00:00
|
|
|
host-build-root = $(build)/host
|
2010-09-20 23:31:23 +00:00
|
|
|
classpath-build = $(build)/classpath
|
|
|
|
test-build = $(build)/test
|
|
|
|
src = src
|
|
|
|
classpath-src = classpath
|
|
|
|
test = test
|
2013-02-15 03:54:20 +00:00
|
|
|
unittest = unittest
|
2012-02-20 23:25:37 +00:00
|
|
|
win32 ?= $(root)/win32
|
|
|
|
win64 ?= $(root)/win64
|
2013-01-28 15:20:52 +00:00
|
|
|
winrt ?= $(root)/winrt
|
|
|
|
wp8 ?= $(root)/wp8
|
2010-09-20 23:31:23 +00:00
|
|
|
|
2010-09-10 21:05:29 +00:00
|
|
|
classpath = avian
|
|
|
|
|
2015-10-19 21:10:53 +00:00
|
|
|
bootimage-classpath = $(classpath-build)
|
|
|
|
|
|
|
|
ifeq ($(bootimage-test),true)
|
|
|
|
bootimage-classpath = $(classpath-build):$(test-build)
|
|
|
|
endif
|
|
|
|
|
2016-02-15 22:39:31 +00:00
|
|
|
ifeq ($(use-werror),true)
|
|
|
|
werror = -Werror
|
|
|
|
endif
|
|
|
|
|
2011-10-01 00:40:43 +00:00
|
|
|
test-executable = $(shell pwd)/$(executable)
|
2010-09-20 23:31:23 +00:00
|
|
|
boot-classpath = $(classpath-build)
|
2010-11-05 19:18:28 +00:00
|
|
|
embed-prefix = /avian-embedded
|
2010-09-10 21:05:29 +00:00
|
|
|
|
2010-11-13 01:29:12 +00:00
|
|
|
native-path = echo
|
|
|
|
|
2014-06-22 18:30:52 +00:00
|
|
|
platform-kernel = $(subst macosx,darwin,$(subst ios,darwin,$1))
|
|
|
|
|
|
|
|
build-kernel = $(call platform-kernel,$(build-platform))
|
|
|
|
kernel = $(call platform-kernel,$(platform))
|
|
|
|
|
2010-11-13 01:29:12 +00:00
|
|
|
ifeq ($(build-platform),cygwin)
|
|
|
|
native-path = cygpath -m
|
|
|
|
endif
|
|
|
|
|
2012-06-02 21:43:42 +00:00
|
|
|
windows-path = echo
|
|
|
|
|
2010-11-13 01:29:12 +00:00
|
|
|
path-separator = :
|
|
|
|
|
2016-04-27 01:06:25 +00:00
|
|
|
ifneq (,$(filter mingw32 cygwin,$(build-platform)))
|
2010-11-13 01:29:12 +00:00
|
|
|
path-separator = ;
|
|
|
|
endif
|
|
|
|
|
2014-02-22 22:35:12 +00:00
|
|
|
target-path-separator = :
|
|
|
|
|
|
|
|
ifeq ($(platform),windows)
|
|
|
|
target-path-separator = ;
|
|
|
|
endif
|
|
|
|
|
2010-11-16 03:28:53 +00:00
|
|
|
library-path-variable = LD_LIBRARY_PATH
|
|
|
|
|
2014-06-22 18:30:52 +00:00
|
|
|
ifeq ($(build-kernel),darwin)
|
2010-11-16 03:28:53 +00:00
|
|
|
library-path-variable = DYLD_LIBRARY_PATH
|
|
|
|
endif
|
|
|
|
|
2012-08-02 18:56:15 +00:00
|
|
|
library-path = $(library-path-variable)=$(build)
|
2012-08-01 16:02:55 +00:00
|
|
|
|
2013-12-07 23:38:00 +00:00
|
|
|
|
|
|
|
|
2010-11-26 19:41:31 +00:00
|
|
|
ifneq ($(openjdk),)
|
2016-01-13 00:37:03 +00:00
|
|
|
openjdk-version := $(shell $(openjdk)/bin/java -version 2>&1 \
|
2017-09-11 21:41:06 +00:00
|
|
|
| grep 'version "1' \
|
2016-01-13 00:37:03 +00:00
|
|
|
| sed 's/.*version "1.\([^.]*\).*/\1/')
|
|
|
|
|
2010-11-16 03:28:53 +00:00
|
|
|
openjdk-arch = $(arch)
|
|
|
|
ifeq ($(arch),x86_64)
|
|
|
|
openjdk-arch = amd64
|
|
|
|
endif
|
|
|
|
|
2014-05-07 19:01:07 +00:00
|
|
|
ifneq ($(android),)
|
|
|
|
x := $(error "android and openjdk are incompatible")
|
|
|
|
endif
|
|
|
|
|
2017-11-21 17:06:18 +00:00
|
|
|
ifeq ($(openjdk-image),)
|
|
|
|
openjdk-image = $(openjdk)/jre
|
|
|
|
endif
|
|
|
|
|
2010-11-26 19:41:31 +00:00
|
|
|
ifneq ($(openjdk-src),)
|
2010-11-04 17:02:09 +00:00
|
|
|
include openjdk-src.mk
|
2013-06-04 19:32:22 +00:00
|
|
|
options := $(options)-openjdk-src
|
2010-11-27 18:25:02 +00:00
|
|
|
classpath-objects = $(openjdk-objects) $(openjdk-local-objects)
|
2010-11-05 19:18:28 +00:00
|
|
|
classpath-cflags = -DAVIAN_OPENJDK_SRC -DBOOT_JAVAHOME
|
2010-11-04 17:02:09 +00:00
|
|
|
openjdk-jar-dep = $(build)/openjdk-jar.dep
|
|
|
|
classpath-jar-dep = $(openjdk-jar-dep)
|
2010-11-05 19:18:28 +00:00
|
|
|
javahome = $(embed-prefix)/javahomeJar
|
2014-04-23 23:09:52 +00:00
|
|
|
javahome-files = lib/currency.data lib/security/java.security \
|
2011-04-10 21:51:17 +00:00
|
|
|
lib/security/java.policy lib/security/cacerts
|
|
|
|
|
2014-04-23 23:09:52 +00:00
|
|
|
ifneq (,$(wildcard $(openjdk)/jre/lib/zi))
|
|
|
|
javahome-files += lib/zi
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq (,$(wildcard $(openjdk)/jre/lib/tzdb.dat))
|
|
|
|
javahome-files += lib/tzdb.dat
|
|
|
|
endif
|
|
|
|
|
2011-04-10 21:51:17 +00:00
|
|
|
local-policy = lib/security/local_policy.jar
|
2014-04-23 23:09:52 +00:00
|
|
|
ifneq (,$(wildcard $(openjdk)/jre/$(local-policy)))
|
2011-04-10 21:51:17 +00:00
|
|
|
javahome-files += $(local-policy)
|
|
|
|
endif
|
|
|
|
|
|
|
|
export-policy = lib/security/US_export_policy.jar
|
2014-04-23 23:09:52 +00:00
|
|
|
ifneq (,$(wildcard $(openjdk)/jre/$(export-policy)))
|
2011-04-10 21:51:17 +00:00
|
|
|
javahome-files += $(export-policy)
|
|
|
|
endif
|
|
|
|
|
2010-11-07 17:08:04 +00:00
|
|
|
ifeq ($(platform),windows)
|
|
|
|
javahome-files += lib/tzmappings
|
|
|
|
endif
|
2010-11-05 19:18:28 +00:00
|
|
|
javahome-object = $(build)/javahome-jar.o
|
2010-12-06 00:40:50 +00:00
|
|
|
boot-javahome-object = $(build)/boot-javahome.o
|
2013-03-26 14:30:26 +00:00
|
|
|
stub-sources = $(src)/openjdk/stubs.cpp
|
|
|
|
stub-objects = $(call cpp-objects,$(stub-sources),$(src),$(build))
|
2010-11-04 17:02:09 +00:00
|
|
|
else
|
2014-04-12 01:32:16 +00:00
|
|
|
soname-flag = -Wl,-soname -Wl,$(so-prefix)jvm$(so-suffix)
|
|
|
|
version-script-flag = -Wl,--version-script=openjdk.ld
|
2013-06-04 19:32:22 +00:00
|
|
|
options := $(options)-openjdk
|
2011-10-01 00:40:43 +00:00
|
|
|
test-executable = $(shell pwd)/$(executable-dynamic)
|
2014-06-22 18:30:52 +00:00
|
|
|
ifeq ($(build-kernel),darwin)
|
2012-03-16 17:01:20 +00:00
|
|
|
library-path = \
|
2012-08-02 18:56:15 +00:00
|
|
|
$(library-path-variable)=$(build):$(openjdk)/jre/lib
|
2012-03-16 17:01:20 +00:00
|
|
|
else
|
|
|
|
library-path = \
|
2012-08-02 18:56:15 +00:00
|
|
|
$(library-path-variable)=$(build):$(openjdk)/jre/lib/$(openjdk-arch)
|
2012-03-16 17:01:20 +00:00
|
|
|
endif
|
2010-11-13 01:29:12 +00:00
|
|
|
javahome = "$$($(native-path) "$(openjdk)/jre")"
|
2010-11-04 17:02:09 +00:00
|
|
|
endif
|
|
|
|
|
2017-07-19 12:29:47 +00:00
|
|
|
ifeq ($(openjdk-image),)
|
|
|
|
openjdk-image = $(openjdk)/jre
|
|
|
|
endif
|
|
|
|
|
2013-01-28 17:15:29 +00:00
|
|
|
classpath = openjdk
|
2010-11-13 01:29:12 +00:00
|
|
|
boot-classpath := "$(boot-classpath)$(path-separator)$$($(native-path) "$(openjdk)/jre/lib/rt.jar")"
|
2010-11-05 19:18:28 +00:00
|
|
|
build-javahome = $(openjdk)/jre
|
2009-06-03 00:55:49 +00:00
|
|
|
endif
|
2009-03-14 21:16:05 +00:00
|
|
|
|
2013-02-19 16:36:19 +00:00
|
|
|
ifneq ($(android),)
|
|
|
|
options := $(options)-android
|
|
|
|
classpath-jar-dep = $(build)/android.dep
|
|
|
|
luni-native = $(android)/libcore/luni/src/main/native
|
2013-02-23 00:23:59 +00:00
|
|
|
classpath-cflags = -DBOOT_JAVAHOME
|
2014-04-04 16:21:16 +00:00
|
|
|
android-cflags = -I$(luni-native) \
|
2013-02-19 16:36:19 +00:00
|
|
|
-I$(android)/libnativehelper/include/nativehelper \
|
2014-08-21 19:09:42 +00:00
|
|
|
-I$(android)/libnativehelper \
|
2013-04-22 23:10:23 +00:00
|
|
|
-I$(android)/system/core/include \
|
|
|
|
-I$(android)/external/zlib \
|
|
|
|
-I$(android)/external/icu4c/i18n \
|
|
|
|
-I$(android)/external/icu4c/common \
|
|
|
|
-I$(android)/external/expat \
|
|
|
|
-I$(android)/external/openssl/include \
|
2014-08-22 13:05:58 +00:00
|
|
|
-I$(android)/external/openssl \
|
2013-02-19 16:36:19 +00:00
|
|
|
-I$(android)/libcore/include \
|
|
|
|
-I$(build)/android-src/external/fdlibm \
|
|
|
|
-I$(build)/android-src \
|
|
|
|
-fno-exceptions \
|
2013-02-19 23:48:33 +00:00
|
|
|
-D_FILE_OFFSET_BITS=64 \
|
2013-07-05 20:34:16 +00:00
|
|
|
-DOS_SHARED_LIB_FORMAT_STR="\"$(so-prefix)%s$(so-suffix)\"" \
|
|
|
|
-DJNI_JARJAR_PREFIX= \
|
2013-07-31 22:20:32 +00:00
|
|
|
-D__DARWIN_UNIX03=1 \
|
2014-03-03 20:41:58 +00:00
|
|
|
-D__PROVIDE_FIXMES \
|
2014-08-22 13:05:58 +00:00
|
|
|
-DSTATIC_LIB \
|
2015-06-02 21:01:03 +00:00
|
|
|
-D__STDC_FORMAT_MACROS=1 \
|
2013-02-25 23:41:46 +00:00
|
|
|
-g3 \
|
2014-09-02 16:14:04 +00:00
|
|
|
-Wno-shift-count-overflow
|
2014-10-08 22:32:56 +00:00
|
|
|
|
2014-08-31 22:35:06 +00:00
|
|
|
# on Windows (in MinGW-based build) there are neither __BEGIN_DECLS nor __END_DECLS
|
|
|
|
# defines; we don't want to patch every file that uses them, so we stub them in
|
|
|
|
# using CFLAGS mechanism
|
2014-10-09 13:50:09 +00:00
|
|
|
# Also we have off64_t defined in mingw-w64 headers, so let's tell that
|
2014-08-31 22:35:06 +00:00
|
|
|
ifeq ($(platform),windows)
|
2014-10-09 13:50:09 +00:00
|
|
|
android-cflags += "-D__BEGIN_DECLS=extern \"C\" {" "-D__END_DECLS=}" "-DHAVE_OFF64_T"
|
2014-08-31 22:35:06 +00:00
|
|
|
endif
|
2013-03-14 21:33:05 +00:00
|
|
|
|
2013-07-05 20:34:16 +00:00
|
|
|
luni-cpps := $(shell find $(luni-native) -name '*.cpp')
|
|
|
|
|
2014-08-21 19:09:42 +00:00
|
|
|
libziparchive-native := $(android)/system/core/libziparchive
|
|
|
|
libziparchive-ccs := $(libziparchive-native)/zip_archive.cc
|
|
|
|
|
|
|
|
libutils-native := $(android)/system/core/libutils
|
|
|
|
libutils-cpps := $(libutils-native)/FileMap.cpp
|
|
|
|
|
2013-07-05 20:34:16 +00:00
|
|
|
libnativehelper-native := $(android)/libnativehelper
|
|
|
|
libnativehelper-cpps := $(libnativehelper-native)/JniConstants.cpp \
|
|
|
|
$(libnativehelper-native)/toStringArray.cpp
|
|
|
|
|
2014-08-22 13:05:58 +00:00
|
|
|
crypto-native := $(android)/external/conscrypt/src/main/native
|
2014-04-12 01:32:16 +00:00
|
|
|
crypto-cpps := $(crypto-native)/org_conscrypt_NativeCrypto.cpp
|
2014-03-15 18:21:24 +00:00
|
|
|
|
2013-03-14 21:33:05 +00:00
|
|
|
ifeq ($(platform),windows)
|
2014-09-01 20:20:38 +00:00
|
|
|
android-cflags += -D__STDC_CONSTANT_MACROS -DHAVE_WIN32_FILEMAP -D__STDC_FORMAT_MACROS
|
2013-03-14 21:33:05 +00:00
|
|
|
blacklist = $(luni-native)/java_io_Console.cpp \
|
2014-08-21 19:09:42 +00:00
|
|
|
$(luni-native)/java_lang_ProcessManager.cpp
|
2014-04-12 01:32:16 +00:00
|
|
|
|
2014-09-01 21:09:29 +00:00
|
|
|
icu-libs := $(android)/external/icu4c/lib/libsicuin.a \
|
|
|
|
$(android)/external/icu4c/lib/libsicuuc.a \
|
2013-04-22 23:10:23 +00:00
|
|
|
$(android)/external/icu4c/lib/sicudt.a
|
2015-06-02 21:01:03 +00:00
|
|
|
platform-lflags := -lgdi32 -lshlwapi -lwsock32 -static-libgcc -static-libstdc++ -Wl,-Bstatic -lstdc++ -lpthread -Wl,-Bdynamic
|
2013-03-14 21:33:05 +00:00
|
|
|
else
|
2014-08-21 19:09:42 +00:00
|
|
|
android-cflags += -fPIC -DHAVE_SYS_UIO_H -DHAVE_POSIX_FILEMAP
|
|
|
|
blacklist =
|
2014-07-01 16:18:45 +00:00
|
|
|
|
2013-04-22 23:10:23 +00:00
|
|
|
icu-libs := $(android)/external/icu4c/lib/libicui18n.a \
|
|
|
|
$(android)/external/icu4c/lib/libicuuc.a \
|
|
|
|
$(android)/external/icu4c/lib/libicudata.a
|
2013-03-14 21:33:05 +00:00
|
|
|
endif
|
2014-07-29 09:01:51 +00:00
|
|
|
luni-cpps := $(filter-out $(blacklist),$(luni-cpps))
|
2013-03-14 21:33:05 +00:00
|
|
|
|
2013-02-26 23:24:02 +00:00
|
|
|
classpath-lflags := \
|
2013-03-14 21:33:05 +00:00
|
|
|
$(icu-libs) \
|
2013-04-22 23:10:23 +00:00
|
|
|
$(android)/external/fdlibm/libfdm.a \
|
|
|
|
$(android)/external/expat/.libs/libexpat.a \
|
2013-02-27 17:03:17 +00:00
|
|
|
$(android)/openssl-upstream/libssl.a \
|
|
|
|
$(android)/openssl-upstream/libcrypto.a \
|
2013-03-14 21:33:05 +00:00
|
|
|
$(platform-lflags) \
|
2013-02-19 23:48:33 +00:00
|
|
|
-lstdc++
|
2013-03-14 21:33:05 +00:00
|
|
|
|
2013-12-08 01:49:23 +00:00
|
|
|
ifeq ($(platform),linux)
|
2014-09-02 16:14:04 +00:00
|
|
|
android-cflags += -DHAVE_OFF64_T
|
2013-12-08 01:49:23 +00:00
|
|
|
classpath-lflags += -lrt
|
|
|
|
endif
|
2013-07-07 17:35:20 +00:00
|
|
|
|
2013-02-19 16:36:19 +00:00
|
|
|
classpath-objects = \
|
2013-07-05 20:34:16 +00:00
|
|
|
$(call cpp-objects,$(luni-cpps),$(luni-native),$(build)) \
|
|
|
|
$(call cpp-objects,$(crypto-cpps),$(crypto-native),$(build)) \
|
2014-08-21 19:09:42 +00:00
|
|
|
$(call cpp-objects,$(libnativehelper-cpps),$(libnativehelper-native),$(build)) \
|
|
|
|
$(call cc-objects,$(libziparchive-ccs),$(libziparchive-native),$(build)) \
|
|
|
|
$(call cpp-objects,$(libutils-cpps),$(libutils-native),$(build))
|
2013-02-19 16:36:19 +00:00
|
|
|
luni-java = $(android)/libcore/luni/src/main/java
|
2014-08-21 19:09:42 +00:00
|
|
|
|
|
|
|
luni-blacklist = \
|
|
|
|
$(luni-java)/libcore/reflect/AnnotationAccess.java
|
|
|
|
|
|
|
|
luni-javas := \
|
|
|
|
$(filter-out $(luni-blacklist),$(shell find $(luni-java) -name '*.java'))
|
|
|
|
|
2014-03-30 19:41:26 +00:00
|
|
|
luni-nonjavas := $(shell find $(luni-java) -not -type d -not -name '*.java')
|
|
|
|
luni-copied-nonjavas = $(call noop-files,$(luni-nonjavas),$(luni-java),)
|
2014-08-21 19:09:42 +00:00
|
|
|
|
2014-08-22 13:05:58 +00:00
|
|
|
crypto-java = $(android)/external/conscrypt/src/main/java
|
2013-07-05 20:34:16 +00:00
|
|
|
crypto-javas := $(shell find $(crypto-java) -name '*.java')
|
2014-08-22 13:05:58 +00:00
|
|
|
|
|
|
|
crypto-platform-java = $(android)/external/conscrypt/src/platform/java
|
|
|
|
crypto-platform-javas := $(shell find $(crypto-platform-java) -name '*.java')
|
|
|
|
|
2013-02-19 16:36:19 +00:00
|
|
|
dalvik-java = $(android)/libcore/dalvik/src/main/java
|
2014-08-21 19:09:42 +00:00
|
|
|
dalvik-javas := \
|
|
|
|
$(dalvik-java)/dalvik/system/DalvikLogHandler.java \
|
|
|
|
$(dalvik-java)/dalvik/system/CloseGuard.java \
|
|
|
|
$(dalvik-java)/dalvik/system/VMDebug.java \
|
|
|
|
$(dalvik-java)/dalvik/system/BlockGuard.java \
|
|
|
|
$(dalvik-java)/dalvik/system/SocketTagger.java \
|
|
|
|
$(dalvik-java)/dalvik/system/DalvikLogging.java \
|
|
|
|
|
|
|
|
libart-java = $(android)/libcore/libart/src/main/java
|
|
|
|
libart-javas := \
|
|
|
|
$(libart-java)/dalvik/system/VMRuntime.java \
|
|
|
|
$(libart-java)/dalvik/system/VMStack.java \
|
|
|
|
$(libart-java)/java/lang/Thread.java \
|
|
|
|
$(libart-java)/java/lang/ThreadGroup.java \
|
|
|
|
$(libart-java)/java/lang/Enum.java \
|
|
|
|
$(libart-java)/java/lang/String.java \
|
|
|
|
$(libart-java)/java/lang/ref/Reference.java \
|
|
|
|
$(libart-java)/java/lang/reflect/AccessibleObject.java \
|
|
|
|
|
2013-02-19 16:36:19 +00:00
|
|
|
xml-java = $(android)/libcore/xml/src/main/java
|
|
|
|
xml-javas := $(shell find $(xml-java) -name '*.java')
|
2014-11-23 09:55:09 +00:00
|
|
|
|
|
|
|
okhttp-android-java = $(android)/external/okhttp/android/main/java
|
|
|
|
okhttp-android-javas := $(shell find $(okhttp-android-java) -name '*.java')
|
|
|
|
|
|
|
|
okhttp-java = $(android)/external/okhttp/okhttp/src/main/java
|
|
|
|
okhttp-javas := $(shell find $(okhttp-java) -name '*.java')
|
|
|
|
|
|
|
|
okio-java = $(android)/external/okhttp/okio/src/main/java
|
|
|
|
okio-javas := $(shell find $(okio-java) -name '*.java')
|
2015-01-22 16:57:15 +00:00
|
|
|
|
2014-11-23 09:55:09 +00:00
|
|
|
bcpkix-java = $(android)/external/bouncycastle/bcpkix/src/main/java
|
|
|
|
bcpkix-javas := $(shell find $(bcpkix-java) -name '*.java')
|
|
|
|
|
|
|
|
bcprov-java = $(android)/external/bouncycastle/bcprov/src/main/java
|
|
|
|
bcprov-javas := $(shell find $(bcprov-java) -name '*.java')
|
2015-01-22 16:57:15 +00:00
|
|
|
|
2013-02-19 16:36:19 +00:00
|
|
|
android-classes = \
|
|
|
|
$(call java-classes,$(luni-javas),$(luni-java),$(build)/android) \
|
2013-07-05 20:34:16 +00:00
|
|
|
$(call java-classes,$(crypto-javas),$(crypto-java),$(build)/android) \
|
2014-08-22 13:05:58 +00:00
|
|
|
$(call java-classes,$(crypto-platform-javas),$(crypto-platform-java),$(build)/android) \
|
2013-02-19 16:36:19 +00:00
|
|
|
$(call java-classes,$(dalvik-javas),$(dalvik-java),$(build)/android) \
|
2014-08-21 19:09:42 +00:00
|
|
|
$(call java-classes,$(libart-javas),$(libart-java),$(build)/android) \
|
2014-11-23 09:55:09 +00:00
|
|
|
$(call java-classes,$(xml-javas),$(xml-java),$(build)/android) \
|
|
|
|
$(call java-classes,$(okhttp-javas),$(okhttp-java),$(build)/android) \
|
|
|
|
$(call java-classes,$(okhttp-android-javas),$(okhttp-android-java),$(build)/android) \
|
|
|
|
$(call java-classes,$(okio-javas),$(okio-java),$(build)/android) \
|
|
|
|
$(call java-classes,$(bcpkix-javas),$(bcpkix-java),$(build)/android) \
|
|
|
|
$(call java-classes,$(bcprov-javas),$(bcprov-java),$(build)/android)
|
|
|
|
|
2013-02-19 16:36:19 +00:00
|
|
|
classpath = android
|
2013-02-23 00:23:59 +00:00
|
|
|
|
|
|
|
javahome-files = tzdata
|
|
|
|
javahome-object = $(build)/javahome-jar.o
|
|
|
|
boot-javahome-object = $(build)/boot-javahome.o
|
|
|
|
build-javahome = $(android)/bionic/libc/zoneinfo
|
2013-03-14 21:33:05 +00:00
|
|
|
stub-sources = $(src)/android/stubs.cpp
|
|
|
|
stub-objects = $(call cpp-objects,$(stub-sources),$(src),$(build))
|
2013-02-19 16:36:19 +00:00
|
|
|
endif
|
|
|
|
|
2010-11-04 17:02:09 +00:00
|
|
|
ifeq ($(classpath),avian)
|
2010-09-10 21:05:29 +00:00
|
|
|
jni-sources := $(shell find $(classpath-src) -name '*.cpp')
|
2010-09-17 22:03:37 +00:00
|
|
|
jni-objects = $(call cpp-objects,$(jni-sources),$(classpath-src),$(build))
|
2010-11-04 17:02:09 +00:00
|
|
|
classpath-objects = $(jni-objects)
|
2009-06-04 23:54:06 +00:00
|
|
|
endif
|
|
|
|
|
2007-12-31 22:40:56 +00:00
|
|
|
input = List
|
2007-10-25 22:06:05 +00:00
|
|
|
|
2016-04-27 01:06:25 +00:00
|
|
|
ifeq ($(use-clang),true)
|
|
|
|
build-cxx = clang++ -std=c++11
|
|
|
|
build-cc = clang
|
|
|
|
else
|
|
|
|
build-cxx = g++
|
|
|
|
build-cc = gcc
|
|
|
|
endif
|
|
|
|
|
2010-02-06 00:15:12 +00:00
|
|
|
mflag =
|
2014-06-22 18:30:52 +00:00
|
|
|
ifneq ($(kernel),darwin)
|
2010-09-10 21:05:29 +00:00
|
|
|
ifeq ($(arch),i386)
|
|
|
|
mflag = -m32
|
|
|
|
endif
|
|
|
|
ifeq ($(arch),x86_64)
|
|
|
|
mflag = -m64
|
|
|
|
endif
|
2010-02-04 18:15:16 +00:00
|
|
|
endif
|
2010-02-05 23:40:48 +00:00
|
|
|
|
2012-08-02 18:15:15 +00:00
|
|
|
target-format = elf
|
|
|
|
|
2016-04-27 01:06:25 +00:00
|
|
|
cxx = $(build-cxx) $(mflag)
|
|
|
|
cc = $(build-cc) $(mflag)
|
2010-02-06 00:15:12 +00:00
|
|
|
|
2007-10-23 23:23:55 +00:00
|
|
|
ar = ar
|
|
|
|
ranlib = ranlib
|
2008-11-11 15:20:49 +00:00
|
|
|
dlltool = dlltool
|
2008-01-04 02:17:42 +00:00
|
|
|
vg = nice valgrind --num-callers=32 --db-attach=yes --freelist-vol=100000000
|
2008-05-19 04:24:12 +00:00
|
|
|
vg += --leak-check=full --suppressions=valgrind.supp
|
2007-08-19 19:45:51 +00:00
|
|
|
db = gdb --args
|
2013-02-06 17:04:55 +00:00
|
|
|
javac = "$(JAVA_HOME)/bin/javac" -encoding UTF-8
|
2010-11-04 17:02:09 +00:00
|
|
|
javah = "$(JAVA_HOME)/bin/javah"
|
2008-11-11 15:20:49 +00:00
|
|
|
jar = "$(JAVA_HOME)/bin/jar"
|
2009-08-24 22:38:00 +00:00
|
|
|
strip = strip
|
2007-11-01 20:00:22 +00:00
|
|
|
strip-all = --strip-all
|
2007-06-03 23:16:07 +00:00
|
|
|
|
2007-10-22 20:56:27 +00:00
|
|
|
rdynamic = -rdynamic
|
|
|
|
|
2013-01-28 15:20:52 +00:00
|
|
|
cflags_debug = -O0 -g3
|
|
|
|
cflags_debug_fast = -O0 -g3
|
|
|
|
cflags_stress = -O0 -g3
|
|
|
|
cflags_stress_major = -O0 -g3
|
|
|
|
ifeq ($(use-clang),true)
|
2013-12-18 21:53:46 +00:00
|
|
|
cflags_fast = -O3 -g3
|
2013-01-28 15:20:52 +00:00
|
|
|
cflags_small = -Oz -g3
|
|
|
|
else
|
|
|
|
cflags_fast = -O3 -g3
|
|
|
|
cflags_small = -Os -g3
|
|
|
|
endif
|
|
|
|
|
2009-03-14 21:16:05 +00:00
|
|
|
# note that we suppress the non-virtual-dtor warning because we never
|
2008-11-11 15:20:49 +00:00
|
|
|
# use the delete operator, which means we don't need virtual
|
|
|
|
# destructors:
|
2016-02-15 22:39:31 +00:00
|
|
|
warnings = -Wall -Wextra $(werror) -Wunused-parameter -Winit-self \
|
2008-11-11 15:20:49 +00:00
|
|
|
-Wno-non-virtual-dtor
|
2007-06-03 23:16:07 +00:00
|
|
|
|
2011-09-01 03:18:00 +00:00
|
|
|
target-cflags = -DTARGET_BYTES_PER_WORD=$(pointer-size)
|
|
|
|
|
2014-07-12 05:15:09 +00:00
|
|
|
common-cflags = $(warnings) -std=c++0x -fno-rtti -fno-exceptions -I$(classpath-src) \
|
2013-02-27 19:02:59 +00:00
|
|
|
"-I$(JAVA_HOME)/include" -I$(src) -I$(build) -Iinclude $(classpath-cflags) \
|
2008-03-31 03:43:43 +00:00
|
|
|
-D__STDC_LIMIT_MACROS -D_JNI_IMPLEMENTATION_ -DAVIAN_VERSION=\"$(version)\" \
|
2012-09-05 12:31:30 +00:00
|
|
|
-DAVIAN_INFO="\"$(info)\"" \
|
2010-11-13 01:29:12 +00:00
|
|
|
-DUSE_ATOMIC_OPERATIONS -DAVIAN_JAVA_HOME=\"$(javahome)\" \
|
2011-09-01 03:18:00 +00:00
|
|
|
-DAVIAN_EMBED_PREFIX=\"$(embed-prefix)\" $(target-cflags)
|
2007-10-23 23:23:55 +00:00
|
|
|
|
2013-01-28 15:20:52 +00:00
|
|
|
asmflags = $(target-cflags) -I$(src)
|
2012-06-20 19:14:16 +00:00
|
|
|
|
2011-01-29 00:05:42 +00:00
|
|
|
ifneq (,$(filter i386 x86_64,$(arch)))
|
|
|
|
ifeq ($(use-frame-pointer),true)
|
|
|
|
common-cflags += -fno-omit-frame-pointer -DAVIAN_USE_FRAME_POINTER
|
|
|
|
asmflags += -DAVIAN_USE_FRAME_POINTER
|
|
|
|
endif
|
2011-01-28 04:06:01 +00:00
|
|
|
endif
|
|
|
|
|
2007-10-26 14:34:54 +00:00
|
|
|
build-cflags = $(common-cflags) -fPIC -fvisibility=hidden \
|
2017-02-21 14:00:49 +00:00
|
|
|
"-I$(JAVA_HOME)/include/linux" $(extra-build-cflags) -I$(src) -pthread
|
2007-10-26 14:34:54 +00:00
|
|
|
|
2014-07-12 05:15:09 +00:00
|
|
|
converter-cflags = -D__STDC_CONSTANT_MACROS -std=c++0x -Iinclude/ -Isrc/ \
|
2012-05-01 19:16:32 +00:00
|
|
|
-fno-rtti -fno-exceptions \
|
|
|
|
-DAVIAN_TARGET_ARCH=AVIAN_ARCH_UNKNOWN \
|
2012-08-02 18:15:15 +00:00
|
|
|
-DAVIAN_TARGET_FORMAT=AVIAN_FORMAT_UNKNOWN \
|
2016-02-15 22:39:31 +00:00
|
|
|
-Wall -Wextra $(werror) -Wunused-parameter -Winit-self -Wno-non-virtual-dtor
|
2010-11-23 22:54:35 +00:00
|
|
|
|
2007-10-26 14:34:54 +00:00
|
|
|
cflags = $(build-cflags)
|
|
|
|
|
2013-03-04 21:24:41 +00:00
|
|
|
common-lflags = -lm -lz
|
2007-10-26 21:02:39 +00:00
|
|
|
|
2013-10-27 14:36:32 +00:00
|
|
|
ifeq ($(use-clang),true)
|
2014-11-26 01:36:34 +00:00
|
|
|
ifeq ($(build-kernel),darwin)
|
|
|
|
common-lflags += -Wl,-export_dynamic
|
|
|
|
else
|
|
|
|
ifneq ($(platform),windows)
|
|
|
|
common-lflags += -Wl,-E
|
|
|
|
else
|
|
|
|
common-lflags += -Wl,--export-all-symbols
|
|
|
|
endif
|
|
|
|
endif
|
2013-10-27 14:36:32 +00:00
|
|
|
endif
|
|
|
|
|
2010-09-20 23:31:23 +00:00
|
|
|
build-lflags = -lz -lpthread -ldl
|
2008-11-11 15:20:49 +00:00
|
|
|
|
2013-03-04 21:24:41 +00:00
|
|
|
lflags = $(common-lflags) -lpthread -ldl
|
2007-10-26 14:34:54 +00:00
|
|
|
|
2010-11-07 04:21:19 +00:00
|
|
|
build-system = posix
|
|
|
|
|
2007-10-22 20:56:27 +00:00
|
|
|
system = posix
|
2007-10-23 01:00:57 +00:00
|
|
|
asm = x86
|
2007-10-26 21:02:39 +00:00
|
|
|
|
2017-01-19 16:55:54 +00:00
|
|
|
ifeq ($(system),sgx)
|
|
|
|
cflags += -DSGX
|
|
|
|
endif
|
|
|
|
|
2007-10-26 21:02:39 +00:00
|
|
|
pointer-size = 8
|
|
|
|
|
2008-03-31 03:43:43 +00:00
|
|
|
so-prefix = lib
|
|
|
|
so-suffix = .so
|
|
|
|
|
2013-01-28 15:20:52 +00:00
|
|
|
static-prefix = lib
|
|
|
|
static-suffix = .a
|
|
|
|
|
|
|
|
output = -o $(1)
|
|
|
|
asm-output = -o $(1)
|
|
|
|
asm-input = -c $(1)
|
|
|
|
asm-format = S
|
|
|
|
as = $(cc)
|
2013-02-15 00:21:57 +00:00
|
|
|
ld = $(cc)
|
2013-01-28 15:20:52 +00:00
|
|
|
build-ld = $(build-cc)
|
2014-06-21 04:16:33 +00:00
|
|
|
build-ld-cpp = $(build-cxx)
|
2013-01-28 15:20:52 +00:00
|
|
|
|
2013-02-16 00:43:21 +00:00
|
|
|
default-remote-test-host = localhost
|
|
|
|
default-remote-test-port = 22
|
|
|
|
ifeq ($(remote-test-host),)
|
|
|
|
remote-test-host = $(default-remote-test-host)
|
|
|
|
else
|
|
|
|
remote-test = true
|
|
|
|
endif
|
|
|
|
ifeq ($(remote-test-port),)
|
|
|
|
remote-test-port = $(default-remote-test-port)
|
|
|
|
else
|
|
|
|
remote-test = true
|
|
|
|
endif
|
2013-02-15 00:21:57 +00:00
|
|
|
remote-test-user = ${USER}
|
|
|
|
remote-test-dir = /tmp/avian-test-${USER}
|
|
|
|
|
2013-01-28 15:20:52 +00:00
|
|
|
static = -static
|
2008-03-31 03:43:43 +00:00
|
|
|
shared = -shared
|
|
|
|
|
2013-02-12 16:27:47 +00:00
|
|
|
rpath = -Wl,-rpath=\$$ORIGIN -Wl,-z,origin
|
2013-02-12 15:22:21 +00:00
|
|
|
|
2010-11-15 23:27:00 +00:00
|
|
|
openjdk-extra-cflags = -fvisibility=hidden
|
|
|
|
|
2011-09-01 03:18:00 +00:00
|
|
|
bootimage-cflags = -DTARGET_BYTES_PER_WORD=$(pointer-size)
|
2013-01-28 15:20:52 +00:00
|
|
|
bootimage-symbols = _binary_bootimage_bin_start:_binary_bootimage_bin_end
|
|
|
|
codeimage-symbols = _binary_codeimage_bin_start:_binary_codeimage_bin_end
|
2011-09-01 03:18:00 +00:00
|
|
|
|
2013-09-04 03:03:29 +00:00
|
|
|
developer-dir := $(shell if test -d /Developer/Platforms/$(target).platform/Developer/SDKs; then echo /Developer; \
|
2012-03-07 15:55:01 +00:00
|
|
|
else echo /Applications/Xcode.app/Contents/Developer; fi)
|
|
|
|
|
2014-11-26 01:36:34 +00:00
|
|
|
ifneq (,$(filter i386 arm,$(arch)))
|
2012-05-02 20:52:19 +00:00
|
|
|
pointer-size = 4
|
|
|
|
endif
|
|
|
|
|
2014-11-26 01:36:34 +00:00
|
|
|
ifneq (,$(filter arm arm64,$(arch)))
|
2010-11-09 03:48:08 +00:00
|
|
|
asm = arm
|
2012-05-01 19:16:32 +00:00
|
|
|
|
2014-06-22 18:30:52 +00:00
|
|
|
ifneq ($(platform),ios)
|
2014-11-26 01:36:34 +00:00
|
|
|
ifneq ($(arch),arm64)
|
|
|
|
no-psabi = -Wno-psabi
|
|
|
|
cflags += -marm $(no-psabi)
|
2014-06-22 18:30:52 +00:00
|
|
|
|
2014-11-26 01:36:34 +00:00
|
|
|
# By default, assume we can't use armv7-specific instructions on
|
|
|
|
# non-iOS platforms. Ideally, we'd detect this at runtime.
|
|
|
|
armv6=true
|
|
|
|
endif
|
2011-08-11 01:21:48 +00:00
|
|
|
endif
|
2010-11-09 18:28:58 +00:00
|
|
|
|
|
|
|
ifneq ($(arch),$(build-arch))
|
2014-06-22 18:30:52 +00:00
|
|
|
ifneq ($(kernel),darwin)
|
2014-11-26 01:36:34 +00:00
|
|
|
ifeq ($(arch),arm64)
|
|
|
|
cxx = aarch64-linux-gnu-g++
|
|
|
|
cc = aarch64-linux-gnu-gcc
|
|
|
|
ar = aarch64-linux-gnu-ar
|
|
|
|
ranlib = aarch64-linux-gnu-ranlib
|
|
|
|
strip = aarch64-linux-gnu-strip
|
|
|
|
else
|
|
|
|
cxx = arm-linux-gnueabi-g++
|
|
|
|
cc = arm-linux-gnueabi-gcc
|
|
|
|
ar = arm-linux-gnueabi-ar
|
|
|
|
ranlib = arm-linux-gnueabi-ranlib
|
|
|
|
strip = arm-linux-gnueabi-strip
|
|
|
|
endif
|
2011-08-11 01:21:48 +00:00
|
|
|
endif
|
2010-11-09 18:28:58 +00:00
|
|
|
endif
|
2009-08-06 19:25:20 +00:00
|
|
|
endif
|
2007-10-22 20:56:27 +00:00
|
|
|
|
2014-01-10 21:38:57 +00:00
|
|
|
ifeq ($(armv6),true)
|
|
|
|
cflags += -DAVIAN_ASSUME_ARMV6
|
|
|
|
endif
|
|
|
|
|
2014-06-22 18:30:52 +00:00
|
|
|
ifeq ($(platform),ios)
|
2011-09-22 22:55:45 +00:00
|
|
|
cflags += -DAVIAN_IOS
|
2013-12-18 21:53:46 +00:00
|
|
|
use-lto = false
|
2011-09-22 22:55:45 +00:00
|
|
|
endif
|
2011-08-30 01:07:42 +00:00
|
|
|
|
2014-06-22 18:30:52 +00:00
|
|
|
ifeq ($(build-kernel),darwin)
|
2011-08-23 23:04:04 +00:00
|
|
|
build-cflags = $(common-cflags) -fPIC -fvisibility=hidden -I$(src)
|
2013-11-05 00:26:57 +00:00
|
|
|
cflags += -Wno-deprecated-declarations
|
2011-08-23 23:04:04 +00:00
|
|
|
build-lflags += -framework CoreFoundation
|
2013-06-04 19:32:22 +00:00
|
|
|
endif
|
|
|
|
|
2012-07-18 00:21:17 +00:00
|
|
|
ifeq ($(platform),qnx)
|
|
|
|
cflags = $(common-cflags) -fPIC -fvisibility=hidden -I$(src)
|
|
|
|
lflags = $(common-lflags) -lsocket
|
|
|
|
ifeq ($(build-platform),qnx)
|
|
|
|
build-cflags = $(common-cflags) -fPIC -fvisibility=hidden -I$(src)
|
|
|
|
build-lflags = $(common-lflags)
|
|
|
|
else
|
2012-07-18 01:38:39 +00:00
|
|
|
ifeq ($(arch),i386)
|
|
|
|
prefix = i486-pc-nto-qnx6.5.0-
|
|
|
|
else
|
|
|
|
prefix = arm-unknown-nto-qnx6.5.0-
|
|
|
|
endif
|
2012-07-18 00:21:17 +00:00
|
|
|
endif
|
|
|
|
cxx = $(prefix)g++
|
|
|
|
cc = $(prefix)gcc
|
|
|
|
ar = $(prefix)ar
|
|
|
|
ranlib = $(prefix)ranlib
|
|
|
|
strip = $(prefix)strip
|
|
|
|
rdynamic = -Wl,--export-dynamic
|
|
|
|
endif
|
|
|
|
|
2012-08-02 16:36:16 +00:00
|
|
|
ifeq ($(platform),freebsd)
|
|
|
|
# There is no -ldl on FreeBSD
|
|
|
|
build-lflags = $(common-lflags) -lz -lpthread
|
|
|
|
lflags = $(common-lflags) -lpthread
|
|
|
|
# include/freebsd instead of include/linux
|
|
|
|
build-cflags = $(common-cflags) -fPIC -fvisibility=hidden \
|
|
|
|
"-I$(JAVA_HOME)/include/freebsd" -I$(src) -pthread
|
|
|
|
cflags = $(build-cflags)
|
|
|
|
endif
|
2013-01-23 23:55:23 +00:00
|
|
|
ifeq ($(platform),android)
|
2013-06-04 19:32:22 +00:00
|
|
|
ifeq ($(build-platform),cygwin)
|
2013-01-24 14:17:52 +00:00
|
|
|
ndk = "$$(cygpath -u "$(ANDROID_NDK)")"
|
|
|
|
else
|
|
|
|
ndk = $(ANDROID_NDK)
|
|
|
|
endif
|
|
|
|
|
2013-01-28 15:20:52 +00:00
|
|
|
ifeq ($(android-version),)
|
|
|
|
android-version = 5
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(android-toolchain),)
|
|
|
|
android-toolchain = 4.7
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(arch),arm)
|
|
|
|
android-toolchain-name = arm-linux-androideabi
|
|
|
|
android-toolchain-prefix = arm-linux-androideabi-
|
|
|
|
endif
|
|
|
|
ifeq ($(arch),i386)
|
|
|
|
android-toolchain-name = x86
|
|
|
|
android-toolchain-prefix = i686-linux-android-
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(android-arm-arch),)
|
|
|
|
android-arm-arch = armv5
|
|
|
|
endif
|
|
|
|
|
|
|
|
options := $(options)-api$(android-version)-$(android-toolchain)-$(android-arm-arch)
|
|
|
|
|
2013-01-24 14:17:52 +00:00
|
|
|
build-cflags = $(common-cflags) -I$(src)
|
2013-01-28 15:20:52 +00:00
|
|
|
build-lflags = -lz -lpthread
|
2016-04-27 01:06:25 +00:00
|
|
|
ifeq ($(subst cygwin,windows,$(subst mingw32,windows,$(build-platform))),windows)
|
|
|
|
toolchain-host-platform = $(subst cygwin,windows,$(subst mingw32,windows,$(build-platform)))
|
2013-01-24 14:17:52 +00:00
|
|
|
build-system = windows
|
|
|
|
build-cxx = i686-w64-mingw32-g++
|
|
|
|
build-cc = i686-w64-mingw32-gcc
|
2013-01-28 15:20:52 +00:00
|
|
|
sysroot = "$$(cygpath -w "$(ndk)/platforms/android-$(android-version)/arch-arm")"
|
2013-01-24 14:17:52 +00:00
|
|
|
build-cflags += "-I$(JAVA_HOME)/include/win32"
|
|
|
|
else
|
2016-04-27 01:06:25 +00:00
|
|
|
toolchain-host-platform = $(subst cygwin,windows,$(subst mingw32,windows,$(build-platform)))-*
|
2013-01-28 15:20:52 +00:00
|
|
|
sysroot = $(ndk)/platforms/android-$(android-version)/arch-arm
|
2013-01-24 14:17:52 +00:00
|
|
|
build-cflags += "-I$(JAVA_HOME)/include/linux"
|
2013-01-28 15:20:52 +00:00
|
|
|
build-lflags += -ldl
|
2013-01-24 14:17:52 +00:00
|
|
|
endif
|
2013-01-28 15:20:52 +00:00
|
|
|
toolchain = $(ndk)/toolchains/$(android-toolchain-name)-$(android-toolchain)/prebuilt/$(toolchain-host-platform)
|
|
|
|
cflags = "-I$(sysroot)/usr/include" "-I$(JAVA_HOME)/include/linux" $(common-cflags) "-I$(src)" -std=c++11 $(no-psabi)
|
|
|
|
lflags = "-L$(sysroot)/usr/lib" $(common-lflags) -llog
|
|
|
|
target-format = elf
|
2013-01-24 14:17:52 +00:00
|
|
|
use-lto = false
|
2013-02-06 17:04:55 +00:00
|
|
|
|
2013-01-28 15:20:52 +00:00
|
|
|
ifeq ($(arch),arm)
|
|
|
|
cflags += -marm -march=$(android-arm-arch) -ftree-vectorize -ffast-math -mfloat-abi=softfp
|
|
|
|
endif
|
|
|
|
ifeq ($(arch),i386)
|
|
|
|
endif
|
|
|
|
|
|
|
|
cxx = $(toolchain)/bin/$(android-toolchain-prefix)g++ --sysroot="$(sysroot)"
|
|
|
|
cc = $(toolchain)/bin/$(android-toolchain-prefix)gcc --sysroot="$(sysroot)"
|
|
|
|
as = $(cxx)
|
|
|
|
ar = $(toolchain)/bin/$(android-toolchain-prefix)ar
|
|
|
|
ranlib = $(toolchain)/bin/$(android-toolchain-prefix)ranlib
|
|
|
|
strip = $(toolchain)/bin/$(android-toolchain-prefix)strip
|
2013-01-23 23:55:23 +00:00
|
|
|
endif
|
2012-08-02 16:36:16 +00:00
|
|
|
|
2014-06-22 18:30:52 +00:00
|
|
|
ifeq ($(kernel),darwin)
|
2012-08-02 18:15:15 +00:00
|
|
|
target-format = macho
|
2011-06-02 21:15:08 +00:00
|
|
|
ifeq (${OSX_SDK_SYSROOT},)
|
2014-06-22 18:30:52 +00:00
|
|
|
OSX_SDK_SYSROOT = 10.6u
|
2011-06-02 21:15:08 +00:00
|
|
|
endif
|
|
|
|
ifeq (${OSX_SDK_VERSION},)
|
2014-06-22 18:30:52 +00:00
|
|
|
OSX_SDK_VERSION = 10.6
|
2011-06-02 21:15:08 +00:00
|
|
|
endif
|
2014-06-22 18:30:52 +00:00
|
|
|
ifneq ($(build-kernel),darwin)
|
2011-02-18 00:39:41 +00:00
|
|
|
cxx = i686-apple-darwin8-g++ $(mflag)
|
|
|
|
cc = i686-apple-darwin8-gcc $(mflag)
|
|
|
|
ar = i686-apple-darwin8-ar
|
|
|
|
ranlib = i686-apple-darwin8-ranlib
|
|
|
|
strip = i686-apple-darwin8-strip
|
2011-05-26 17:57:30 +00:00
|
|
|
sysroot = /opt/mac/SDKs/MacOSX${OSX_SDK_SYSROOT}.sdk
|
2011-02-22 22:45:46 +00:00
|
|
|
cflags = -I$(sysroot)/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Headers/ \
|
|
|
|
$(common-cflags) -fPIC -fvisibility=hidden -I$(src)
|
2011-02-18 00:39:41 +00:00
|
|
|
endif
|
|
|
|
|
2014-06-22 18:30:52 +00:00
|
|
|
ifneq ($(platform),ios)
|
2013-12-07 23:38:00 +00:00
|
|
|
platform-dir = $(developer-dir)/Platforms/MacOSX.platform
|
|
|
|
sdk-dir = $(platform-dir)/Developer/SDKs
|
|
|
|
|
|
|
|
mac-version := $(shell \
|
2016-02-15 22:39:31 +00:00
|
|
|
if test -d $(sdk-dir)/MacOSX10.11.sdk; then echo 10.11; \
|
2016-01-13 16:03:48 +00:00
|
|
|
elif test -d $(sdk-dir)/MacOSX10.10.sdk; then echo 10.10; \
|
|
|
|
elif test -d $(sdk-dir)/MacOSX10.9.sdk; then echo 10.9; \
|
2013-12-07 23:38:00 +00:00
|
|
|
elif test -d $(sdk-dir)/MacOSX10.8.sdk; then echo 10.8; \
|
|
|
|
elif test -d $(sdk-dir)/MacOSX10.7.sdk; then echo 10.7; \
|
|
|
|
elif test -d $(sdk-dir)/MacOSX10.6.sdk; then echo 10.6; \
|
|
|
|
else echo; fi)
|
|
|
|
|
|
|
|
sysroot = $(sdk-dir)/MacOSX$(mac-version).sdk
|
|
|
|
endif
|
|
|
|
|
2014-04-12 01:32:16 +00:00
|
|
|
soname-flag =
|
2010-11-08 04:23:25 +00:00
|
|
|
version-script-flag =
|
2014-06-05 13:29:44 +00:00
|
|
|
lflags = $(common-lflags) -ldl -framework CoreFoundation -framework Foundation
|
2012-06-04 15:52:06 +00:00
|
|
|
|
2012-06-06 18:58:24 +00:00
|
|
|
ifeq (,$(shell ld -v 2>&1 | grep cctools))
|
2012-06-04 15:52:06 +00:00
|
|
|
lflags += -Wl,-compatibility_version,1.0.0
|
|
|
|
endif
|
|
|
|
|
2014-06-22 18:30:52 +00:00
|
|
|
ifneq ($(platform),ios)
|
2012-03-11 22:26:46 +00:00
|
|
|
lflags += -framework CoreServices -framework SystemConfiguration \
|
|
|
|
-framework Security
|
2011-08-11 01:21:48 +00:00
|
|
|
endif
|
2008-12-19 02:52:03 +00:00
|
|
|
ifeq ($(bootimage),true)
|
2009-10-14 01:14:03 +00:00
|
|
|
bootimage-lflags = -Wl,-segprot,__RWX,rwx,rwx
|
2008-12-19 02:52:03 +00:00
|
|
|
endif
|
2008-03-31 04:23:51 +00:00
|
|
|
rdynamic =
|
2007-11-01 20:37:51 +00:00
|
|
|
strip-all = -S -x
|
2010-11-16 03:28:53 +00:00
|
|
|
so-suffix = .dylib
|
2008-03-31 03:43:43 +00:00
|
|
|
shared = -dynamiclib
|
2013-02-12 15:22:21 +00:00
|
|
|
rpath =
|
2009-11-03 23:07:13 +00:00
|
|
|
|
2014-06-22 18:30:52 +00:00
|
|
|
ifeq ($(platform),ios)
|
2015-11-01 19:36:47 +00:00
|
|
|
ifeq ($(sim),true)
|
2013-07-31 22:20:32 +00:00
|
|
|
target = iPhoneSimulator
|
|
|
|
sdk = iphonesimulator$(ios-version)
|
2015-03-16 17:32:35 +00:00
|
|
|
ifeq ($(arch),i386)
|
|
|
|
arch-flag = -arch i386
|
|
|
|
else
|
|
|
|
arch-flag = -arch x86_64
|
2015-11-01 19:36:47 +00:00
|
|
|
arch = x86_64
|
2015-03-16 17:32:35 +00:00
|
|
|
endif
|
2013-07-31 22:20:32 +00:00
|
|
|
release = Release-iphonesimulator
|
|
|
|
else
|
|
|
|
target = iPhoneOS
|
|
|
|
sdk = iphoneos$(ios-version)
|
2014-11-26 01:36:34 +00:00
|
|
|
ifeq ($(arch),arm)
|
|
|
|
arch-flag = -arch armv7
|
|
|
|
else
|
|
|
|
arch-flag = -arch arm64
|
2015-11-01 19:36:47 +00:00
|
|
|
arch = arm64
|
2014-11-26 01:36:34 +00:00
|
|
|
endif
|
2013-07-31 22:20:32 +00:00
|
|
|
release = Release-iphoneos
|
|
|
|
endif
|
|
|
|
|
|
|
|
platform-dir = $(developer-dir)/Platforms/$(target).platform
|
|
|
|
sdk-dir = $(platform-dir)/Developer/SDKs
|
2012-03-26 17:12:07 +00:00
|
|
|
|
2017-08-30 10:03:22 +00:00
|
|
|
ios-version := $(shell for x in 10.3 10.2 10.1 10.0 9.3 9.2 9.1 9.0 8.3 8.2 8.1 8.0; \
|
2016-04-05 13:51:31 +00:00
|
|
|
do if test -d $(sdk-dir)/$(target)$$x.sdk \
|
|
|
|
-o -L $(sdk-dir)/$(target)$$x.sdk; \
|
|
|
|
then echo $$x; break; fi; done)
|
2012-04-07 23:15:59 +00:00
|
|
|
|
|
|
|
ifeq ($(ios-version),)
|
2016-04-04 17:55:03 +00:00
|
|
|
x := $(error "couldn't find SDK in $(sdk-dir)")
|
2012-04-07 23:15:59 +00:00
|
|
|
endif
|
|
|
|
|
2016-04-04 17:55:03 +00:00
|
|
|
sysroot = $(sdk-dir)/$(target)$(ios-version).sdk
|
|
|
|
|
2016-08-12 16:05:37 +00:00
|
|
|
# apparently, the header files we need are part of the simulator SDK
|
|
|
|
# but not the device SDK, so we copy them from the former even if
|
|
|
|
# we're targeting the latter
|
|
|
|
|
|
|
|
header-sysroot := $(subst iPhoneOS,iPhoneSimulator,$(sysroot))
|
|
|
|
|
2013-07-31 22:20:32 +00:00
|
|
|
ios-bin = $(platform-dir)/Developer/usr/bin
|
|
|
|
|
2013-12-18 18:10:04 +00:00
|
|
|
found-gcc = $(shell if test -f $(ios-bin)/gcc; then echo true; else echo false; fi)
|
|
|
|
|
|
|
|
ifeq ($(found-gcc),false)
|
|
|
|
use-clang = true
|
|
|
|
endif
|
|
|
|
|
2013-07-31 22:20:32 +00:00
|
|
|
ifeq ($(use-clang),true)
|
|
|
|
cxx = clang -std=c++11
|
|
|
|
cc = clang
|
|
|
|
else
|
|
|
|
cxx = $(ios-bin)/g++
|
|
|
|
cc = $(ios-bin)/gcc
|
|
|
|
endif
|
|
|
|
|
|
|
|
flags = -isysroot $(sdk-dir)/$(target)$(ios-version).sdk \
|
|
|
|
$(arch-flag)
|
|
|
|
|
2013-03-04 21:24:41 +00:00
|
|
|
classpath-extra-cflags += $(flags)
|
2011-08-11 01:21:48 +00:00
|
|
|
cflags += $(flags)
|
|
|
|
asmflags += $(flags)
|
|
|
|
lflags += $(flags)
|
2016-01-13 00:37:03 +00:00
|
|
|
|
2015-11-01 19:36:47 +00:00
|
|
|
ios-version-min=$(ios-version)
|
|
|
|
ifdef ios_deployment_target
|
|
|
|
ios-version-min=ios_deployment_target
|
2014-06-22 18:30:52 +00:00
|
|
|
endif
|
2016-01-13 00:37:03 +00:00
|
|
|
|
2015-11-01 19:36:47 +00:00
|
|
|
ifeq ($(sim),true)
|
|
|
|
ifeq ($(arch),x86_64)
|
|
|
|
classpath-extra-cflags += \
|
|
|
|
-arch x86_64 -miphoneos-version-min=$(ios-version-min)
|
|
|
|
cflags += -arch x86_64 -miphoneos-version-min=$(ios-version-min)
|
|
|
|
asmflags += -arch x86_64 -miphoneos-version-min=$(ios-version-min)
|
|
|
|
lflags += -arch x86_64 -miphoneos-version-min=$(ios-version-min)
|
|
|
|
else
|
|
|
|
classpath-extra-cflags += \
|
|
|
|
-arch i386 -miphoneos-version-min=$(ios-version-min)
|
|
|
|
cflags += -arch i386 -miphoneos-version-min=$(ios-version-min)
|
|
|
|
asmflags += -arch i386 -miphoneos-version-min=$(ios-version-min)
|
|
|
|
lflags += -arch i386 -miphoneos-version-min=$(ios-version-min)
|
|
|
|
endif
|
2015-03-16 17:32:35 +00:00
|
|
|
else
|
2015-11-01 19:36:47 +00:00
|
|
|
ifeq ($(arch),arm64)
|
|
|
|
classpath-extra-cflags += \
|
|
|
|
-arch arm64 -miphoneos-version-min=$(ios-version-min)
|
|
|
|
cflags += -arch arm64 -miphoneos-version-min=$(ios-version-min)
|
|
|
|
asmflags += -arch arm64 -miphoneos-version-min=$(ios-version-min)
|
|
|
|
lflags += -arch arm64 -miphoneos-version-min=$(ios-version-min)
|
|
|
|
else
|
|
|
|
classpath-extra-cflags += \
|
|
|
|
-arch armv7 -miphoneos-version-min=$(ios-version-min)
|
|
|
|
cflags += -arch armv7 -miphoneos-version-min=$(ios-version-min)
|
|
|
|
asmflags += -arch armv7 -miphoneos-version-min=$(ios-version-min)
|
|
|
|
lflags += -arch armv7 -miphoneos-version-min=$(ios-version-min)
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
else # not ios
|
|
|
|
ifeq ($(arch),i386)
|
|
|
|
classpath-extra-cflags += \
|
|
|
|
-arch i386 -mmacosx-version-min=${OSX_SDK_VERSION}
|
|
|
|
cflags += -arch i386 -mmacosx-version-min=${OSX_SDK_VERSION}
|
|
|
|
asmflags += -arch i386 -mmacosx-version-min=${OSX_SDK_VERSION}
|
|
|
|
lflags += -arch i386 -mmacosx-version-min=${OSX_SDK_VERSION}
|
|
|
|
endif
|
2016-01-13 00:37:03 +00:00
|
|
|
|
2015-11-01 19:36:47 +00:00
|
|
|
ifeq ($(arch),x86_64)
|
|
|
|
classpath-extra-cflags += -arch x86_64
|
|
|
|
cflags += -arch x86_64
|
|
|
|
asmflags += -arch x86_64
|
|
|
|
lflags += -arch x86_64
|
2015-03-16 17:32:35 +00:00
|
|
|
endif
|
2009-12-01 21:24:33 +00:00
|
|
|
endif
|
2013-11-05 00:26:57 +00:00
|
|
|
cflags += -I$(JAVA_HOME)/include/darwin
|
2007-10-22 20:56:27 +00:00
|
|
|
endif
|
2007-10-26 21:02:39 +00:00
|
|
|
|
2013-03-04 21:24:41 +00:00
|
|
|
openjdk-extra-cflags += $(classpath-extra-cflags)
|
|
|
|
|
2014-04-01 21:47:23 +00:00
|
|
|
find-tool = $(shell if ( command -v "$(1)$(2)" >/dev/null ); then (echo "$(1)$(2)") else (echo "$(2)"); fi)
|
|
|
|
|
2007-10-22 20:56:27 +00:00
|
|
|
ifeq ($(platform),windows)
|
2013-03-15 23:47:15 +00:00
|
|
|
target-format = pe
|
2012-08-02 18:15:15 +00:00
|
|
|
|
2012-02-20 23:25:37 +00:00
|
|
|
inc = "$(win32)/include"
|
|
|
|
lib = "$(win32)/lib"
|
2007-10-22 20:56:27 +00:00
|
|
|
|
2010-11-07 04:21:19 +00:00
|
|
|
embed-prefix = c:/avian-embedded
|
2007-10-22 20:56:27 +00:00
|
|
|
system = windows
|
2007-10-23 20:05:59 +00:00
|
|
|
|
2008-03-31 03:43:43 +00:00
|
|
|
so-prefix =
|
|
|
|
so-suffix = .dll
|
2008-11-11 15:20:49 +00:00
|
|
|
exe-suffix = .exe
|
2013-02-12 15:22:21 +00:00
|
|
|
rpath =
|
2008-03-31 03:43:43 +00:00
|
|
|
|
2016-01-13 00:37:03 +00:00
|
|
|
lflags = -L$(lib) $(common-lflags) -lws2_32 -lversion -luuid -liphlpapi \
|
|
|
|
-lmswsock -mconsole
|
|
|
|
|
2014-10-27 15:39:53 +00:00
|
|
|
cflags = -I$(inc) $(common-cflags) -DWINVER=0x0500 -U__STRICT_ANSI__
|
2011-09-30 21:21:12 +00:00
|
|
|
|
2016-04-27 01:06:25 +00:00
|
|
|
ifeq (,$(filter mingw32 cygwin,$(build-platform)))
|
2010-11-15 23:27:00 +00:00
|
|
|
openjdk-extra-cflags += -I$(src)/openjdk/caseSensitive
|
2012-07-06 17:21:53 +00:00
|
|
|
prefix := $(shell i686-w64-mingw32-gcc --version >/dev/null 2>&1 \
|
|
|
|
&& echo i686-w64-mingw32- || echo x86_64-w64-mingw32-)
|
|
|
|
cxx = $(prefix)g++ -m32
|
|
|
|
cc = $(prefix)gcc -m32
|
2014-11-26 01:36:34 +00:00
|
|
|
dlltool = $(prefix)dlltool -mi386 --as-flags=--32
|
2012-07-06 17:21:53 +00:00
|
|
|
ar = $(prefix)ar
|
|
|
|
ranlib = $(prefix)ranlib
|
|
|
|
strip = $(prefix)strip --strip-all
|
2008-11-11 15:20:49 +00:00
|
|
|
else
|
2010-11-12 23:53:16 +00:00
|
|
|
build-system = windows
|
2014-07-17 18:22:24 +00:00
|
|
|
static-on-windows = -static
|
2009-02-14 00:03:46 +00:00
|
|
|
common-cflags += "-I$(JAVA_HOME)/include/win32"
|
2014-10-27 15:39:53 +00:00
|
|
|
build-cflags = $(common-cflags) -I$(src) -I$(inc) -mthreads \
|
|
|
|
-D_WIN32_WINNT=0x0500
|
2010-11-15 23:27:00 +00:00
|
|
|
openjdk-extra-cflags =
|
2010-11-13 02:04:17 +00:00
|
|
|
build-lflags = -L$(lib) $(common-lflags)
|
2008-11-11 15:20:49 +00:00
|
|
|
ifeq ($(build-platform),cygwin)
|
2011-07-12 22:58:51 +00:00
|
|
|
build-cxx = i686-w64-mingw32-g++
|
|
|
|
build-cc = i686-w64-mingw32-gcc
|
|
|
|
dlltool = i686-w64-mingw32-dlltool
|
|
|
|
ar = i686-w64-mingw32-ar
|
|
|
|
ranlib = i686-w64-mingw32-ranlib
|
|
|
|
strip = i686-w64-mingw32-strip
|
2008-11-11 15:20:49 +00:00
|
|
|
endif
|
|
|
|
endif
|
2009-06-11 15:36:53 +00:00
|
|
|
|
|
|
|
ifeq ($(arch),x86_64)
|
2011-07-12 22:58:51 +00:00
|
|
|
ifeq ($(build-platform),cygwin)
|
|
|
|
build-cxx = x86_64-w64-mingw32-g++
|
|
|
|
build-cc = x86_64-w64-mingw32-gcc
|
|
|
|
endif
|
2010-05-13 23:01:55 +00:00
|
|
|
cxx = x86_64-w64-mingw32-g++ $(mflag)
|
|
|
|
cc = x86_64-w64-mingw32-gcc $(mflag)
|
2014-04-01 21:47:23 +00:00
|
|
|
dlltool = $(call find-tool,x86_64-w64-mingw32-,dlltool)
|
|
|
|
ar = $(call find-tool,x86_64-w64-mingw32-,ar)
|
|
|
|
ranlib = $(call find-tool,x86_64-w64-mingw32-,ranlib)
|
|
|
|
strip = $(call find-tool,x86_64-w64-mingw32-,strip)
|
2012-02-20 23:25:37 +00:00
|
|
|
inc = "$(win64)/include"
|
|
|
|
lib = "$(win64)/lib"
|
2012-03-18 00:47:22 +00:00
|
|
|
else
|
|
|
|
shared += -Wl,--add-stdcall-alias
|
2009-06-11 15:36:53 +00:00
|
|
|
endif
|
2012-12-05 00:37:02 +00:00
|
|
|
|
2013-01-30 08:42:05 +00:00
|
|
|
embed = $(build-embed)/embed$(exe-suffix)
|
|
|
|
embed-loader = $(build-embed-loader)/embed-loader$(exe-suffix)
|
2012-11-13 08:11:49 +00:00
|
|
|
embed-loader-o = $(build-embed)/embed-loader.o
|
2007-10-22 20:56:27 +00:00
|
|
|
endif
|
2007-08-18 22:42:11 +00:00
|
|
|
|
2013-01-28 15:20:52 +00:00
|
|
|
ifeq ($(platform),wp8)
|
|
|
|
ifeq ($(shell uname -s | grep -i -c WOW64),1)
|
|
|
|
programFiles = Program Files (x86)
|
2012-06-03 00:56:07 +00:00
|
|
|
else
|
2013-01-28 15:20:52 +00:00
|
|
|
programFiles = Program Files
|
2012-06-03 00:56:07 +00:00
|
|
|
endif
|
2013-01-28 15:20:52 +00:00
|
|
|
ifeq ($(MSVS_ROOT),)
|
|
|
|
# Environment variable MSVS_ROOT not found. It should be something like
|
|
|
|
# "C:\$(programFiles)\Microsoft Visual Studio 11.0"
|
|
|
|
MSVS_ROOT = C:\$(programFiles)\Microsoft Visual Studio 11.0
|
|
|
|
endif
|
|
|
|
ifeq ($(MSVC_ROOT),)
|
|
|
|
# Environment variable MSVC_ROOT not found. It should be something like
|
|
|
|
# "C:\$(programFiles)\Microsoft Visual Studio 11.0\VC"
|
|
|
|
MSVC_ROOT = $(MSVS_ROOT)\VC
|
|
|
|
endif
|
|
|
|
ifeq ($(WP80_SDK),)
|
|
|
|
# Environment variable WP8_SDK not found. It should be something like
|
|
|
|
# "C:\Program Files[ (x86)]\Microsoft Visual Studio 11.0\VC\WPSDK\WP80"
|
|
|
|
# TODO: Lookup in SOFTWARE\Microsoft\Microsoft SDKs\WindowsPhone\v8.0
|
2013-01-29 12:21:02 +00:00
|
|
|
WP80_SDK = $(MSVS_ROOT)\VC\WPSDK\WP80
|
2013-01-28 15:20:52 +00:00
|
|
|
endif
|
|
|
|
ifeq ($(WP80_KIT),)
|
|
|
|
# Environment variable WP8_KIT not found. It should be something like
|
|
|
|
# "c:\Program Files[ (x86)]\Windows Phone Kits\8.0"
|
|
|
|
# TODO: Lookup in SOFTWARE\Microsoft\Microsoft SDKs\WindowsPhone\v8.0
|
|
|
|
WP80_KIT = C:\$(programFiles)\Windows Phone Kits\8.0
|
|
|
|
endif
|
|
|
|
ifeq ($(WIN8_KIT),)
|
|
|
|
# Environment variable WIN8_KIT not found. It should be something like
|
|
|
|
# "c:\Program Files[ (x86)]\Windows Kits\8.0"
|
|
|
|
WIN8_KIT = C:\$(programFiles)\Windows Kits\8.0
|
|
|
|
endif
|
|
|
|
ifeq ($(build-platform),cygwin)
|
|
|
|
windows-path = cygpath -w
|
2012-06-01 23:43:42 +00:00
|
|
|
else
|
2013-01-28 15:20:52 +00:00
|
|
|
windows-path = $(native-path)
|
2012-06-01 23:43:42 +00:00
|
|
|
endif
|
2013-01-28 15:20:52 +00:00
|
|
|
windows-java-home := $(shell $(windows-path) "$(JAVA_HOME)")
|
|
|
|
target-format = pe
|
|
|
|
ms_cl_compiler = wp8
|
|
|
|
use-lto = false
|
|
|
|
supports_avian_executable = false
|
2013-01-30 05:31:02 +00:00
|
|
|
aot-only = true
|
2013-02-09 11:09:58 +00:00
|
|
|
ifneq ($(bootimage),true)
|
2013-02-09 11:18:39 +00:00
|
|
|
x := $(error Windows Phone 8 target requires bootimage=true)
|
2013-01-28 15:20:52 +00:00
|
|
|
endif
|
|
|
|
system = windows
|
|
|
|
build-system = windows
|
|
|
|
static-prefix =
|
|
|
|
static-suffix = .lib
|
|
|
|
so-prefix =
|
|
|
|
so-suffix = .dll
|
|
|
|
exe-suffix = .exe
|
2013-01-30 08:42:05 +00:00
|
|
|
manifest-flags = -MANIFEST:NO
|
2011-03-26 20:44:08 +00:00
|
|
|
|
2013-01-28 15:20:52 +00:00
|
|
|
ifeq ($(arch),arm)
|
|
|
|
wp8_arch = \x86_arm
|
|
|
|
vc_arch = \arm
|
|
|
|
w8kit_arch = arm
|
|
|
|
deps_arch = ARM
|
|
|
|
as = "$$(cygpath -u "$(WP80_SDK)\bin\x86_arm\armasm.exe")"
|
|
|
|
cxx = "$$(cygpath -u "$(WP80_SDK)\bin\x86_arm\cl.exe")"
|
|
|
|
ld = "$$(cygpath -u "$(WP80_SDK)\bin\x86_arm\link.exe")"
|
2013-01-31 10:54:51 +00:00
|
|
|
asmflags = -machine ARM -32
|
2013-01-28 15:20:52 +00:00
|
|
|
asm-output = -o $(1)
|
|
|
|
asm-input = $(1)
|
|
|
|
machine_type = ARM
|
2013-01-31 10:54:51 +00:00
|
|
|
bootimage-symbols = binary_bootimage_bin_start:binary_bootimage_bin_end
|
|
|
|
codeimage-symbols = binary_codeimage_bin_start:binary_codeimage_bin_end
|
2013-01-28 15:20:52 +00:00
|
|
|
endif
|
|
|
|
ifeq ($(arch),i386)
|
|
|
|
wp8_arch =
|
|
|
|
vc_arch =
|
|
|
|
w8kit_arch = x86
|
|
|
|
deps_arch = x86
|
2013-01-30 05:31:02 +00:00
|
|
|
asmflags = $(target-cflags) -safeseh -nologo -Gd
|
2013-01-28 15:20:52 +00:00
|
|
|
as = "$$(cygpath -u "$(WP80_SDK)\bin\ml.exe")"
|
|
|
|
cxx = "$$(cygpath -u "$(WP80_SDK)\bin\cl.exe")"
|
|
|
|
ld = "$$(cygpath -u "$(WP80_SDK)\bin\link.exe")"
|
2013-01-30 05:31:02 +00:00
|
|
|
ifeq ($(mode),debug)
|
|
|
|
asmflags += -Zd
|
2012-06-01 23:43:42 +00:00
|
|
|
endif
|
2013-01-30 05:31:02 +00:00
|
|
|
ifeq ($(mode),debug-fast)
|
|
|
|
asmflags += -Zd
|
2012-06-01 23:43:42 +00:00
|
|
|
endif
|
2013-01-28 15:20:52 +00:00
|
|
|
asm-output = $(output)
|
|
|
|
machine_type = X86
|
2011-03-26 20:44:08 +00:00
|
|
|
endif
|
2007-06-03 23:16:07 +00:00
|
|
|
|
2013-01-28 15:20:52 +00:00
|
|
|
PATH := $(shell cygpath -u "$(MSVS_ROOT)\Common7\IDE"):$(shell cygpath -u "$(WP80_SDK)\bin$(wp8_arch)"):$(shell cygpath -u "$(WP80_SDK)\bin"):${PATH}
|
2010-11-04 17:02:09 +00:00
|
|
|
|
2013-01-28 15:20:52 +00:00
|
|
|
build-cflags = $(common-cflags) -I$(src) -I$(inc) -mthreads
|
|
|
|
build-lflags = -lz -lpthread
|
2009-11-20 01:51:43 +00:00
|
|
|
|
2013-01-28 15:20:52 +00:00
|
|
|
cflags = -nologo \
|
2013-01-30 08:42:05 +00:00
|
|
|
-AI"$(WP80_KIT)\Windows Metadata" \
|
2013-01-28 15:20:52 +00:00
|
|
|
-I"$(WP80_SDK)\include" -I"$(WP80_KIT)\Include" -I"$(WP80_KIT)\Include\minwin" -I"$(WP80_KIT)\Include\mincore" \
|
2013-01-30 08:42:05 +00:00
|
|
|
-DWINAPI_FAMILY=WINAPI_FAMILY_PHONE_APP -D_USRDLL -D_WINDLL \
|
2013-01-28 15:20:52 +00:00
|
|
|
-DAVIAN_VERSION=\"$(version)\" -D_JNI_IMPLEMENTATION_ \
|
|
|
|
-DUSE_ATOMIC_OPERATIONS -DAVIAN_JAVA_HOME=\"$(javahome)\" \
|
|
|
|
-DAVIAN_EMBED_PREFIX=\"$(embed-prefix)\" \
|
2013-02-02 07:38:03 +00:00
|
|
|
-I"$(shell $(windows-path) "$(wp8)/zlib/upstream")" -I"$(shell $(windows-path) "$(wp8)/interop/avian-interop-client")" \
|
|
|
|
-I"$(shell $(windows-path) "$(wp8)/include")" -I$(src) -I$(classpath-src) \
|
2013-01-28 15:20:52 +00:00
|
|
|
-I"$(build)" \
|
|
|
|
-I"$(windows-java-home)/include" -I"$(windows-java-home)/include/win32" \
|
2013-01-30 05:31:02 +00:00
|
|
|
-DTARGET_BYTES_PER_WORD=$(pointer-size) \
|
2013-02-02 07:38:03 +00:00
|
|
|
-Gd -EHsc
|
2009-08-27 00:26:44 +00:00
|
|
|
|
2013-03-04 21:24:41 +00:00
|
|
|
common-lflags =
|
2013-01-28 15:20:52 +00:00
|
|
|
|
2013-01-29 10:44:55 +00:00
|
|
|
ifeq ($(mode),debug)
|
|
|
|
build-type = Debug
|
|
|
|
endif
|
|
|
|
ifeq ($(mode),debug-fast)
|
|
|
|
build-type = Debug
|
|
|
|
endif
|
2014-07-01 14:05:12 +00:00
|
|
|
ifeq ($(mode),stress-major)
|
2013-01-29 10:44:55 +00:00
|
|
|
build-type = Release
|
|
|
|
endif
|
|
|
|
ifeq ($(mode),fast)
|
|
|
|
build-type = Release
|
|
|
|
endif
|
|
|
|
ifeq ($(mode),fast)
|
|
|
|
build-type = Release
|
|
|
|
endif
|
|
|
|
ifeq ($(mode),small)
|
|
|
|
build-type = Release
|
|
|
|
endif
|
|
|
|
|
2013-01-28 15:20:52 +00:00
|
|
|
arflags = -MACHINE:$(machine_type)
|
|
|
|
lflags = $(common-lflags) -nologo \
|
|
|
|
-MACHINE:$(machine_type) \
|
2013-01-30 09:31:06 +00:00
|
|
|
-LIBPATH:"$(WP80_KIT)\lib\$(w8kit_arch)" -LIBPATH:"$(WP80_SDK)\lib$(vc_arch)" -LIBPATH:"$(WIN8_KIT)\Lib\win8\um\$(w8kit_arch)" \
|
2013-01-28 15:20:52 +00:00
|
|
|
ws2_32.lib \
|
2013-02-02 07:38:03 +00:00
|
|
|
"$(shell $(windows-path) "$(wp8)\lib\$(deps_arch)\$(build-type)\zlib.lib")" "$(shell $(windows-path) "$(wp8)\lib\$(deps_arch)\$(build-type)\ThreadEmulation.lib")" \
|
|
|
|
"$(shell $(windows-path) "$(wp8)\lib\$(deps_arch)\$(build-type)\AvianInteropClient.lib")"
|
2013-01-30 08:42:05 +00:00
|
|
|
lflags += -NXCOMPAT -DYNAMICBASE -SUBSYSTEM:CONSOLE -TLBID:1
|
2013-01-30 09:31:06 +00:00
|
|
|
lflags += -NODEFAULTLIB:"ole32.lib" -NODEFAULTLIB:"kernel32.lib"
|
|
|
|
lflags += PhoneAppModelHost.lib WindowsPhoneCore.lib -WINMD -WINMDFILE:$(subst $(so-suffix),.winmd,$(@))
|
2013-01-28 15:20:52 +00:00
|
|
|
|
|
|
|
cc = $(cxx)
|
|
|
|
asm-format = masm
|
|
|
|
shared = -dll
|
|
|
|
ar = "$$(cygpath -u "$(WP80_SDK)\bin\lib.exe")"
|
|
|
|
arflags += -nologo
|
|
|
|
ifeq ($(build-platform),cygwin)
|
|
|
|
build-cxx = i686-w64-mingw32-g++
|
|
|
|
build-cc = i686-w64-mingw32-gcc
|
|
|
|
dlltool = i686-w64-mingw32-dlltool
|
|
|
|
ranlib =
|
|
|
|
strip =
|
|
|
|
endif
|
|
|
|
output = -Fo$(1)
|
|
|
|
|
2013-01-30 08:42:05 +00:00
|
|
|
#TODO: -MT or -ZW?
|
2013-01-28 15:20:52 +00:00
|
|
|
cflags_debug = -Od -Zi -MDd
|
|
|
|
cflags_debug_fast = -Od -Zi -MDd
|
|
|
|
cflags_stress = -O0 -g3 -MD
|
|
|
|
cflags_stress_major = -O0 -g3 -MD
|
|
|
|
cflags_fast = -O2 -Zi -MD
|
|
|
|
cflags_small = -O1s -Zi -MD
|
|
|
|
# -GL [whole program optimization] in 'fast' and 'small' breaks compilation for some reason
|
|
|
|
|
|
|
|
ifeq ($(mode),debug)
|
|
|
|
cflags +=
|
|
|
|
lflags +=
|
|
|
|
endif
|
|
|
|
ifeq ($(mode),debug-fast)
|
|
|
|
cflags += -DNDEBUG
|
|
|
|
lflags +=
|
|
|
|
endif
|
2014-07-01 14:05:12 +00:00
|
|
|
ifeq ($(mode),stress-major)
|
2013-01-28 15:20:52 +00:00
|
|
|
cflags +=
|
|
|
|
lflags +=
|
|
|
|
endif
|
|
|
|
ifeq ($(mode),fast)
|
|
|
|
cflags +=
|
|
|
|
lflags +=
|
|
|
|
endif
|
|
|
|
# -LTCG is needed only if -GL is used
|
|
|
|
ifeq ($(mode),fast)
|
|
|
|
cflags += -DNDEBUG
|
|
|
|
lflags += -LTCG
|
|
|
|
arflags +=
|
|
|
|
endif
|
|
|
|
ifeq ($(mode),small)
|
|
|
|
cflags += -DNDEBUG
|
|
|
|
lflags += -LTCG
|
|
|
|
arflags +=
|
|
|
|
endif
|
|
|
|
|
|
|
|
strip = :
|
|
|
|
endif
|
2012-12-05 22:30:49 +00:00
|
|
|
|
2009-08-27 00:26:44 +00:00
|
|
|
ifdef msvc
|
2013-03-04 18:09:59 +00:00
|
|
|
target-format = pe
|
2012-06-02 21:43:42 +00:00
|
|
|
windows-path = $(native-path)
|
|
|
|
windows-java-home := $(shell $(windows-path) "$(JAVA_HOME)")
|
|
|
|
zlib := $(shell $(windows-path) "$(win32)/msvc")
|
2013-01-30 05:31:02 +00:00
|
|
|
ms_cl_compiler = regular
|
2013-03-04 18:09:59 +00:00
|
|
|
as = $(build-cc)
|
2009-08-27 00:26:44 +00:00
|
|
|
cxx = "$(msvc)/BIN/cl.exe"
|
|
|
|
cc = $(cxx)
|
|
|
|
ld = "$(msvc)/BIN/link.exe"
|
2009-09-01 14:42:33 +00:00
|
|
|
mt = "mt.exe"
|
2013-03-04 18:09:59 +00:00
|
|
|
ar = "$(msvc)/BIN/lib.exe"
|
2013-01-30 05:31:02 +00:00
|
|
|
manifest-flags = -MANIFEST -MANIFESTFILE:$(@).manifest
|
2009-08-27 00:26:44 +00:00
|
|
|
cflags = -nologo -DAVIAN_VERSION=\"$(version)\" -D_JNI_IMPLEMENTATION_ \
|
2011-01-21 23:14:21 +00:00
|
|
|
-DUSE_ATOMIC_OPERATIONS -DAVIAN_JAVA_HOME=\"$(javahome)\" \
|
|
|
|
-DAVIAN_EMBED_PREFIX=\"$(embed-prefix)\" \
|
2012-08-15 23:42:31 +00:00
|
|
|
-Fd$(build)/$(name).pdb -I"$(zlib)/include" -I$(src) -I$(classpath-src) \
|
2013-03-04 18:09:59 +00:00
|
|
|
-I"$(build)" -Iinclude \
|
2012-02-17 01:22:11 +00:00
|
|
|
-I"$(windows-java-home)/include" -I"$(windows-java-home)/include/win32" \
|
2012-05-03 14:45:17 +00:00
|
|
|
-DTARGET_BYTES_PER_WORD=$(pointer-size)
|
2012-06-02 21:43:42 +00:00
|
|
|
|
2013-01-30 05:31:02 +00:00
|
|
|
ifneq ($(lzma),)
|
2012-06-02 21:43:42 +00:00
|
|
|
cflags += -I$(shell $(windows-path) "$(lzma)")
|
|
|
|
endif
|
|
|
|
|
2009-08-27 00:26:44 +00:00
|
|
|
shared = -dll
|
|
|
|
lflags = -nologo -LIBPATH:"$(zlib)/lib" -DEFAULTLIB:ws2_32 \
|
2012-12-05 22:30:49 +00:00
|
|
|
-DEFAULTLIB:zlib -DEFAULTLIB:user32 -MANIFEST -debug
|
2009-08-27 15:30:34 +00:00
|
|
|
output = -Fo$(1)
|
2009-08-27 00:26:44 +00:00
|
|
|
|
2013-03-04 18:09:59 +00:00
|
|
|
cflags_debug = -Od -Zi -MDd
|
|
|
|
cflags_debug_fast = -Od -Zi -DNDEBUG
|
|
|
|
cflags_fast = -O2 -GL -Zi -DNDEBUG
|
|
|
|
cflags_small = -O1s -Zi -GL -DNDEBUG
|
2009-08-27 00:26:44 +00:00
|
|
|
ifeq ($(mode),fast)
|
|
|
|
lflags += -LTCG
|
|
|
|
endif
|
|
|
|
ifeq ($(mode),small)
|
|
|
|
lflags += -LTCG
|
|
|
|
endif
|
|
|
|
|
2013-03-04 18:09:59 +00:00
|
|
|
use-lto = false
|
2009-08-27 00:26:44 +00:00
|
|
|
strip = :
|
|
|
|
endif
|
|
|
|
|
2007-07-16 01:03:02 +00:00
|
|
|
ifeq ($(mode),debug)
|
2013-01-28 15:20:52 +00:00
|
|
|
optimization-cflags = $(cflags_debug)
|
|
|
|
converter-cflags += $(cflags_debug)
|
2009-08-24 22:38:00 +00:00
|
|
|
strip = :
|
2007-07-16 01:03:02 +00:00
|
|
|
endif
|
2008-01-12 00:15:34 +00:00
|
|
|
ifeq ($(mode),debug-fast)
|
2013-01-28 15:20:52 +00:00
|
|
|
optimization-cflags = $(cflags_debug_fast) -DNDEBUG
|
2009-08-24 22:38:00 +00:00
|
|
|
strip = :
|
2008-01-12 00:15:34 +00:00
|
|
|
endif
|
2007-07-16 01:03:02 +00:00
|
|
|
ifeq ($(mode),stress)
|
2013-01-28 15:20:52 +00:00
|
|
|
optimization-cflags = $(cflags_stress) -DVM_STRESS
|
2009-08-24 22:38:00 +00:00
|
|
|
strip = :
|
2007-07-16 01:03:02 +00:00
|
|
|
endif
|
|
|
|
ifeq ($(mode),stress-major)
|
2013-01-28 15:20:52 +00:00
|
|
|
optimization-cflags = $(cflags_stress_major) -DVM_STRESS -DVM_STRESS_MAJOR
|
2009-08-24 22:38:00 +00:00
|
|
|
strip = :
|
2007-07-16 01:03:02 +00:00
|
|
|
endif
|
|
|
|
ifeq ($(mode),fast)
|
2013-01-28 15:20:52 +00:00
|
|
|
optimization-cflags = $(cflags_fast) -DNDEBUG
|
2007-08-18 22:42:11 +00:00
|
|
|
endif
|
2008-11-11 15:20:49 +00:00
|
|
|
ifeq ($(mode),small)
|
2013-01-28 15:20:52 +00:00
|
|
|
optimization-cflags = $(cflags_small) -DNDEBUG
|
2011-03-26 20:44:08 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(use-lto),true)
|
2012-06-01 23:43:42 +00:00
|
|
|
ifeq ($(use-clang),true)
|
2011-03-26 20:44:08 +00:00
|
|
|
optimization-cflags += -flto
|
|
|
|
lflags += $(optimization-cflags)
|
2012-06-01 23:43:42 +00:00
|
|
|
else
|
|
|
|
# only try to use LTO when GCC 4.6.0 or greater is available
|
|
|
|
gcc-major := $(shell $(cc) -dumpversion | cut -f1 -d.)
|
|
|
|
gcc-minor := $(shell $(cc) -dumpversion | cut -f2 -d.)
|
|
|
|
ifeq ($(shell expr 4 \< $(gcc-major) \
|
|
|
|
\| \( 4 \<= $(gcc-major) \& 6 \<= $(gcc-minor) \)),1)
|
|
|
|
optimization-cflags += -flto
|
|
|
|
no-lto = -fno-lto
|
|
|
|
lflags += $(optimization-cflags)
|
|
|
|
endif
|
2011-03-26 20:44:08 +00:00
|
|
|
endif
|
2008-11-11 15:20:49 +00:00
|
|
|
endif
|
2007-06-03 23:16:07 +00:00
|
|
|
|
2010-11-04 17:02:09 +00:00
|
|
|
cflags += $(optimization-cflags)
|
|
|
|
|
2013-01-28 15:20:52 +00:00
|
|
|
ifndef ms_cl_compiler
|
2014-06-22 18:30:52 +00:00
|
|
|
ifneq ($(kernel),darwin)
|
2009-11-20 01:51:43 +00:00
|
|
|
ifeq ($(arch),i386)
|
|
|
|
# this is necessary to support __sync_bool_compare_and_swap:
|
2010-10-24 02:38:42 +00:00
|
|
|
cflags += -march=i586
|
2012-03-27 00:02:43 +00:00
|
|
|
lflags += -march=i586
|
2009-11-20 01:51:43 +00:00
|
|
|
endif
|
2009-11-20 18:40:55 +00:00
|
|
|
endif
|
2013-01-28 15:20:52 +00:00
|
|
|
endif
|
2012-12-05 22:30:49 +00:00
|
|
|
|
2012-06-02 15:06:22 +00:00
|
|
|
c-objects = $(foreach x,$(1),$(patsubst $(2)/%.c,$(3)/%.o,$(x)))
|
2007-10-22 20:56:27 +00:00
|
|
|
cpp-objects = $(foreach x,$(1),$(patsubst $(2)/%.cpp,$(3)/%.o,$(x)))
|
2014-08-21 19:09:42 +00:00
|
|
|
cc-objects = $(foreach x,$(1),$(patsubst $(2)/%.cc,$(3)/%.o,$(x)))
|
2013-01-28 15:20:52 +00:00
|
|
|
asm-objects = $(foreach x,$(1),$(patsubst $(2)/%.$(asm-format),$(3)/%-asm.o,$(x)))
|
2007-10-25 22:06:05 +00:00
|
|
|
java-classes = $(foreach x,$(1),$(patsubst $(2)/%.java,$(3)/%.class,$(x)))
|
2014-03-30 19:41:26 +00:00
|
|
|
noop-files = $(foreach x,$(1),$(patsubst $(2)/%,$(3)/%,$(x)))
|
2007-06-03 23:16:07 +00:00
|
|
|
|
2007-06-18 19:23:44 +00:00
|
|
|
generated-code = \
|
2010-09-17 22:03:37 +00:00
|
|
|
$(build)/type-enums.cpp \
|
|
|
|
$(build)/type-declarations.cpp \
|
|
|
|
$(build)/type-constructors.cpp \
|
|
|
|
$(build)/type-initializations.cpp \
|
2010-11-16 17:18:08 +00:00
|
|
|
$(build)/type-java-initializations.cpp \
|
2011-08-30 01:00:17 +00:00
|
|
|
$(build)/type-name-initializations.cpp \
|
|
|
|
$(build)/type-maps.cpp
|
2007-07-06 23:50:26 +00:00
|
|
|
|
2013-02-21 23:18:20 +00:00
|
|
|
vm-depends := $(generated-code) \
|
2013-02-21 00:20:10 +00:00
|
|
|
$(shell find src include -name '*.h' -or -name '*.inc.cpp')
|
2007-07-06 23:50:26 +00:00
|
|
|
|
2008-01-19 00:54:36 +00:00
|
|
|
vm-sources = \
|
2014-02-07 21:24:56 +00:00
|
|
|
$(src)/system/$(system).cpp \
|
2014-07-13 01:05:58 +00:00
|
|
|
$(wildcard $(src)/system/$(system)/*.cpp) \
|
2007-08-10 23:45:47 +00:00
|
|
|
$(src)/finder.cpp \
|
2007-07-06 23:50:26 +00:00
|
|
|
$(src)/machine.cpp \
|
2007-11-26 23:15:53 +00:00
|
|
|
$(src)/util.cpp \
|
2013-02-15 14:35:17 +00:00
|
|
|
$(src)/heap/heap.cpp \
|
2007-09-25 23:53:11 +00:00
|
|
|
$(src)/$(process).cpp \
|
2010-09-10 21:05:29 +00:00
|
|
|
$(src)/classpath-$(classpath).cpp \
|
2007-07-20 14:36:31 +00:00
|
|
|
$(src)/builtin.cpp \
|
2008-01-28 17:27:02 +00:00
|
|
|
$(src)/jnienv.cpp \
|
2015-05-02 02:10:33 +00:00
|
|
|
$(src)/process.cpp \
|
|
|
|
$(src)/heapdump.cpp
|
2007-06-29 02:58:48 +00:00
|
|
|
|
2014-12-10 21:41:46 +00:00
|
|
|
vm-asm-sources = $(src)/$(arch).$(asm-format)
|
2007-10-22 20:56:27 +00:00
|
|
|
|
2011-09-01 03:18:00 +00:00
|
|
|
target-asm = $(asm)
|
|
|
|
|
2012-11-13 08:11:49 +00:00
|
|
|
build-embed = $(build)/embed
|
|
|
|
build-embed-loader = $(build)/embed-loader
|
|
|
|
|
2013-04-02 08:37:20 +00:00
|
|
|
embed-loader-sources = $(src)/embedded-loader.cpp
|
2012-11-13 08:11:49 +00:00
|
|
|
embed-loader-objects = $(call cpp-objects,$(embed-loader-sources),$(src),$(build-embed-loader))
|
|
|
|
|
|
|
|
embed-sources = $(src)/embed.cpp
|
|
|
|
embed-objects = $(call cpp-objects,$(embed-sources),$(src),$(build-embed))
|
|
|
|
|
2013-02-16 03:44:55 +00:00
|
|
|
compiler-sources = \
|
|
|
|
$(src)/codegen/compiler.cpp \
|
2013-02-17 02:50:34 +00:00
|
|
|
$(wildcard $(src)/codegen/compiler/*.cpp) \
|
2014-05-04 01:32:40 +00:00
|
|
|
$(src)/debug-util.cpp \
|
2013-12-19 05:46:58 +00:00
|
|
|
$(src)/codegen/runtime.cpp \
|
2014-02-25 22:15:37 +00:00
|
|
|
$(src)/codegen/targets.cpp \
|
|
|
|
$(src)/util/fixed-allocator.cpp
|
2013-02-17 02:50:34 +00:00
|
|
|
|
2013-02-24 05:47:52 +00:00
|
|
|
x86-assembler-sources = $(wildcard $(src)/codegen/target/x86/*.cpp)
|
2013-02-17 02:50:34 +00:00
|
|
|
|
2013-02-24 05:47:52 +00:00
|
|
|
arm-assembler-sources = $(wildcard $(src)/codegen/target/arm/*.cpp)
|
2013-02-17 02:50:34 +00:00
|
|
|
|
2013-02-16 03:44:55 +00:00
|
|
|
all-assembler-sources = \
|
2013-02-17 02:50:34 +00:00
|
|
|
$(x86-assembler-sources) \
|
2014-04-29 19:26:40 +00:00
|
|
|
$(arm-assembler-sources)
|
2013-02-16 03:44:55 +00:00
|
|
|
|
2013-02-17 02:50:34 +00:00
|
|
|
native-assembler-sources = $($(target-asm)-assembler-sources)
|
2013-02-16 03:44:55 +00:00
|
|
|
|
|
|
|
all-codegen-target-sources = \
|
|
|
|
$(compiler-sources) \
|
|
|
|
$(native-assembler-sources)
|
|
|
|
|
2007-10-22 20:56:27 +00:00
|
|
|
ifeq ($(process),compile)
|
2013-02-16 03:44:55 +00:00
|
|
|
vm-sources += $(compiler-sources)
|
2013-02-12 15:15:30 +00:00
|
|
|
|
|
|
|
ifeq ($(codegen-targets),native)
|
2013-02-16 03:44:55 +00:00
|
|
|
vm-sources += $(native-assembler-sources)
|
2013-02-12 15:15:30 +00:00
|
|
|
endif
|
|
|
|
ifeq ($(codegen-targets),all)
|
2014-11-26 01:36:34 +00:00
|
|
|
ifneq (,$(filter arm arm64,$(arch)))
|
2014-04-29 20:14:44 +00:00
|
|
|
# The x86 jit has a dependency on the x86 assembly code,
|
|
|
|
# and thus can't be successfully built on non-x86 platforms.
|
|
|
|
vm-sources += $(native-assembler-sources)
|
|
|
|
else
|
|
|
|
vm-sources += $(all-assembler-sources)
|
|
|
|
endif
|
2013-02-12 15:15:30 +00:00
|
|
|
endif
|
2007-12-09 22:45:43 +00:00
|
|
|
|
2014-12-10 21:41:46 +00:00
|
|
|
vm-asm-sources += $(src)/compile-$(arch).$(asm-format)
|
2007-10-22 20:56:27 +00:00
|
|
|
endif
|
2013-01-30 05:31:02 +00:00
|
|
|
ifeq ($(aot-only),true)
|
2013-01-28 17:15:29 +00:00
|
|
|
cflags += -DAVIAN_AOT_ONLY
|
2007-10-22 20:56:27 +00:00
|
|
|
endif
|
2007-06-29 02:58:48 +00:00
|
|
|
|
2010-09-17 22:03:37 +00:00
|
|
|
vm-cpp-objects = $(call cpp-objects,$(vm-sources),$(src),$(build))
|
2013-02-16 03:44:55 +00:00
|
|
|
all-codegen-target-objects = $(call cpp-objects,$(all-codegen-target-sources),$(src),$(build))
|
2010-09-17 22:03:37 +00:00
|
|
|
vm-asm-objects = $(call asm-objects,$(vm-asm-sources),$(src),$(build))
|
2008-01-19 00:54:36 +00:00
|
|
|
vm-objects = $(vm-cpp-objects) $(vm-asm-objects)
|
2007-06-03 23:16:07 +00:00
|
|
|
|
2014-11-26 01:36:34 +00:00
|
|
|
heapwalk-sources = $(src)/heapwalk.cpp
|
2008-11-21 23:20:35 +00:00
|
|
|
heapwalk-objects = \
|
2010-09-17 22:03:37 +00:00
|
|
|
$(call cpp-objects,$(heapwalk-sources),$(src),$(build))
|
2008-11-21 23:20:35 +00:00
|
|
|
|
2013-02-21 00:20:10 +00:00
|
|
|
unittest-objects = $(call cpp-objects,$(unittest-sources),$(unittest),$(build)/unittest)
|
2013-02-15 03:54:20 +00:00
|
|
|
|
2015-05-02 02:10:33 +00:00
|
|
|
vm-heapwalk-objects = $(heapwalk-objects)
|
2008-11-21 23:20:35 +00:00
|
|
|
|
2009-05-26 05:27:10 +00:00
|
|
|
ifeq ($(tails),true)
|
|
|
|
cflags += -DAVIAN_TAILS
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(continuations),true)
|
|
|
|
cflags += -DAVIAN_CONTINUATIONS
|
2009-05-29 00:51:53 +00:00
|
|
|
asmflags += -DAVIAN_CONTINUATIONS
|
2009-05-26 05:27:10 +00:00
|
|
|
endif
|
|
|
|
|
2013-03-14 21:33:05 +00:00
|
|
|
bootimage-generator-sources = $(src)/tools/bootimage-generator/main.cpp $(src)/util/arg-parser.cpp $(stub-sources)
|
2013-02-22 02:33:38 +00:00
|
|
|
|
2012-06-02 15:06:22 +00:00
|
|
|
ifneq ($(lzma),)
|
|
|
|
bootimage-generator-sources += $(src)/lzma-encode.cpp
|
|
|
|
endif
|
2013-03-14 21:33:05 +00:00
|
|
|
|
2008-11-29 23:08:14 +00:00
|
|
|
bootimage-generator-objects = \
|
2010-09-17 22:03:37 +00:00
|
|
|
$(call cpp-objects,$(bootimage-generator-sources),$(src),$(build))
|
2010-11-26 19:41:31 +00:00
|
|
|
bootimage-generator = $(build)/bootimage-generator
|
2008-11-29 23:08:14 +00:00
|
|
|
|
support AOT-compilation of Java 8 lambda expressions
These expressions are tricky because they rely on invokedynamic, which
normally implies runtime code generation. However, since lambdas
don't actually use the "dynamicness" of invokedynamic, we can convert
them into static calls to synthetic classes at compile time.
Since I had already written code to synthesize such classes in Java
and I didn't want to rewrite it in C++, I needed to add support for
running Java code to the bootimage generator. And since the primary
VM used by the generator is purpose-built to generate AOT-compiled
code for a specific target architecture and is not capable of
generating or running JIT-compiled code for the host architecture, I
added support for loading a second, independent, host-specific VM for
running Java code.
The rest of the patch handles the fact that each method compilation
might cause new, synthetic classes to be created, so we need to make
sure those classes and their methods are included in the final heap
and code images. This required breaking some giant code blocks out of
makeCodeImage into their own methods, which makes the diff look
scarier than it really is.
2015-09-13 02:15:46 +00:00
|
|
|
ifneq ($(mode),fast)
|
|
|
|
host-vm-options := -$(mode)
|
|
|
|
endif
|
|
|
|
|
2016-08-12 17:14:41 +00:00
|
|
|
host-vm = build/$(build-platform)-$(build-arch)-interpret$(host-vm-options)/$(so-prefix)jvm$(so-suffix)
|
support AOT-compilation of Java 8 lambda expressions
These expressions are tricky because they rely on invokedynamic, which
normally implies runtime code generation. However, since lambdas
don't actually use the "dynamicness" of invokedynamic, we can convert
them into static calls to synthetic classes at compile time.
Since I had already written code to synthesize such classes in Java
and I didn't want to rewrite it in C++, I needed to add support for
running Java code to the bootimage generator. And since the primary
VM used by the generator is purpose-built to generate AOT-compiled
code for a specific target architecture and is not capable of
generating or running JIT-compiled code for the host architecture, I
added support for loading a second, independent, host-specific VM for
running Java code.
The rest of the patch handles the fact that each method compilation
might cause new, synthetic classes to be created, so we need to make
sure those classes and their methods are included in the final heap
and code images. This required breaking some giant code blocks out of
makeCodeImage into their own methods, which makes the diff look
scarier than it really is.
2015-09-13 02:15:46 +00:00
|
|
|
|
2010-09-17 22:03:37 +00:00
|
|
|
bootimage-object = $(build)/bootimage-bin.o
|
2011-09-20 22:30:30 +00:00
|
|
|
codeimage-object = $(build)/codeimage-bin.o
|
|
|
|
|
2008-11-29 23:08:14 +00:00
|
|
|
ifeq ($(bootimage),true)
|
2011-09-20 22:30:30 +00:00
|
|
|
vm-classpath-objects = $(bootimage-object) $(codeimage-object)
|
|
|
|
cflags += -DBOOT_IMAGE -DAVIAN_CLASSPATH=\"\"
|
2008-11-29 23:08:14 +00:00
|
|
|
else
|
2011-09-20 22:30:30 +00:00
|
|
|
vm-classpath-objects = $(classpath-object)
|
2010-11-26 19:41:31 +00:00
|
|
|
cflags += -DBOOT_CLASSPATH=\"[classpathJar]\" \
|
|
|
|
-DAVIAN_CLASSPATH=\"[classpathJar]\"
|
2008-11-29 23:08:14 +00:00
|
|
|
endif
|
2008-11-21 23:20:35 +00:00
|
|
|
|
2011-08-23 23:04:04 +00:00
|
|
|
cflags += $(extra-cflags)
|
|
|
|
lflags += $(extra-lflags)
|
|
|
|
|
2012-01-15 17:02:36 +00:00
|
|
|
openjdk-cflags += $(extra-cflags)
|
|
|
|
|
2008-03-31 03:43:43 +00:00
|
|
|
driver-source = $(src)/main.cpp
|
2010-09-17 22:03:37 +00:00
|
|
|
driver-object = $(build)/main.o
|
2010-11-27 21:46:07 +00:00
|
|
|
driver-dynamic-objects = \
|
2011-11-20 02:26:25 +00:00
|
|
|
$(build)/main-dynamic.o
|
2007-10-25 15:04:13 +00:00
|
|
|
|
2008-03-31 03:43:43 +00:00
|
|
|
boot-source = $(src)/boot.cpp
|
2010-09-17 22:03:37 +00:00
|
|
|
boot-object = $(build)/boot.o
|
2007-10-25 15:04:13 +00:00
|
|
|
|
2010-09-20 23:31:23 +00:00
|
|
|
generator-depends := $(wildcard $(src)/*.h)
|
|
|
|
generator-sources = \
|
2013-02-21 04:26:34 +00:00
|
|
|
$(src)/tools/type-generator/main.cpp \
|
2014-02-07 21:24:56 +00:00
|
|
|
$(src)/system/$(build-system).cpp \
|
2014-07-13 01:05:58 +00:00
|
|
|
$(wildcard $(src)/system/$(build-system)/*.cpp) \
|
2014-05-29 03:34:58 +00:00
|
|
|
$(src)/finder.cpp \
|
|
|
|
$(src)/util/arg-parser.cpp
|
2012-06-02 15:06:22 +00:00
|
|
|
|
|
|
|
ifneq ($(lzma),)
|
2014-07-28 20:26:33 +00:00
|
|
|
common-cflags += -I$(lzma) -DAVIAN_USE_LZMA
|
2012-06-02 15:06:22 +00:00
|
|
|
|
|
|
|
vm-sources += \
|
|
|
|
$(src)/lzma-decode.cpp
|
|
|
|
|
|
|
|
generator-sources += \
|
|
|
|
$(src)/lzma-decode.cpp
|
|
|
|
|
|
|
|
lzma-decode-sources = \
|
|
|
|
$(lzma)/C/LzmaDec.c
|
|
|
|
|
|
|
|
lzma-decode-objects = \
|
|
|
|
$(call c-objects,$(lzma-decode-sources),$(lzma)/C,$(build))
|
|
|
|
|
|
|
|
lzma-encode-sources = \
|
|
|
|
$(lzma)/C/LzmaEnc.c \
|
|
|
|
$(lzma)/C/LzFind.c
|
|
|
|
|
|
|
|
lzma-encode-objects = \
|
|
|
|
$(call c-objects,$(lzma-encode-sources),$(lzma)/C,$(build))
|
|
|
|
|
|
|
|
lzma-encoder = $(build)/lzma/lzma
|
|
|
|
|
2014-08-07 16:11:45 +00:00
|
|
|
lzma-build-cflags = -D_7ZIP_ST -D__STDC_CONSTANT_MACROS \
|
|
|
|
-fno-exceptions -fPIC -I$(lzma)/C
|
2014-07-28 20:26:33 +00:00
|
|
|
|
|
|
|
lzma-cflags = $(lzma-build-cflags) $(classpath-extra-cflags)
|
2012-06-02 15:06:22 +00:00
|
|
|
|
|
|
|
lzma-encoder-sources = \
|
|
|
|
$(src)/lzma/main.cpp
|
|
|
|
|
|
|
|
lzma-encoder-objects = \
|
|
|
|
$(call cpp-objects,$(lzma-encoder-sources),$(src),$(build))
|
|
|
|
|
|
|
|
lzma-encoder-lzma-sources = $(lzma-encode-sources) $(lzma-decode-sources)
|
|
|
|
|
|
|
|
lzma-encoder-lzma-objects = \
|
2012-06-02 21:43:42 +00:00
|
|
|
$(call generator-c-objects,$(lzma-encoder-lzma-sources),$(lzma)/C,$(build))
|
2012-06-02 15:06:22 +00:00
|
|
|
|
|
|
|
lzma-loader = $(build)/lzma/load.o
|
2015-04-07 22:55:45 +00:00
|
|
|
|
|
|
|
lzma-library = $(build)/libavian-lzma.a
|
2012-06-02 15:06:22 +00:00
|
|
|
endif
|
|
|
|
|
2010-09-20 23:31:23 +00:00
|
|
|
generator-cpp-objects = \
|
|
|
|
$(foreach x,$(1),$(patsubst $(2)/%.cpp,$(3)/%-build.o,$(x)))
|
2012-06-02 15:06:22 +00:00
|
|
|
generator-c-objects = \
|
|
|
|
$(foreach x,$(1),$(patsubst $(2)/%.c,$(3)/%-build.o,$(x)))
|
2007-10-25 22:06:05 +00:00
|
|
|
generator-objects = \
|
2010-09-20 23:31:23 +00:00
|
|
|
$(call generator-cpp-objects,$(generator-sources),$(src),$(build))
|
2012-06-02 15:06:22 +00:00
|
|
|
generator-lzma-objects = \
|
|
|
|
$(call generator-c-objects,$(lzma-decode-sources),$(lzma)/C,$(build))
|
2010-09-17 22:03:37 +00:00
|
|
|
generator = $(build)/generator
|
2007-06-03 23:16:07 +00:00
|
|
|
|
2013-02-20 03:23:11 +00:00
|
|
|
all-depends = $(shell find include -name '*.h')
|
2012-04-27 18:08:44 +00:00
|
|
|
|
2013-02-20 03:23:11 +00:00
|
|
|
object-writer-depends = $(shell find $(src)/tools/object-writer -name '*.h')
|
|
|
|
object-writer-sources = $(shell find $(src)/tools/object-writer -name '*.cpp')
|
|
|
|
object-writer-objects = $(call cpp-objects,$(object-writer-sources),$(src),$(build))
|
2012-04-25 15:09:26 +00:00
|
|
|
|
2013-02-20 03:23:11 +00:00
|
|
|
binary-to-object-depends = $(shell find $(src)/tools/binary-to-object/ -name '*.h')
|
|
|
|
binary-to-object-sources = $(shell find $(src)/tools/binary-to-object/ -name '*.cpp')
|
|
|
|
binary-to-object-objects = $(call cpp-objects,$(binary-to-object-sources),$(src),$(build))
|
|
|
|
|
|
|
|
converter-sources = $(object-writer-sources)
|
|
|
|
|
|
|
|
converter-tool-depends = $(binary-to-object-depends) $(all-depends)
|
|
|
|
converter-tool-sources = $(binary-to-object-sources)
|
2012-05-01 19:16:32 +00:00
|
|
|
|
2012-04-25 15:09:26 +00:00
|
|
|
converter-objects = $(call cpp-objects,$(converter-sources),$(src),$(build))
|
2012-05-01 19:16:32 +00:00
|
|
|
converter-tool-objects = $(call cpp-objects,$(converter-tool-sources),$(src),$(build))
|
2012-04-25 15:09:26 +00:00
|
|
|
converter = $(build)/binaryToObject/binaryToObject
|
2010-09-17 22:03:37 +00:00
|
|
|
|
2013-01-30 08:42:05 +00:00
|
|
|
static-library = $(build)/$(static-prefix)$(name)$(static-suffix)
|
2010-09-17 22:03:37 +00:00
|
|
|
executable = $(build)/$(name)${exe-suffix}
|
|
|
|
dynamic-library = $(build)/$(so-prefix)jvm$(so-suffix)
|
2013-01-30 08:42:05 +00:00
|
|
|
executable-dynamic = $(build)/$(name)-dynamic$(exe-suffix)
|
2007-06-30 02:39:01 +00:00
|
|
|
|
2013-02-15 03:54:20 +00:00
|
|
|
unittest-executable = $(build)/$(name)-unittest${exe-suffix}
|
|
|
|
|
2010-09-10 21:05:29 +00:00
|
|
|
ifneq ($(classpath),avian)
|
2011-02-17 21:28:51 +00:00
|
|
|
# Assembler, ConstantPool, and Stream are not technically needed for a
|
|
|
|
# working build, but we include them since our Subroutine test uses
|
|
|
|
# them to synthesize a class:
|
2010-09-10 21:05:29 +00:00
|
|
|
classpath-sources := \
|
2011-02-17 21:28:51 +00:00
|
|
|
$(classpath-src)/avian/Addendum.java \
|
2013-02-21 22:37:17 +00:00
|
|
|
$(classpath-src)/avian/AnnotationInvocationHandler.java \
|
2011-02-17 21:28:51 +00:00
|
|
|
$(classpath-src)/avian/Assembler.java \
|
2010-09-10 21:05:29 +00:00
|
|
|
$(classpath-src)/avian/Callback.java \
|
2014-03-25 21:58:46 +00:00
|
|
|
$(classpath-src)/avian/Cell.java \
|
2011-02-17 21:28:51 +00:00
|
|
|
$(classpath-src)/avian/ClassAddendum.java \
|
2011-03-27 05:24:48 +00:00
|
|
|
$(classpath-src)/avian/Classes.java \
|
2014-07-12 22:03:11 +00:00
|
|
|
$(classpath-src)/avian/Code.java \
|
2011-02-17 21:28:51 +00:00
|
|
|
$(classpath-src)/avian/ConstantPool.java \
|
|
|
|
$(classpath-src)/avian/Continuations.java \
|
|
|
|
$(classpath-src)/avian/FieldAddendum.java \
|
2014-03-18 15:49:00 +00:00
|
|
|
$(classpath-src)/avian/Function.java \
|
2010-09-10 21:05:29 +00:00
|
|
|
$(classpath-src)/avian/IncompatibleContinuationException.java \
|
2014-07-12 22:03:11 +00:00
|
|
|
$(classpath-src)/avian/InnerClassReference.java \
|
2010-09-10 21:05:29 +00:00
|
|
|
$(classpath-src)/avian/Machine.java \
|
|
|
|
$(classpath-src)/avian/MethodAddendum.java \
|
2014-07-12 22:03:11 +00:00
|
|
|
$(classpath-src)/avian/Pair.java \
|
2011-03-27 05:24:48 +00:00
|
|
|
$(classpath-src)/avian/Singleton.java \
|
2011-02-17 21:28:51 +00:00
|
|
|
$(classpath-src)/avian/Stream.java \
|
|
|
|
$(classpath-src)/avian/SystemClassLoader.java \
|
2010-09-10 21:05:29 +00:00
|
|
|
$(classpath-src)/avian/VMClass.java \
|
|
|
|
$(classpath-src)/avian/VMField.java \
|
|
|
|
$(classpath-src)/avian/VMMethod.java \
|
2014-05-19 01:23:21 +00:00
|
|
|
$(classpath-src)/avian/avianvmresource/Handler.java \
|
2015-08-06 19:24:06 +00:00
|
|
|
$(classpath-src)/avian/file/Handler.java \
|
|
|
|
$(classpath-src)/java/lang/invoke/MethodHandle.java \
|
|
|
|
$(classpath-src)/java/lang/invoke/MethodHandles.java \
|
|
|
|
$(classpath-src)/java/lang/invoke/MethodType.java \
|
|
|
|
$(classpath-src)/java/lang/invoke/LambdaMetafactory.java \
|
2015-08-06 23:23:14 +00:00
|
|
|
$(classpath-src)/java/lang/invoke/LambdaConversionException.java \
|
2015-08-06 19:24:06 +00:00
|
|
|
$(classpath-src)/java/lang/invoke/CallSite.java
|
2010-09-15 00:52:57 +00:00
|
|
|
|
2014-02-26 20:39:05 +00:00
|
|
|
ifeq ($(openjdk),)
|
2013-02-19 16:36:19 +00:00
|
|
|
classpath-sources := $(classpath-sources) \
|
2014-08-21 19:09:42 +00:00
|
|
|
$(classpath-src)/dalvik/system/BaseDexClassLoader.java \
|
|
|
|
$(classpath-src)/libcore/reflect/AnnotationAccess.java \
|
2013-02-19 16:36:19 +00:00
|
|
|
$(classpath-src)/sun/reflect/ConstantPool.java \
|
2013-02-19 23:48:33 +00:00
|
|
|
$(classpath-src)/java/net/ProtocolFamily.java \
|
|
|
|
$(classpath-src)/java/net/StandardProtocolFamily.java \
|
|
|
|
$(classpath-src)/sun/misc/Cleaner.java \
|
2013-02-20 17:22:40 +00:00
|
|
|
$(classpath-src)/sun/misc/Unsafe.java \
|
2014-08-21 19:09:42 +00:00
|
|
|
$(classpath-src)/java/lang/Object.java \
|
|
|
|
$(classpath-src)/java/lang/Class.java \
|
|
|
|
$(classpath-src)/java/lang/ClassLoader.java \
|
|
|
|
$(classpath-src)/java/lang/Package.java \
|
|
|
|
$(classpath-src)/java/lang/reflect/Proxy.java \
|
|
|
|
$(classpath-src)/java/lang/reflect/Field.java \
|
|
|
|
$(classpath-src)/java/lang/reflect/SignatureParser.java \
|
|
|
|
$(classpath-src)/java/lang/reflect/Constructor.java \
|
|
|
|
$(classpath-src)/java/lang/reflect/AccessibleObject.java \
|
|
|
|
$(classpath-src)/java/lang/reflect/Method.java
|
2010-09-15 00:52:57 +00:00
|
|
|
endif
|
2010-09-10 21:05:29 +00:00
|
|
|
else
|
|
|
|
classpath-sources := $(shell find $(classpath-src) -name '*.java')
|
|
|
|
endif
|
|
|
|
|
2007-10-25 22:06:05 +00:00
|
|
|
classpath-classes = \
|
2010-09-10 21:05:29 +00:00
|
|
|
$(call java-classes,$(classpath-sources),$(classpath-src),$(classpath-build))
|
2010-09-17 22:03:37 +00:00
|
|
|
classpath-object = $(build)/classpath-jar.o
|
2009-06-03 00:55:49 +00:00
|
|
|
classpath-dep = $(classpath-build).dep
|
|
|
|
|
2010-09-10 21:05:29 +00:00
|
|
|
vm-classes = \
|
2009-06-04 23:21:42 +00:00
|
|
|
avian/*.class \
|
2010-09-10 21:05:29 +00:00
|
|
|
avian/resource/*.class
|
2007-07-16 01:03:02 +00:00
|
|
|
|
2012-05-22 20:00:31 +00:00
|
|
|
test-support-sources = $(shell find $(test)/avian/ -name '*.java')
|
2015-08-06 23:23:14 +00:00
|
|
|
test-sources := $(wildcard $(test)/*.java)
|
2016-01-13 20:23:15 +00:00
|
|
|
|
|
|
|
# HACK ALERT!!
|
|
|
|
# This test fails regularly on travis, but nowhere else. We have yet to spend the time to investigate that test, so we disable it on PR builds.
|
|
|
|
# Note: travis set TRAVIS_PULL_REQUEST environment variable to either the PR number or "false", as appropriate
|
|
|
|
ifeq (false,$(TRAVIS_PULL_REQUEST))
|
|
|
|
else
|
|
|
|
ifeq (,$(TRAVIS_PULL_REQUEST))
|
|
|
|
else
|
|
|
|
test-sources := $(subst $(test)/Trace.java,,$(test-sources))
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2015-08-06 23:23:14 +00:00
|
|
|
ifeq (7,$(java-version))
|
|
|
|
test-sources := $(subst $(test)/InvokeDynamic.java,,$(test-sources))
|
2016-11-07 02:16:11 +00:00
|
|
|
test-sources := $(subst $(test)/Interfaces.java,,$(test-sources))
|
2015-08-06 23:23:14 +00:00
|
|
|
endif
|
2016-01-13 20:23:15 +00:00
|
|
|
|
2012-08-01 16:02:55 +00:00
|
|
|
test-cpp-sources = $(wildcard $(test)/*.cpp)
|
2012-05-22 20:00:31 +00:00
|
|
|
test-sources += $(test-support-sources)
|
|
|
|
test-support-classes = $(call java-classes, $(test-support-sources),$(test),$(test-build))
|
2007-10-25 22:06:05 +00:00
|
|
|
test-classes = $(call java-classes,$(test-sources),$(test),$(test-build))
|
2012-08-01 16:02:55 +00:00
|
|
|
test-cpp-objects = $(call cpp-objects,$(test-cpp-sources),$(test),$(test-build))
|
2012-08-02 18:56:15 +00:00
|
|
|
test-library = $(build)/$(so-prefix)test$(so-suffix)
|
2009-06-03 00:55:49 +00:00
|
|
|
test-dep = $(test-build).dep
|
2007-07-16 01:03:02 +00:00
|
|
|
|
2009-05-18 15:17:09 +00:00
|
|
|
test-extra-sources = $(wildcard $(test)/extra/*.java)
|
|
|
|
test-extra-classes = \
|
|
|
|
$(call java-classes,$(test-extra-sources),$(test),$(test-build))
|
2009-06-03 00:55:49 +00:00
|
|
|
test-extra-dep = $(test-build)-extra.dep
|
2009-05-18 15:17:09 +00:00
|
|
|
|
2013-02-15 03:54:20 +00:00
|
|
|
unittest-sources = \
|
|
|
|
$(wildcard $(unittest)/*.cpp) \
|
2013-02-17 19:10:18 +00:00
|
|
|
$(wildcard $(unittest)/util/*.cpp) \
|
2013-02-15 03:54:20 +00:00
|
|
|
$(wildcard $(unittest)/codegen/*.cpp)
|
|
|
|
|
|
|
|
unittest-depends = \
|
|
|
|
$(wildcard $(unittest)/*.h)
|
|
|
|
|
2011-01-28 04:06:01 +00:00
|
|
|
ifeq ($(continuations),true)
|
|
|
|
continuation-tests = \
|
2013-12-15 03:06:51 +00:00
|
|
|
extra.ComposableContinuations \
|
2011-01-28 04:06:01 +00:00
|
|
|
extra.Continuations \
|
|
|
|
extra.Coroutines \
|
|
|
|
extra.DynamicWind
|
|
|
|
endif
|
|
|
|
|
2011-03-15 23:51:32 +00:00
|
|
|
ifeq ($(tails),true)
|
|
|
|
tail-tests = \
|
|
|
|
extra.Tails
|
|
|
|
endif
|
|
|
|
|
2012-05-02 19:38:00 +00:00
|
|
|
ifeq ($(target-arch),i386)
|
|
|
|
cflags += -DAVIAN_TARGET_ARCH=AVIAN_ARCH_X86
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(target-arch),x86_64)
|
|
|
|
cflags += -DAVIAN_TARGET_ARCH=AVIAN_ARCH_X86_64
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(target-arch),arm)
|
|
|
|
cflags += -DAVIAN_TARGET_ARCH=AVIAN_ARCH_ARM
|
|
|
|
endif
|
|
|
|
|
2014-11-26 01:36:34 +00:00
|
|
|
ifeq ($(target-arch),arm64)
|
|
|
|
cflags += -DAVIAN_TARGET_ARCH=AVIAN_ARCH_ARM64
|
|
|
|
endif
|
|
|
|
|
2012-08-02 18:15:15 +00:00
|
|
|
ifeq ($(target-format),elf)
|
|
|
|
cflags += -DAVIAN_TARGET_FORMAT=AVIAN_FORMAT_ELF
|
2012-05-03 14:45:17 +00:00
|
|
|
endif
|
|
|
|
|
2012-08-02 18:15:15 +00:00
|
|
|
ifeq ($(target-format),pe)
|
|
|
|
cflags += -DAVIAN_TARGET_FORMAT=AVIAN_FORMAT_PE
|
2012-05-03 14:45:17 +00:00
|
|
|
endif
|
|
|
|
|
2012-08-02 18:15:15 +00:00
|
|
|
ifeq ($(target-format),macho)
|
|
|
|
cflags += -DAVIAN_TARGET_FORMAT=AVIAN_FORMAT_MACHO
|
2012-08-02 16:36:16 +00:00
|
|
|
endif
|
|
|
|
|
2007-10-25 22:06:05 +00:00
|
|
|
class-name = $(patsubst $(1)/%.class,%,$(2))
|
2007-10-28 01:54:30 +00:00
|
|
|
class-names = $(foreach x,$(2),$(call class-name,$(1),$(x)))
|
2007-07-16 01:03:02 +00:00
|
|
|
|
2014-04-21 01:11:15 +00:00
|
|
|
test-flags = -Djava.library.path=$(build) \
|
2014-05-09 22:37:17 +00:00
|
|
|
-cp '$(build)/test$(target-path-separator)$(build)/extra-dir'
|
2007-12-27 15:46:17 +00:00
|
|
|
|
2010-09-20 23:31:23 +00:00
|
|
|
test-args = $(test-flags) $(input)
|
2007-06-21 01:38:02 +00:00
|
|
|
|
Added targets for Eclipse environment descriptor.
Someone on the Google Groups site asked how to set up an Eclipse
project with Avian classpath. This patch creates the descriptor
that you can you use to do that at `$(build)/eclipse/jdk/avian.ee`.
The descriptor includes the Avian version, platform, architecture,
and build options to allow for multiple versions to exist side by
side. Users can import the descriptor into Eclipse via:
Window >> Preferences >> Java >> Installed JREs >> Add >> Execution
Environment Description
Once the descriptor is imported, Avian can be used just like any other
JVM installation for Eclipse projects. Personally I use this in
conjunction with Eclim to gain code completion for Avian in vim.
The new targets also create symlinks to loosely mimic OpenJDK's
filenames and folder layout:
build/linux-x86_64-tails-continuations/eclipse/jdk/
├── avian.ee
├── bin
│ └── java -> ../../../avian
├── jre
│ └── lib
│ └── rt.jar -> ../../../../classpath.jar
└── src -> ../../classpath
Annoyingly, Eclipse for some reason expects this layout to exist
even though the descriptor format has required parameters for
specifying these locations. I suppose that other software may
look for this "standard" layout in a JVM installation so it may be
generally useful.
These artifacts are only built if the platform is one of `windows`,
`linux`, or `macosx`. The symlinks might not actually work at all on
Windows, I'm not sure how things like cygwin/msys handle that and I
do not have the means to test it. If they do not work a fallback
for windows might be to actually copy the files instead of symlinking.
I realize this can be done outside of the makefile but it seemed
useful to put it here to gain access to the information about the
build location, platform, architecture, and other build options.
For the record, this contribution is my original work and is released
under the same license that Avian uses, found in the license.txt
file in this repository.
2015-07-16 13:44:55 +00:00
|
|
|
ifneq ($(filter linux windows macosx,$(platform)),)
|
|
|
|
eclipse-exec-env = eclipse-ee
|
|
|
|
eclipse-jdk-dir = $(build)/eclipse/jdk
|
|
|
|
eclipse-ee-file = $(eclipse-jdk-dir)/avian.ee
|
|
|
|
eclipse-bin-dir = $(eclipse-jdk-dir)/bin
|
|
|
|
eclipse-lib-dir = $(eclipse-jdk-dir)/jre/lib
|
|
|
|
eclipse-src-dir = $(eclipse-jdk-dir)/src
|
|
|
|
define eclipse-ee-descriptor
|
|
|
|
# An Eclipse execution environment for the Avian JVM\
|
|
|
|
\n-Dee.executable=bin/java${exe-suffix}\
|
|
|
|
\n-Dee.bootclasspath=jre/lib/rt.jar\
|
|
|
|
\n-Dee.language.level=1.7\
|
|
|
|
\n-Dee.name=$(name)-$(version)-$(platform)-$(arch)$(options)\
|
|
|
|
\n-Dee.src=src\
|
|
|
|
\n-Dee.javadoc=file://$${ee.home}/doc\
|
|
|
|
\n-Djava.home=$${ee.home}\n
|
|
|
|
endef
|
|
|
|
else
|
|
|
|
eclipse-exec-env =
|
|
|
|
endif
|
|
|
|
|
2007-06-03 23:16:07 +00:00
|
|
|
.PHONY: build
|
2013-01-28 15:20:52 +00:00
|
|
|
ifneq ($(supports_avian_executable),false)
|
2015-04-07 22:55:45 +00:00
|
|
|
build: $(static-library) $(executable) $(dynamic-library) $(lzma-library) \
|
2012-06-02 19:23:52 +00:00
|
|
|
$(lzma-encoder) $(executable-dynamic) $(classpath-dep) $(test-dep) \
|
Added targets for Eclipse environment descriptor.
Someone on the Google Groups site asked how to set up an Eclipse
project with Avian classpath. This patch creates the descriptor
that you can you use to do that at `$(build)/eclipse/jdk/avian.ee`.
The descriptor includes the Avian version, platform, architecture,
and build options to allow for multiple versions to exist side by
side. Users can import the descriptor into Eclipse via:
Window >> Preferences >> Java >> Installed JREs >> Add >> Execution
Environment Description
Once the descriptor is imported, Avian can be used just like any other
JVM installation for Eclipse projects. Personally I use this in
conjunction with Eclim to gain code completion for Avian in vim.
The new targets also create symlinks to loosely mimic OpenJDK's
filenames and folder layout:
build/linux-x86_64-tails-continuations/eclipse/jdk/
├── avian.ee
├── bin
│ └── java -> ../../../avian
├── jre
│ └── lib
│ └── rt.jar -> ../../../../classpath.jar
└── src -> ../../classpath
Annoyingly, Eclipse for some reason expects this layout to exist
even though the descriptor format has required parameters for
specifying these locations. I suppose that other software may
look for this "standard" layout in a JVM installation so it may be
generally useful.
These artifacts are only built if the platform is one of `windows`,
`linux`, or `macosx`. The symlinks might not actually work at all on
Windows, I'm not sure how things like cygwin/msys handle that and I
do not have the means to test it. If they do not work a fallback
for windows might be to actually copy the files instead of symlinking.
I realize this can be done outside of the makefile but it seemed
useful to put it here to gain access to the information about the
build location, platform, architecture, and other build options.
For the record, this contribution is my original work and is released
under the same license that Avian uses, found in the license.txt
file in this repository.
2015-07-16 13:44:55 +00:00
|
|
|
$(test-extra-dep) $(embed) $(build)/classpath.jar $(eclipse-exec-env)
|
2013-01-28 15:20:52 +00:00
|
|
|
else
|
2015-04-07 22:55:45 +00:00
|
|
|
build: $(static-library) $(dynamic-library) $(lzma-library) \
|
2013-01-28 15:20:52 +00:00
|
|
|
$(lzma-encoder) $(classpath-dep) $(test-dep) \
|
2014-07-28 15:19:39 +00:00
|
|
|
$(test-extra-dep) $(embed) $(build)/classpath.jar
|
2013-01-28 15:20:52 +00:00
|
|
|
endif
|
2007-06-03 23:16:07 +00:00
|
|
|
|
2009-09-05 22:04:43 +00:00
|
|
|
$(test-dep): $(classpath-dep)
|
|
|
|
|
|
|
|
$(test-extra-dep): $(classpath-dep)
|
2007-06-21 01:38:02 +00:00
|
|
|
|
2007-06-03 23:16:07 +00:00
|
|
|
.PHONY: run
|
2007-09-30 16:32:17 +00:00
|
|
|
run: build
|
2010-11-04 17:02:09 +00:00
|
|
|
$(library-path) $(test-executable) $(test-args)
|
2007-06-03 23:16:07 +00:00
|
|
|
|
|
|
|
.PHONY: debug
|
2007-09-30 16:32:17 +00:00
|
|
|
debug: build
|
2014-05-07 19:01:53 +00:00
|
|
|
$(library-path) $(db) $(test-executable) $(test-args)
|
2007-06-03 23:16:07 +00:00
|
|
|
|
|
|
|
.PHONY: vg
|
2007-09-30 16:32:17 +00:00
|
|
|
vg: build
|
2010-11-04 17:02:09 +00:00
|
|
|
$(library-path) $(vg) $(test-executable) $(test-args)
|
2007-06-03 23:16:07 +00:00
|
|
|
|
|
|
|
.PHONY: test
|
2014-04-22 17:09:41 +00:00
|
|
|
test: build-test run-test
|
|
|
|
|
|
|
|
.PHONY: build-test
|
|
|
|
build-test: build $(build)/run-tests.sh $(build)/test.sh $(unittest-executable)
|
|
|
|
|
|
|
|
.PHONY: run-test
|
|
|
|
run-test:
|
2013-02-15 00:21:57 +00:00
|
|
|
ifneq ($(remote-test),true)
|
|
|
|
/bin/sh $(build)/run-tests.sh
|
|
|
|
else
|
2013-02-16 00:43:21 +00:00
|
|
|
@echo "running tests on $(remote-test-user)@$(remote-test-host):$(remote-test-port), in $(remote-test-dir)"
|
2013-02-15 00:21:57 +00:00
|
|
|
rsync $(build) -rav --exclude '*.o' --rsh="ssh -p$(remote-test-port)" $(remote-test-user)@$(remote-test-host):$(remote-test-dir)
|
|
|
|
ssh -p$(remote-test-port) $(remote-test-user)@$(remote-test-host) sh "$(remote-test-dir)/$(platform)-$(arch)$(options)/run-tests.sh"
|
|
|
|
endif
|
2007-06-03 23:16:07 +00:00
|
|
|
|
2013-12-06 21:56:02 +00:00
|
|
|
.PHONY: jdk-test
|
2013-12-07 02:30:04 +00:00
|
|
|
jdk-test: $(test-dep) $(build)/classpath.jar $(build)/jdk-run-tests.sh $(build)/test.sh
|
2013-12-06 21:56:02 +00:00
|
|
|
/bin/sh $(build)/jdk-run-tests.sh
|
|
|
|
|
2009-04-11 17:54:43 +00:00
|
|
|
.PHONY: tarball
|
|
|
|
tarball:
|
|
|
|
@echo "creating build/avian-$(version).tar.bz2"
|
|
|
|
@mkdir -p build
|
2015-03-13 21:21:29 +00:00
|
|
|
(cd .. && tar --exclude=build --exclude=cmake-build --exclude=distrib \
|
2015-03-16 16:39:11 +00:00
|
|
|
--exclude=lib --exclude='.*' --exclude='*~' \
|
2015-03-13 21:21:29 +00:00
|
|
|
-cjf avian/build/avian-$(version).tar.bz2 avian)
|
2009-04-11 17:54:43 +00:00
|
|
|
|
2013-02-06 18:38:30 +00:00
|
|
|
.PHONY: clean-current
|
|
|
|
clean-current:
|
2013-02-03 10:27:30 +00:00
|
|
|
@echo "removing $(build)"
|
|
|
|
rm -rf $(build)
|
|
|
|
|
2007-06-03 23:16:07 +00:00
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
2015-03-16 16:39:11 +00:00
|
|
|
@echo "removing build directories"
|
|
|
|
rm -rf build cmake-build distrib lib
|
2007-06-03 23:16:07 +00:00
|
|
|
|
Added targets for Eclipse environment descriptor.
Someone on the Google Groups site asked how to set up an Eclipse
project with Avian classpath. This patch creates the descriptor
that you can you use to do that at `$(build)/eclipse/jdk/avian.ee`.
The descriptor includes the Avian version, platform, architecture,
and build options to allow for multiple versions to exist side by
side. Users can import the descriptor into Eclipse via:
Window >> Preferences >> Java >> Installed JREs >> Add >> Execution
Environment Description
Once the descriptor is imported, Avian can be used just like any other
JVM installation for Eclipse projects. Personally I use this in
conjunction with Eclim to gain code completion for Avian in vim.
The new targets also create symlinks to loosely mimic OpenJDK's
filenames and folder layout:
build/linux-x86_64-tails-continuations/eclipse/jdk/
├── avian.ee
├── bin
│ └── java -> ../../../avian
├── jre
│ └── lib
│ └── rt.jar -> ../../../../classpath.jar
└── src -> ../../classpath
Annoyingly, Eclipse for some reason expects this layout to exist
even though the descriptor format has required parameters for
specifying these locations. I suppose that other software may
look for this "standard" layout in a JVM installation so it may be
generally useful.
These artifacts are only built if the platform is one of `windows`,
`linux`, or `macosx`. The symlinks might not actually work at all on
Windows, I'm not sure how things like cygwin/msys handle that and I
do not have the means to test it. If they do not work a fallback
for windows might be to actually copy the files instead of symlinking.
I realize this can be done outside of the makefile but it seemed
useful to put it here to gain access to the information about the
build location, platform, architecture, and other build options.
For the record, this contribution is my original work and is released
under the same license that Avian uses, found in the license.txt
file in this repository.
2015-07-16 13:44:55 +00:00
|
|
|
.PHONY: eclipse-ee
|
|
|
|
ifneq ($(strip $(eclipse-exec-env)),)
|
|
|
|
eclipse-ee: $(eclipse-ee-file) $(eclipse-lib-dir)/rt.jar $(eclipse-bin-dir)/java${exe-suffix} $(eclipse-src-dir)
|
|
|
|
|
|
|
|
$(eclipse-bin-dir):
|
|
|
|
@mkdir -p $(@)
|
|
|
|
|
|
|
|
$(eclipse-lib-dir):
|
|
|
|
@mkdir -p $(@)
|
|
|
|
|
|
|
|
$(eclipse-jdk-dir):
|
|
|
|
@mkdir -p $(@)
|
|
|
|
|
|
|
|
$(eclipse-ee-file): $(eclipse-jdk-dir)
|
|
|
|
@echo "writing eclipse execution environment descriptor to $(@)"
|
|
|
|
@printf '${eclipse-ee-descriptor}' > $(@)
|
|
|
|
|
|
|
|
$(eclipse-src-dir): $(eclipse-jdk-dir)
|
|
|
|
@echo "symlinking classpath for $(@)"
|
2015-07-17 03:59:27 +00:00
|
|
|
@ln -sf ../../../../classpath $(@)
|
Added targets for Eclipse environment descriptor.
Someone on the Google Groups site asked how to set up an Eclipse
project with Avian classpath. This patch creates the descriptor
that you can you use to do that at `$(build)/eclipse/jdk/avian.ee`.
The descriptor includes the Avian version, platform, architecture,
and build options to allow for multiple versions to exist side by
side. Users can import the descriptor into Eclipse via:
Window >> Preferences >> Java >> Installed JREs >> Add >> Execution
Environment Description
Once the descriptor is imported, Avian can be used just like any other
JVM installation for Eclipse projects. Personally I use this in
conjunction with Eclim to gain code completion for Avian in vim.
The new targets also create symlinks to loosely mimic OpenJDK's
filenames and folder layout:
build/linux-x86_64-tails-continuations/eclipse/jdk/
├── avian.ee
├── bin
│ └── java -> ../../../avian
├── jre
│ └── lib
│ └── rt.jar -> ../../../../classpath.jar
└── src -> ../../classpath
Annoyingly, Eclipse for some reason expects this layout to exist
even though the descriptor format has required parameters for
specifying these locations. I suppose that other software may
look for this "standard" layout in a JVM installation so it may be
generally useful.
These artifacts are only built if the platform is one of `windows`,
`linux`, or `macosx`. The symlinks might not actually work at all on
Windows, I'm not sure how things like cygwin/msys handle that and I
do not have the means to test it. If they do not work a fallback
for windows might be to actually copy the files instead of symlinking.
I realize this can be done outside of the makefile but it seemed
useful to put it here to gain access to the information about the
build location, platform, architecture, and other build options.
For the record, this contribution is my original work and is released
under the same license that Avian uses, found in the license.txt
file in this repository.
2015-07-16 13:44:55 +00:00
|
|
|
|
|
|
|
$(eclipse-bin-dir)/java$(exe-suffix): $(eclipse-bin-dir) $(executable)
|
|
|
|
@echo "symlinking $(executable) for $(@)"
|
|
|
|
@ln -sf ../../../$(name)${exe-suffix} $(@)
|
|
|
|
|
|
|
|
$(eclipse-lib-dir)/rt.jar: $(eclipse-lib-dir) $(build)/classpath.jar
|
|
|
|
@echo "symlinking $(build)/classpath.jar for $(@)"
|
|
|
|
@ln -sf ../../../../classpath.jar $(@)
|
|
|
|
else
|
|
|
|
eclipse-ee:
|
|
|
|
$(error "Eclipse execution environment for platform '$(platform)' is not supported")
|
|
|
|
endif
|
|
|
|
|
2013-01-29 07:40:29 +00:00
|
|
|
ifeq ($(continuations),true)
|
2013-01-28 15:20:52 +00:00
|
|
|
$(build)/compile-x86-asm.o: $(src)/continuations-x86.$(asm-format)
|
2013-01-29 07:40:29 +00:00
|
|
|
endif
|
2007-08-19 19:45:51 +00:00
|
|
|
|
2013-11-04 21:28:19 +00:00
|
|
|
$(build)/run-tests.sh: $(test-classes) makefile $(build)/extra-dir/multi-classpath-test.txt $(build)/test/multi-classpath-test.txt
|
2013-02-15 00:21:57 +00:00
|
|
|
echo 'cd $$(dirname $$0)' > $(@)
|
|
|
|
echo "sh ./test.sh 2>/dev/null \\" >> $(@)
|
2014-02-22 22:35:12 +00:00
|
|
|
echo "$(shell echo $(library-path) | sed 's|$(build)|\.|g') ./$(name)-unittest${exe-suffix} ./$(notdir $(test-executable)) $(mode) \"-Djava.library.path=. -cp test$(target-path-separator)extra-dir\" \\" >> $(@)
|
2013-02-15 00:21:57 +00:00
|
|
|
echo "$(call class-names,$(test-build),$(filter-out $(test-support-classes), $(test-classes))) \\" >> $(@)
|
|
|
|
echo "$(continuation-tests) $(tail-tests)" >> $(@)
|
|
|
|
|
2013-12-06 21:56:02 +00:00
|
|
|
$(build)/jdk-run-tests.sh: $(test-classes) makefile $(build)/extra-dir/multi-classpath-test.txt $(build)/test/multi-classpath-test.txt
|
|
|
|
echo 'cd $$(dirname $$0)' > $(@)
|
|
|
|
echo "sh ./test.sh 2>/dev/null \\" >> $(@)
|
2014-01-08 22:00:19 +00:00
|
|
|
echo "'' true $(JAVA_HOME)/bin/java $(mode) \"-Xmx128m -Djava.library.path=. -cp test$(path-separator)extra-dir$(path-separator)classpath\" \\" >> $(@)
|
2013-12-06 21:56:02 +00:00
|
|
|
echo "$(call class-names,$(test-build),$(filter-out $(test-support-classes), $(test-classes))) \\" >> $(@)
|
|
|
|
echo "$(continuation-tests) $(tail-tests)" >> $(@)
|
|
|
|
|
2013-11-04 21:28:19 +00:00
|
|
|
$(build)/extra-dir/multi-classpath-test.txt:
|
|
|
|
mkdir -p $(build)/extra-dir
|
|
|
|
echo "$@" > $@
|
|
|
|
|
|
|
|
$(build)/test/multi-classpath-test.txt:
|
|
|
|
echo "$@" > $@
|
|
|
|
|
2013-02-15 00:21:57 +00:00
|
|
|
$(build)/test.sh: $(test)/test.sh
|
|
|
|
cp $(<) $(@)
|
|
|
|
|
2010-09-17 22:03:37 +00:00
|
|
|
gen-arg = $(shell echo $(1) | sed -e 's:$(build)/type-\(.*\)\.cpp:\1:')
|
2007-11-04 21:15:28 +00:00
|
|
|
$(generated-code): %.cpp: $(src)/types.def $(generator) $(classpath-dep)
|
2007-06-03 23:16:07 +00:00
|
|
|
@echo "generating $(@)"
|
2007-10-28 01:54:30 +00:00
|
|
|
@mkdir -p $(dir $(@))
|
2014-05-29 03:34:58 +00:00
|
|
|
$(generator) -cp $(boot-classpath) -i $(<) -o $(@) -t $(call gen-arg,$(@))
|
2007-06-03 23:16:07 +00:00
|
|
|
|
2013-02-19 16:36:19 +00:00
|
|
|
$(classpath-dep): $(classpath-sources) $(classpath-jar-dep)
|
2007-11-02 14:01:10 +00:00
|
|
|
@echo "compiling classpath classes"
|
2009-06-04 23:54:06 +00:00
|
|
|
@mkdir -p $(classpath-build)
|
fix timestamp-related bug in makefile
Prior to this commit, we had a little bit of "cleverness" wherein we
recursively invoked make to determine which of the .class files in the
class library were out of date with respect to their .java files. We
did this to avoid asking javac to recompile everything every time.
The problem with that is when building against an alternative class
library (e.g. OpenJDK or Android), we use a combination of classes
from the alternative library and some of the built-in Avian classes
(e.g. java/lang/invoke/MethodHandle, which is very closely tied to the
VM). This confuses the build process, since some of the classes were
taken from an external jar, and some of them were built from source.
The tricky bit is that, depending on the relative timestamps of the
extracted .class files and the .java source files, you might never see
the problem. That's why I couldn't reproduce this when it was first
reported a few months ago: my source files were newer than the .class
files from the OpenJDK jars I was using, so the Avian versions were
built and used as intended. It was only later when I used a newer
OpenJDK that I hit the problem.
Anyway, I've removed the cleverness. If this causes an unreasonable
regression in (re)build times, we can try to reintroduce it in a way
that avoids the above problem, but for now simpler is better.
2016-06-21 22:34:45 +00:00
|
|
|
$(javac) -source 1.$(java-version) -target 1.$(java-version) \
|
|
|
|
-d $(classpath-build) -bootclasspath $(boot-classpath) \
|
|
|
|
$(classpath-sources)
|
2007-10-25 22:06:05 +00:00
|
|
|
@touch $(@)
|
2007-06-29 02:58:48 +00:00
|
|
|
|
2013-02-20 17:22:40 +00:00
|
|
|
$(build)/android-src/%.cpp: $(luni-native)/%.cpp
|
2013-03-14 21:33:05 +00:00
|
|
|
cp $(<) $(@)
|
2013-02-20 17:22:40 +00:00
|
|
|
|
2013-07-05 20:34:16 +00:00
|
|
|
$(build)/android-src/%.cpp: $(libnativehelper-native)/%.cpp
|
|
|
|
cp $(<) $(@)
|
|
|
|
|
|
|
|
$(build)/android-src/%.cpp: $(crypto-native)/%.cpp
|
|
|
|
cp $(<) $(@)
|
|
|
|
|
2014-08-21 19:09:42 +00:00
|
|
|
$(build)/android-src/%.cpp: $(libziparchive-native)/%.cc
|
|
|
|
cp $(<) $(@)
|
|
|
|
|
|
|
|
$(build)/android-src/%.cpp: $(libutils-native)/%.cpp
|
2013-07-05 20:34:16 +00:00
|
|
|
cp $(<) $(@)
|
|
|
|
|
2013-02-20 17:22:40 +00:00
|
|
|
$(build)/%.o: $(build)/android-src/%.cpp $(build)/android.dep
|
2013-02-19 16:36:19 +00:00
|
|
|
@echo "compiling $(@)"
|
|
|
|
@mkdir -p $(dir $(@))
|
2013-03-04 21:24:41 +00:00
|
|
|
$(cxx) $(android-cflags) $(classpath-extra-cflags) -c \
|
|
|
|
$$($(windows-path) $(<)) $(call output,$(@))
|
2013-02-19 16:36:19 +00:00
|
|
|
|
2014-08-21 19:09:42 +00:00
|
|
|
$(build)/android.dep: $(luni-javas) $(dalvik-javas) $(libart-javas) \
|
2014-11-23 09:55:09 +00:00
|
|
|
$(xml-javas) $(okhttp-android-javas) $(okhttp-javas) $(okio-javas) \
|
|
|
|
$(bcpkix-javas) $(bcprov-javas) $(luni-nonjavas) $(crypto-javas) $(crypto-platform-javas)
|
2013-02-19 16:36:19 +00:00
|
|
|
@echo "compiling luni classes"
|
|
|
|
@mkdir -p $(classpath-build)
|
|
|
|
@mkdir -p $(build)/android
|
|
|
|
@mkdir -p $(build)/android-src/external/fdlibm
|
|
|
|
@mkdir -p $(build)/android-src/libexpat
|
2013-04-22 23:10:23 +00:00
|
|
|
cp $(android)/external/fdlibm/fdlibm.h $(build)/android-src/external/fdlibm/
|
|
|
|
cp $(android)/external/expat/lib/expat*.h $(build)/android-src/libexpat/
|
2014-11-23 09:55:09 +00:00
|
|
|
cp -a $(luni-java)/* $(xml-java)/* $(okhttp-android-java)/* $(okhttp-java)/* $(okio-java)/* $(bcpkix-java)/* $(bcprov-java)/* $(build)/android-src/
|
2014-08-21 19:09:42 +00:00
|
|
|
rm $(call noop-files,$(luni-blacklist),$(luni-java),$(build)/android-src)
|
|
|
|
(cd $(dalvik-java) && \
|
2014-08-31 21:13:14 +00:00
|
|
|
$(jar) c $(call noop-files,$(dalvik-javas),$(dalvik-java),.)) \
|
|
|
|
| (cd $(build)/android-src && $(jar) x)
|
2014-08-21 19:09:42 +00:00
|
|
|
(cd $(libart-java) && \
|
2014-08-31 21:13:14 +00:00
|
|
|
$(jar) c $(call noop-files,$(libart-javas),$(libart-java),.)) \
|
|
|
|
| (cd $(build)/android-src && $(jar) x)
|
2014-08-22 13:05:58 +00:00
|
|
|
(cd $(crypto-java) && \
|
2014-08-31 21:13:14 +00:00
|
|
|
$(jar) c $(call noop-files,$(crypto-javas),$(crypto-java),.)) \
|
|
|
|
| (cd $(build)/android-src && $(jar) x)
|
2014-08-22 13:05:58 +00:00
|
|
|
(cd $(crypto-platform-java) && \
|
2014-08-31 21:13:14 +00:00
|
|
|
$(jar) c $(call noop-files,$(crypto-platform-javas),$(crypto-platform-java),.)) \
|
|
|
|
| (cd $(build)/android-src && $(jar) x)
|
2014-08-21 19:09:42 +00:00
|
|
|
(cd $(classpath-src) && \
|
2014-08-31 21:13:14 +00:00
|
|
|
$(jar) c $(call noop-files,$(classpath-sources),$(classpath-src),.)) \
|
|
|
|
| (cd $(build)/android-src && $(jar) x)
|
|
|
|
# (cd android && $(jar) c *) | (cd $(build)/android-src && $(jar) x)
|
2013-02-19 16:36:19 +00:00
|
|
|
find $(build)/android-src -name '*.java' > $(build)/android.txt
|
2014-08-21 19:09:42 +00:00
|
|
|
$(javac) -Xmaxerrs 1000 -d $(build)/android @$(build)/android.txt
|
2013-02-21 22:37:17 +00:00
|
|
|
rm $(build)/android/sun/misc/Unsafe* \
|
|
|
|
$(build)/android/java/lang/reflect/Proxy*
|
2014-03-18 15:22:52 +00:00
|
|
|
for x in $(luni-copied-nonjavas); \
|
2014-03-30 19:10:48 +00:00
|
|
|
do cp $(luni-java)$${x} $(build)/android$${x} ; \
|
2014-03-16 20:15:33 +00:00
|
|
|
done
|
2014-03-18 19:13:35 +00:00
|
|
|
# fix security.properties - get rid of "com.android" in front of classes starting with "org"
|
|
|
|
sed -i -e 's/\(.*=\)com\.android\.\(org\..*\)/\1\2/g' \
|
2014-03-30 19:10:48 +00:00
|
|
|
$(build)/android/java/security/security.properties
|
|
|
|
chmod +w $(build)/android/java/security/security.properties
|
2013-02-19 16:36:19 +00:00
|
|
|
cp -r $(build)/android/* $(classpath-build)
|
2014-11-26 01:36:34 +00:00
|
|
|
@touch $(@)
|
2013-02-19 16:36:19 +00:00
|
|
|
|
2007-10-25 22:06:05 +00:00
|
|
|
$(test-build)/%.class: $(test)/%.java
|
2007-11-02 21:08:14 +00:00
|
|
|
@echo $(<)
|
|
|
|
|
2012-08-01 16:02:55 +00:00
|
|
|
$(test-dep): $(test-sources) $(test-library)
|
2007-11-02 14:01:10 +00:00
|
|
|
@echo "compiling test classes"
|
2009-06-03 00:55:49 +00:00
|
|
|
@mkdir -p $(test-build)
|
2010-09-17 22:03:37 +00:00
|
|
|
files="$(shell $(MAKE) -s --no-print-directory build=$(build) $(test-classes))"; \
|
2009-09-17 17:50:35 +00:00
|
|
|
if test -n "$${files}"; then \
|
2015-08-06 23:23:14 +00:00
|
|
|
$(javac) -source 1.$(java-version) -target 1.$(java-version) \
|
2014-11-26 01:36:34 +00:00
|
|
|
-classpath $(test-build) -d $(test-build) -bootclasspath $(boot-classpath) $${files}; \
|
2009-09-17 17:50:35 +00:00
|
|
|
fi
|
2009-06-11 00:15:00 +00:00
|
|
|
$(javac) -source 1.2 -target 1.1 -XDjsrlimit=0 -d $(test-build) \
|
2011-02-16 18:41:33 +00:00
|
|
|
-bootclasspath $(boot-classpath) test/Subroutine.java
|
2007-10-25 22:06:05 +00:00
|
|
|
@touch $(@)
|
2007-06-03 23:16:07 +00:00
|
|
|
|
2009-05-18 15:17:09 +00:00
|
|
|
$(test-extra-dep): $(test-extra-sources)
|
|
|
|
@echo "compiling extra test classes"
|
2009-06-03 00:55:49 +00:00
|
|
|
@mkdir -p $(test-build)
|
2010-09-17 22:03:37 +00:00
|
|
|
files="$(shell $(MAKE) -s --no-print-directory build=$(build) $(test-extra-classes))"; \
|
2009-09-17 17:50:35 +00:00
|
|
|
if test -n "$${files}"; then \
|
2015-08-06 23:23:14 +00:00
|
|
|
$(javac) -source 1.$(java-version) -target 1.$(java-version) \
|
2014-11-26 01:36:34 +00:00
|
|
|
-d $(test-build) -bootclasspath $(boot-classpath) $${files}; \
|
2009-09-17 17:50:35 +00:00
|
|
|
fi
|
2009-05-18 15:17:09 +00:00
|
|
|
@touch $(@)
|
|
|
|
|
2007-07-16 01:03:02 +00:00
|
|
|
define compile-object
|
2007-06-03 23:16:07 +00:00
|
|
|
@echo "compiling $(@)"
|
2007-10-28 01:54:30 +00:00
|
|
|
@mkdir -p $(dir $(@))
|
2012-06-02 21:43:42 +00:00
|
|
|
$(cxx) $(cflags) -c $$($(windows-path) $(<)) $(call output,$(@))
|
2007-07-16 01:03:02 +00:00
|
|
|
endef
|
2007-06-03 23:16:07 +00:00
|
|
|
|
2008-11-11 15:20:49 +00:00
|
|
|
define compile-asm-object
|
|
|
|
@echo "compiling $(@)"
|
|
|
|
@mkdir -p $(dir $(@))
|
2013-01-28 15:20:52 +00:00
|
|
|
$(as) $(asmflags) $(call asm-output,$(@)) $(call asm-input,$(<))
|
2008-11-11 15:20:49 +00:00
|
|
|
endef
|
|
|
|
|
2013-02-15 03:54:20 +00:00
|
|
|
define compile-unittest-object
|
|
|
|
@echo "compiling $(@)"
|
|
|
|
@mkdir -p $(dir $(@))
|
2013-03-04 18:09:59 +00:00
|
|
|
$(cxx) $(cflags) -c $$($(windows-path) $(<)) -I$(unittest) $(call output,$(@))
|
2013-02-15 03:54:20 +00:00
|
|
|
endef
|
|
|
|
|
2010-09-17 22:03:37 +00:00
|
|
|
$(vm-cpp-objects): $(build)/%.o: $(src)/%.cpp $(vm-depends)
|
2007-10-25 22:06:05 +00:00
|
|
|
$(compile-object)
|
|
|
|
|
2013-02-16 03:44:55 +00:00
|
|
|
ifeq ($(process),interpret)
|
|
|
|
$(all-codegen-target-objects): $(build)/%.o: $(src)/%.cpp $(vm-depends)
|
|
|
|
$(compile-object)
|
|
|
|
endif
|
|
|
|
|
2013-02-15 03:54:20 +00:00
|
|
|
$(unittest-objects): $(build)/unittest/%.o: $(unittest)/%.cpp $(vm-depends) $(unittest-depends)
|
|
|
|
$(compile-unittest-object)
|
|
|
|
|
2012-08-01 16:02:55 +00:00
|
|
|
$(test-cpp-objects): $(test-build)/%.o: $(test)/%.cpp $(vm-depends)
|
|
|
|
$(compile-object)
|
|
|
|
|
|
|
|
$(test-library): $(test-cpp-objects)
|
|
|
|
@echo "linking $(@)"
|
2013-01-28 15:20:52 +00:00
|
|
|
ifdef ms_cl_compiler
|
2013-01-30 08:42:05 +00:00
|
|
|
$(ld) $(shared) $(lflags) $(^) -out:$(@) \
|
|
|
|
-debug -PDB:$(subst $(so-suffix),.pdb,$(@)) \
|
2013-01-28 15:20:52 +00:00
|
|
|
-IMPLIB:$(test-build)/$(name).lib $(manifest-flags)
|
|
|
|
ifdef mt
|
|
|
|
$(mt) -nologo -manifest $(@).manifest -outputresource:"$(@);2"
|
|
|
|
endif
|
2012-08-01 16:02:55 +00:00
|
|
|
else
|
|
|
|
$(ld) $(^) $(shared) $(lflags) -o $(@)
|
|
|
|
endif
|
|
|
|
|
2012-11-13 08:11:49 +00:00
|
|
|
ifdef embed
|
|
|
|
$(embed): $(embed-objects) $(embed-loader-o)
|
|
|
|
@echo "building $(embed)"
|
2013-01-28 15:20:52 +00:00
|
|
|
ifdef ms_cl_compiler
|
2013-01-30 08:42:05 +00:00
|
|
|
$(ld) $(lflags) $(^) -out:$(@) \
|
|
|
|
-debug -PDB:$(subst $(exe-suffix),.pdb,$(@)) $(manifest-flags)
|
2013-01-28 15:20:52 +00:00
|
|
|
ifdef mt
|
|
|
|
$(mt) -nologo -manifest $(@).manifest -outputresource:"$(@);1"
|
|
|
|
endif
|
2012-12-05 22:30:49 +00:00
|
|
|
else
|
|
|
|
$(cxx) $(^) $(lflags) $(static) $(call output,$(@))
|
|
|
|
endif
|
2012-12-05 00:37:02 +00:00
|
|
|
|
2012-11-13 08:11:49 +00:00
|
|
|
$(build-embed)/%.o: $(src)/%.cpp
|
|
|
|
@echo "compiling $(@)"
|
|
|
|
@mkdir -p $(dir $(@))
|
2012-12-05 22:30:49 +00:00
|
|
|
$(cxx) $(cflags) -c $(<) $(call output,$(@))
|
2012-12-05 00:37:02 +00:00
|
|
|
|
2012-11-13 08:11:49 +00:00
|
|
|
$(embed-loader-o): $(embed-loader) $(converter)
|
|
|
|
@mkdir -p $(dir $(@))
|
|
|
|
$(converter) $(<) $(@) _binary_loader_start \
|
|
|
|
_binary_loader_end $(target-format) $(arch)
|
|
|
|
|
2013-04-02 08:37:20 +00:00
|
|
|
$(embed-loader): $(embed-loader-objects) $(vm-objects) $(classpath-objects) \
|
2013-03-14 21:33:05 +00:00
|
|
|
$(heapwalk-objects) $(lzma-decode-objects)
|
2013-01-28 15:20:52 +00:00
|
|
|
ifdef ms_cl_compiler
|
2013-03-01 21:52:27 +00:00
|
|
|
$(ld) $(lflags) $(^) -out:$(@) \
|
2013-01-30 08:42:05 +00:00
|
|
|
-debug -PDB:$(subst $(exe-suffix),.pdb,$(@)) $(manifest-flags)
|
2013-01-28 15:20:52 +00:00
|
|
|
ifdef mt
|
|
|
|
$(mt) -nologo -manifest $(@).manifest -outputresource:"$(@);1"
|
|
|
|
endif
|
2012-12-05 22:30:49 +00:00
|
|
|
else
|
2013-03-01 21:52:27 +00:00
|
|
|
$(dlltool) -z $(addsuffix .def,$(basename $(@))) $(^)
|
2014-11-26 01:36:34 +00:00
|
|
|
$(dlltool) -d $(addsuffix .def,$(basename $(@))) -e $(addsuffix .exp,$(basename $(@)))
|
2013-03-01 21:52:27 +00:00
|
|
|
$(ld) $(addsuffix .exp,$(basename $(@))) $(^) \
|
2015-06-02 21:01:03 +00:00
|
|
|
$(lflags) $(classpath-lflags) $(bootimage-lflags) -o $(@)
|
2012-12-05 22:30:49 +00:00
|
|
|
endif
|
|
|
|
$(strip) $(strip-all) $(@)
|
2012-11-13 08:11:49 +00:00
|
|
|
|
|
|
|
$(build-embed-loader)/%.o: $(src)/%.cpp
|
|
|
|
@echo "compiling $(@)"
|
|
|
|
@mkdir -p $(dir $(@))
|
2012-12-05 22:30:49 +00:00
|
|
|
$(cxx) $(cflags) -c $(<) $(call output,$(@))
|
2012-11-13 08:11:49 +00:00
|
|
|
endif
|
|
|
|
|
2012-06-02 15:06:22 +00:00
|
|
|
$(build)/%.o: $(lzma)/C/%.c
|
2012-06-03 00:56:07 +00:00
|
|
|
@echo "compiling $(@)"
|
|
|
|
@mkdir -p $(dir $(@))
|
2014-07-28 20:26:33 +00:00
|
|
|
$(cc) $(lzma-cflags) -c $$($(windows-path) $(<)) $(call output,$(@))
|
2012-06-02 15:06:22 +00:00
|
|
|
|
2013-01-28 15:20:52 +00:00
|
|
|
$(vm-asm-objects): $(build)/%-asm.o: $(src)/%.$(asm-format)
|
2008-11-11 15:20:49 +00:00
|
|
|
$(compile-asm-object)
|
2007-06-29 17:45:14 +00:00
|
|
|
|
2010-09-17 22:03:37 +00:00
|
|
|
$(bootimage-generator-objects): $(build)/%.o: $(src)/%.cpp $(vm-depends)
|
2008-11-21 23:20:35 +00:00
|
|
|
$(compile-object)
|
|
|
|
|
2010-09-17 22:03:37 +00:00
|
|
|
$(heapwalk-objects): $(build)/%.o: $(src)/%.cpp $(vm-depends)
|
2008-11-21 23:20:35 +00:00
|
|
|
$(compile-object)
|
|
|
|
|
2008-03-31 03:43:43 +00:00
|
|
|
$(driver-object): $(driver-source)
|
|
|
|
$(compile-object)
|
|
|
|
|
2010-11-27 21:46:07 +00:00
|
|
|
$(build)/main-dynamic.o: $(driver-source)
|
2008-03-31 03:43:43 +00:00
|
|
|
@echo "compiling $(@)"
|
|
|
|
@mkdir -p $(dir $(@))
|
2010-09-10 21:05:29 +00:00
|
|
|
$(cxx) $(cflags) -DBOOT_LIBRARY=\"$(so-prefix)jvm$(so-suffix)\" \
|
2009-08-27 15:30:34 +00:00
|
|
|
-c $(<) $(call output,$(@))
|
2008-03-31 03:43:43 +00:00
|
|
|
|
|
|
|
$(boot-object): $(boot-source)
|
2007-07-16 01:03:02 +00:00
|
|
|
$(compile-object)
|
2007-06-03 23:16:07 +00:00
|
|
|
|
2010-12-06 00:40:50 +00:00
|
|
|
$(boot-javahome-object): $(src)/boot-javahome.cpp
|
|
|
|
$(compile-object)
|
|
|
|
|
2013-02-20 03:23:11 +00:00
|
|
|
$(object-writer-objects) $(binary-to-object-objects): $(build)/%.o: $(src)/%.cpp $(binary-to-object-depends) $(object-writer-depends) $(all-depends)
|
2012-04-25 15:09:26 +00:00
|
|
|
@mkdir -p $(dir $(@))
|
|
|
|
$(build-cxx) $(converter-cflags) -c $(<) -o $(@)
|
2009-10-14 01:00:16 +00:00
|
|
|
|
2012-05-01 19:16:32 +00:00
|
|
|
$(converter): $(converter-objects) $(converter-tool-objects)
|
2013-02-20 03:23:11 +00:00
|
|
|
@mkdir -p $(dir $(@))
|
2012-04-27 18:08:44 +00:00
|
|
|
$(build-cc) $(^) -g -o $(@)
|
2009-10-14 01:00:16 +00:00
|
|
|
|
2012-06-02 15:06:22 +00:00
|
|
|
$(lzma-encoder-objects): $(build)/lzma/%.o: $(src)/lzma/%.cpp
|
|
|
|
@mkdir -p $(dir $(@))
|
2014-07-28 20:26:33 +00:00
|
|
|
$(build-cxx) $(lzma-build-cflags) -c $(<) -o $(@)
|
2012-06-02 15:06:22 +00:00
|
|
|
|
|
|
|
$(lzma-encoder): $(lzma-encoder-objects) $(lzma-encoder-lzma-objects)
|
|
|
|
$(build-cc) $(^) -g -o $(@)
|
|
|
|
|
2015-04-07 22:55:45 +00:00
|
|
|
$(lzma-library): $(lzma-loader) $(lzma-decode-objects)
|
|
|
|
@echo "creating $(@)"
|
|
|
|
@rm -rf $(build)/libavian-lzma
|
|
|
|
@mkdir -p $(build)/libavian-lzma
|
|
|
|
rm -rf $(@)
|
|
|
|
for x in $(^); \
|
|
|
|
do cp $${x} $(build)/libavian-lzma/$$(echo $${x} | sed s:/:_:g); \
|
|
|
|
done
|
|
|
|
ifdef ms_cl_compiler
|
|
|
|
$(ar) $(arflags) $(build)/libavian-lzma/*.o -out:$(@)
|
|
|
|
else
|
|
|
|
$(ar) cru $(@) $(build)/libavian-lzma/*.o
|
|
|
|
$(ranlib) $(@)
|
|
|
|
endif
|
|
|
|
|
2012-06-02 15:06:22 +00:00
|
|
|
$(lzma-loader): $(src)/lzma/load.cpp
|
|
|
|
$(compile-object)
|
|
|
|
|
2010-11-05 19:18:28 +00:00
|
|
|
$(build)/classpath.jar: $(classpath-dep) $(classpath-jar-dep)
|
|
|
|
@echo "creating $(@)"
|
|
|
|
(wd=$$(pwd) && \
|
|
|
|
cd $(classpath-build) && \
|
|
|
|
$(jar) c0f "$$($(native-path) "$${wd}/$(@)")" .)
|
|
|
|
|
2009-10-14 01:00:16 +00:00
|
|
|
$(classpath-object): $(build)/classpath.jar $(converter)
|
2008-03-31 04:23:51 +00:00
|
|
|
@echo "creating $(@)"
|
2009-10-14 01:00:16 +00:00
|
|
|
$(converter) $(<) $(@) _binary_classpath_jar_start \
|
2012-08-02 18:15:15 +00:00
|
|
|
_binary_classpath_jar_end $(target-format) $(arch)
|
2007-10-25 22:06:05 +00:00
|
|
|
|
2010-11-15 23:27:00 +00:00
|
|
|
$(build)/javahome.jar:
|
2010-11-05 19:18:28 +00:00
|
|
|
@echo "creating $(@)"
|
|
|
|
(wd=$$(pwd) && \
|
2010-11-15 23:27:00 +00:00
|
|
|
cd "$(build-javahome)" && \
|
2010-11-05 19:18:28 +00:00
|
|
|
$(jar) c0f "$$($(native-path) "$${wd}/$(@)")" $(javahome-files))
|
|
|
|
|
|
|
|
$(javahome-object): $(build)/javahome.jar $(converter)
|
|
|
|
@echo "creating $(@)"
|
|
|
|
$(converter) $(<) $(@) _binary_javahome_jar_start \
|
2012-08-02 18:15:15 +00:00
|
|
|
_binary_javahome_jar_end $(target-format) $(arch)
|
2010-11-05 19:18:28 +00:00
|
|
|
|
2012-06-02 15:06:22 +00:00
|
|
|
define compile-generator-object
|
2007-10-22 20:56:27 +00:00
|
|
|
@echo "compiling $(@)"
|
2007-10-28 01:54:30 +00:00
|
|
|
@mkdir -p $(dir $(@))
|
2007-11-04 21:15:28 +00:00
|
|
|
$(build-cxx) -DPOINTER_SIZE=$(pointer-size) -O0 -g3 $(build-cflags) \
|
|
|
|
-c $(<) -o $(@)
|
2012-06-02 15:06:22 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
$(generator-objects): $(generator-depends)
|
|
|
|
$(generator-objects): $(build)/%-build.o: $(src)/%.cpp
|
|
|
|
$(compile-generator-object)
|
|
|
|
|
2012-06-02 21:43:42 +00:00
|
|
|
$(build)/%-build.o: $(lzma)/C/%.c
|
2012-06-03 00:56:07 +00:00
|
|
|
@echo "compiling $(@)"
|
|
|
|
@mkdir -p $(dir $(@))
|
2014-07-28 20:26:33 +00:00
|
|
|
$(build-cc) -DPOINTER_SIZE=$(pointer-size) -O0 -g3 $(lzma-build-cflags) \
|
|
|
|
-c $(<) -o $(@)
|
2007-06-03 23:16:07 +00:00
|
|
|
|
2014-09-24 19:15:41 +00:00
|
|
|
$(jni-objects): $(build)/%.o: $(classpath-src)/%.cpp $(vm-depends)
|
2008-01-25 23:45:52 +00:00
|
|
|
$(compile-object)
|
2007-06-25 01:34:07 +00:00
|
|
|
|
2010-12-06 00:40:50 +00:00
|
|
|
$(static-library): $(vm-objects) $(classpath-objects) $(vm-heapwalk-objects) \
|
2012-06-02 15:06:22 +00:00
|
|
|
$(javahome-object) $(boot-javahome-object) $(lzma-decode-objects)
|
2007-10-23 23:23:55 +00:00
|
|
|
@echo "creating $(@)"
|
2013-03-04 21:24:41 +00:00
|
|
|
@rm -rf $(build)/libavian
|
|
|
|
@mkdir -p $(build)/libavian
|
2007-10-26 21:02:39 +00:00
|
|
|
rm -rf $(@)
|
2013-03-04 21:42:18 +00:00
|
|
|
for x in $(^); \
|
|
|
|
do cp $${x} $(build)/libavian/$$(echo $${x} | sed s:/:_:g); \
|
2013-03-04 21:24:41 +00:00
|
|
|
done
|
2013-01-28 15:20:52 +00:00
|
|
|
ifdef ms_cl_compiler
|
2013-03-04 21:24:41 +00:00
|
|
|
$(ar) $(arflags) $(build)/libavian/*.o -out:$(@)
|
2013-01-28 15:20:52 +00:00
|
|
|
else
|
2013-03-04 21:24:41 +00:00
|
|
|
$(ar) cru $(@) $(build)/libavian/*.o
|
2007-10-23 23:23:55 +00:00
|
|
|
$(ranlib) $(@)
|
2013-01-28 15:20:52 +00:00
|
|
|
endif
|
2007-10-23 23:23:55 +00:00
|
|
|
|
2013-01-27 01:01:34 +00:00
|
|
|
$(bootimage-object) $(codeimage-object): $(bootimage-generator) \
|
2015-10-19 21:10:53 +00:00
|
|
|
$(classpath-jar-dep) $(test-dep)
|
2013-01-28 17:15:29 +00:00
|
|
|
@echo "generating bootimage and codeimage binaries from $(classpath-build) using $(<)"
|
2015-10-19 21:10:53 +00:00
|
|
|
$(<) -cp $(bootimage-classpath) -bootimage $(bootimage-object) -codeimage $(codeimage-object) \
|
2013-01-28 15:20:52 +00:00
|
|
|
-bootimage-symbols $(bootimage-symbols) \
|
support AOT-compilation of Java 8 lambda expressions
These expressions are tricky because they rely on invokedynamic, which
normally implies runtime code generation. However, since lambdas
don't actually use the "dynamicness" of invokedynamic, we can convert
them into static calls to synthetic classes at compile time.
Since I had already written code to synthesize such classes in Java
and I didn't want to rewrite it in C++, I needed to add support for
running Java code to the bootimage generator. And since the primary
VM used by the generator is purpose-built to generate AOT-compiled
code for a specific target architecture and is not capable of
generating or running JIT-compiled code for the host architecture, I
added support for loading a second, independent, host-specific VM for
running Java code.
The rest of the patch handles the fact that each method compilation
might cause new, synthetic classes to be created, so we need to make
sure those classes and their methods are included in the final heap
and code images. This required breaking some giant code blocks out of
makeCodeImage into their own methods, which makes the diff look
scarier than it really is.
2015-09-13 02:15:46 +00:00
|
|
|
-codeimage-symbols $(codeimage-symbols) \
|
|
|
|
-hostvm $(host-vm)
|
2011-09-20 22:30:30 +00:00
|
|
|
|
2010-11-04 17:02:09 +00:00
|
|
|
executable-objects = $(vm-objects) $(classpath-objects) $(driver-object) \
|
2011-09-20 22:30:30 +00:00
|
|
|
$(vm-heapwalk-objects) $(boot-object) $(vm-classpath-objects) \
|
2012-06-02 15:06:22 +00:00
|
|
|
$(javahome-object) $(boot-javahome-object) $(lzma-decode-objects)
|
2010-10-23 00:20:19 +00:00
|
|
|
|
2013-02-20 17:22:40 +00:00
|
|
|
unittest-executable-objects = $(unittest-objects) $(vm-objects) \
|
2014-07-16 20:18:42 +00:00
|
|
|
$(vm-heapwalk-objects) $(build)/util/arg-parser.o $(stub-objects) \
|
|
|
|
$(lzma-decode-objects)
|
2013-02-15 03:54:20 +00:00
|
|
|
|
2013-02-16 03:44:55 +00:00
|
|
|
ifeq ($(process),interpret)
|
|
|
|
unittest-executable-objects += $(all-codegen-target-objects)
|
|
|
|
endif
|
|
|
|
|
2013-02-18 14:50:37 +00:00
|
|
|
# apparently, make does poorly with ifs inside of defines, and indented defines.
|
|
|
|
# I suggest re-indenting the following before making edits (and unindenting afterwards):
|
|
|
|
ifneq ($(platform),windows)
|
|
|
|
define link-executable
|
|
|
|
@echo linking $(@)
|
2013-03-04 21:24:41 +00:00
|
|
|
$(ld) $(^) $(rdynamic) $(lflags) $(classpath-lflags) $(bootimage-lflags) \
|
|
|
|
-o $(@)
|
2013-02-18 14:50:37 +00:00
|
|
|
endef
|
|
|
|
else
|
2013-01-28 15:20:52 +00:00
|
|
|
ifdef ms_cl_compiler
|
|
|
|
ifdef mt
|
2013-02-18 14:50:37 +00:00
|
|
|
define link-executable
|
|
|
|
@echo linking $(@)
|
|
|
|
$(ld) $(lflags) $(^) -out:$(@) \
|
|
|
|
-debug -PDB:$(subst $(exe-suffix),.pdb,$(@)) $(manifest-flags)
|
2013-01-28 15:20:52 +00:00
|
|
|
$(mt) -nologo -manifest $(@).manifest -outputresource:"$(@);1"
|
2013-02-18 14:50:37 +00:00
|
|
|
endef
|
|
|
|
else
|
|
|
|
define link-executable
|
|
|
|
@echo linking $(@)
|
2013-01-28 15:20:52 +00:00
|
|
|
$(mt) -nologo -manifest $(@).manifest -outputresource:"$(@);1"
|
2013-02-18 14:50:37 +00:00
|
|
|
endef
|
2013-01-28 15:20:52 +00:00
|
|
|
endif
|
2009-08-27 00:26:44 +00:00
|
|
|
else
|
2013-02-18 14:50:37 +00:00
|
|
|
define link-executable
|
|
|
|
@echo linking $(@)
|
|
|
|
$(dlltool) -z $(@).def $(^)
|
2008-11-11 15:20:49 +00:00
|
|
|
$(dlltool) -d $(@).def -e $(@).exp
|
2013-03-14 21:33:05 +00:00
|
|
|
$(ld) $(@).exp $(^) $(lflags) $(classpath-lflags) -o $(@)
|
2013-02-18 14:50:37 +00:00
|
|
|
endef
|
2009-08-27 00:26:44 +00:00
|
|
|
endif
|
2007-10-26 21:02:39 +00:00
|
|
|
endif
|
2007-06-03 23:16:07 +00:00
|
|
|
|
2013-02-18 14:50:37 +00:00
|
|
|
$(executable): $(executable-objects)
|
|
|
|
$(link-executable)
|
2013-02-15 03:54:20 +00:00
|
|
|
|
|
|
|
$(unittest-executable): $(unittest-executable-objects)
|
2013-02-18 14:50:37 +00:00
|
|
|
$(link-executable)
|
|
|
|
|
2013-03-15 19:16:20 +00:00
|
|
|
$(bootimage-generator): $(bootimage-generator-objects) $(vm-objects)
|
2013-01-28 17:15:29 +00:00
|
|
|
echo building $(bootimage-generator) arch=$(build-arch) platform=$(bootimage-platform)
|
2016-08-12 17:30:09 +00:00
|
|
|
$(MAKE) process=interpret \
|
|
|
|
bootimage= \
|
|
|
|
bootimage-test= \
|
|
|
|
mode=$(mode) \
|
|
|
|
platform=$(bootimage-platform) \
|
|
|
|
arch=$(build-arch)
|
2009-09-06 00:26:13 +00:00
|
|
|
$(MAKE) mode=$(mode) \
|
2013-01-28 17:15:29 +00:00
|
|
|
build=$(host-build-root) \
|
2008-12-05 00:24:38 +00:00
|
|
|
arch=$(build-arch) \
|
2013-01-30 05:31:02 +00:00
|
|
|
aot-only=false \
|
2012-05-01 19:16:32 +00:00
|
|
|
target-arch=$(arch) \
|
2014-01-10 21:38:57 +00:00
|
|
|
armv6=$(armv6) \
|
2009-06-01 18:12:29 +00:00
|
|
|
platform=$(bootimage-platform) \
|
2012-08-02 18:15:15 +00:00
|
|
|
target-format=$(target-format) \
|
2014-07-12 22:03:11 +00:00
|
|
|
android=$(android) \
|
2010-11-26 19:41:31 +00:00
|
|
|
openjdk=$(openjdk) \
|
|
|
|
openjdk-src=$(openjdk-src) \
|
2008-12-05 00:24:38 +00:00
|
|
|
bootimage-generator= \
|
|
|
|
build-bootimage-generator=$(bootimage-generator) \
|
2011-09-01 03:18:00 +00:00
|
|
|
target-cflags="$(bootimage-cflags)" \
|
|
|
|
target-asm=$(asm) \
|
2009-09-06 00:26:13 +00:00
|
|
|
$(bootimage-generator)
|
2008-12-05 00:24:38 +00:00
|
|
|
|
|
|
|
$(build-bootimage-generator): \
|
2013-03-04 21:24:41 +00:00
|
|
|
$(vm-objects) $(classpath-object) \
|
2012-06-02 15:06:22 +00:00
|
|
|
$(heapwalk-objects) $(bootimage-generator-objects) $(converter-objects) \
|
|
|
|
$(lzma-decode-objects) $(lzma-encode-objects)
|
2007-06-03 23:16:07 +00:00
|
|
|
@echo "linking $(@)"
|
2007-10-26 21:02:39 +00:00
|
|
|
ifeq ($(platform),windows)
|
2013-01-28 15:20:52 +00:00
|
|
|
ifdef ms_cl_compiler
|
2013-01-30 08:42:05 +00:00
|
|
|
$(ld) $(bootimage-generator-lflags) $(lflags) $(^) -out:$(@) \
|
|
|
|
-debug -PDB:$(subst $(exe-suffix),.pdb,$(@)) $(manifest-flags)
|
2013-01-28 15:20:52 +00:00
|
|
|
ifdef mt
|
|
|
|
$(mt) -nologo -manifest $(@).manifest -outputresource:"$(@);1"
|
|
|
|
endif
|
2009-08-27 00:26:44 +00:00
|
|
|
else
|
2007-10-26 21:02:39 +00:00
|
|
|
$(dlltool) -z $(@).def $(^)
|
2008-10-10 23:37:36 +00:00
|
|
|
$(dlltool) -d $(@).def -e $(@).exp
|
2013-01-28 15:20:52 +00:00
|
|
|
$(ld) $(@).exp $(^) $(bootimage-generator-lflags) $(lflags) -o $(@)
|
2009-08-27 00:26:44 +00:00
|
|
|
endif
|
2007-10-26 21:02:39 +00:00
|
|
|
else
|
2013-01-28 15:20:52 +00:00
|
|
|
$(ld) $(^) $(rdynamic) $(bootimage-generator-lflags) $(lflags) -o $(@)
|
2007-10-26 21:02:39 +00:00
|
|
|
endif
|
2007-06-03 23:16:07 +00:00
|
|
|
|
2010-11-05 19:18:28 +00:00
|
|
|
$(dynamic-library): $(vm-objects) $(dynamic-object) $(classpath-objects) \
|
2011-09-20 22:30:30 +00:00
|
|
|
$(vm-heapwalk-objects) $(boot-object) $(vm-classpath-objects) \
|
2012-06-02 15:06:22 +00:00
|
|
|
$(classpath-libraries) $(javahome-object) $(boot-javahome-object) \
|
|
|
|
$(lzma-decode-objects)
|
2008-03-31 03:43:43 +00:00
|
|
|
@echo "linking $(@)"
|
2013-01-28 15:20:52 +00:00
|
|
|
ifdef ms_cl_compiler
|
2013-01-30 08:42:05 +00:00
|
|
|
$(ld) $(shared) $(lflags) $(^) -out:$(@) \
|
|
|
|
-debug -PDB:$(subst $(so-suffix),.pdb,$(@)) \
|
|
|
|
-IMPLIB:$(subst $(so-suffix),.lib,$(@)) $(manifest-flags)
|
2013-01-28 15:20:52 +00:00
|
|
|
ifdef mt
|
|
|
|
$(mt) -nologo -manifest $(@).manifest -outputresource:"$(@);2"
|
|
|
|
endif
|
2009-08-27 00:26:44 +00:00
|
|
|
else
|
2012-09-05 08:29:12 +00:00
|
|
|
$(ld) $(^) $(version-script-flag) $(soname-flag) \
|
2013-03-04 21:24:41 +00:00
|
|
|
$(shared) $(lflags) $(classpath-lflags) $(bootimage-lflags) \
|
2010-11-08 04:23:25 +00:00
|
|
|
-o $(@)
|
2009-08-27 00:26:44 +00:00
|
|
|
endif
|
2008-03-31 04:23:51 +00:00
|
|
|
$(strip) $(strip-all) $(@)
|
2008-03-31 03:43:43 +00:00
|
|
|
|
2011-11-20 02:26:25 +00:00
|
|
|
# todo: the $(no-lto) flag below is due to odd undefined reference errors on
|
|
|
|
# Ubuntu 11.10 which may be fixable without disabling LTO.
|
2010-11-27 21:46:07 +00:00
|
|
|
$(executable-dynamic): $(driver-dynamic-objects) $(dynamic-library)
|
2008-03-31 03:43:43 +00:00
|
|
|
@echo "linking $(@)"
|
2013-01-28 15:20:52 +00:00
|
|
|
ifdef ms_cl_compiler
|
2010-09-17 22:03:37 +00:00
|
|
|
$(ld) $(lflags) -LIBPATH:$(build) -DEFAULTLIB:$(name) \
|
2013-03-04 18:09:59 +00:00
|
|
|
-debug -PDB:$(subst $(exe-suffix),.pdb,$(@)) \
|
2013-01-30 08:42:05 +00:00
|
|
|
$(driver-dynamic-objects) -out:$(@) $(manifest-flags)
|
2013-01-28 15:20:52 +00:00
|
|
|
ifdef mt
|
|
|
|
$(mt) -nologo -manifest $(@).manifest -outputresource:"$(@);1"
|
|
|
|
endif
|
2009-08-27 00:26:44 +00:00
|
|
|
else
|
2013-02-12 16:27:47 +00:00
|
|
|
$(ld) $(driver-dynamic-objects) -L$(build) -ljvm $(lflags) $(no-lto) $(rpath) -o $(@)
|
2009-08-27 00:26:44 +00:00
|
|
|
endif
|
2008-03-31 03:43:43 +00:00
|
|
|
$(strip) $(strip-all) $(@)
|
|
|
|
|
2012-06-02 15:06:22 +00:00
|
|
|
$(generator): $(generator-objects) $(generator-lzma-objects)
|
2007-10-25 22:06:05 +00:00
|
|
|
@echo "linking $(@)"
|
2014-07-14 15:37:37 +00:00
|
|
|
$(build-ld-cpp) $(^) $(build-lflags) $(static-on-windows) -o $(@)
|
2010-11-04 17:02:09 +00:00
|
|
|
|
2011-04-14 22:12:12 +00:00
|
|
|
$(openjdk-objects): $(build)/openjdk/%-openjdk.o: $(openjdk-src)/%.c \
|
2010-11-04 17:02:09 +00:00
|
|
|
$(openjdk-headers-dep)
|
|
|
|
@echo "compiling $(@)"
|
|
|
|
@mkdir -p $(dir $(@))
|
2010-12-02 03:05:22 +00:00
|
|
|
sed 's/^static jclass ia_class;//' < $(<) > $(build)/openjdk/$(notdir $(<))
|
2014-06-22 18:30:52 +00:00
|
|
|
ifeq ($(platform),ios)
|
2012-03-11 23:46:36 +00:00
|
|
|
sed \
|
|
|
|
-e 's/^#ifndef __APPLE__/#if 1/' \
|
|
|
|
-e 's/^#ifdef __APPLE__/#if 0/' \
|
|
|
|
< "$(openjdk-src)/solaris/native/java/lang/ProcessEnvironment_md.c" \
|
|
|
|
> $(build)/openjdk/ProcessEnvironment_md.c
|
|
|
|
sed \
|
|
|
|
-e 's/^#ifndef __APPLE__/#if 1/' \
|
|
|
|
-e 's/^#ifdef __APPLE__/#if 0/' \
|
|
|
|
< "$(openjdk-src)/solaris/native/java/lang/UNIXProcess_md.c" \
|
|
|
|
> $(build)/openjdk/UNIXProcess_md.c
|
2014-07-24 17:20:17 +00:00
|
|
|
if [ -e "$(openjdk-src)/solaris/native/java/lang/childproc.h" ]; then \
|
|
|
|
sed \
|
|
|
|
-e 's/^#ifndef __APPLE__/#if 1/' \
|
|
|
|
-e 's/^#ifdef __APPLE__/#if 0/' \
|
|
|
|
< "$(openjdk-src)/solaris/native/java/lang/childproc.h" \
|
|
|
|
> $(build)/openjdk/childproc.h; \
|
|
|
|
fi
|
2016-01-13 00:37:03 +00:00
|
|
|
endif
|
|
|
|
ifneq (7,$(openjdk-version))
|
|
|
|
if [ -f openjdk-patches/$(notdir $(<)).8.patch ]; then \
|
|
|
|
( cd $(build) && patch -p0 ) < openjdk-patches/$(notdir $(<)).8.patch; \
|
|
|
|
fi
|
2016-01-13 17:28:07 +00:00
|
|
|
if [ -f openjdk-patches/$(notdir $(<)).8.$(platform).patch ]; then \
|
|
|
|
( cd $(build) && patch -p0 ) < openjdk-patches/$(notdir $(<)).8.$(platform).patch; \
|
|
|
|
fi
|
2012-03-11 23:46:36 +00:00
|
|
|
endif
|
2013-12-08 01:49:23 +00:00
|
|
|
if [ -f openjdk-patches/$(notdir $(<)).patch ]; then \
|
|
|
|
( cd $(build) && patch -p0 ) < openjdk-patches/$(notdir $(<)).patch; \
|
|
|
|
fi
|
2010-11-15 23:27:00 +00:00
|
|
|
$(cc) -fPIC $(openjdk-extra-cflags) $(openjdk-cflags) \
|
2010-12-02 03:05:22 +00:00
|
|
|
$(optimization-cflags) -w -c $(build)/openjdk/$(notdir $(<)) \
|
2013-12-07 23:38:00 +00:00
|
|
|
$(call output,$(@)) -Wno-return-type
|
2010-11-04 17:02:09 +00:00
|
|
|
|
2011-04-14 22:12:12 +00:00
|
|
|
$(openjdk-local-objects): $(build)/openjdk/%-openjdk.o: $(src)/openjdk/%.c \
|
2010-11-27 18:25:02 +00:00
|
|
|
$(openjdk-headers-dep)
|
|
|
|
@echo "compiling $(@)"
|
|
|
|
@mkdir -p $(dir $(@))
|
|
|
|
$(cc) -fPIC $(openjdk-extra-cflags) $(openjdk-cflags) \
|
|
|
|
$(optimization-cflags) -w -c $(<) $(call output,$(@))
|
|
|
|
|
2010-11-15 23:27:00 +00:00
|
|
|
$(openjdk-headers-dep):
|
2010-11-04 17:02:09 +00:00
|
|
|
@echo "generating openjdk headers"
|
|
|
|
@mkdir -p $(dir $(@))
|
|
|
|
$(javah) -d $(build)/openjdk -bootclasspath $(boot-classpath) \
|
|
|
|
$(openjdk-headers-classes)
|
2010-11-30 00:39:41 +00:00
|
|
|
ifeq ($(platform),windows)
|
|
|
|
sed 's/^#ifdef _WIN64/#if 1/' \
|
|
|
|
< "$(openjdk-src)/windows/native/java/net/net_util_md.h" \
|
|
|
|
> $(build)/openjdk/net_util_md.h
|
2011-07-12 22:58:51 +00:00
|
|
|
sed \
|
2011-09-17 00:42:18 +00:00
|
|
|
-e 's/\(^#include "net_util.h"\)/\1\n#if (defined _INC_NLDEF) || (defined _WS2DEF_)\n#define HIDE(x) hide_##x\n#else\n#define HIDE(x) x\n#define _WINSOCK2API_\n#endif/' \
|
|
|
|
-e 's/\(IpPrefix[a-zA-Z_]*\)/HIDE(\1)/' \
|
|
|
|
-e 's/\(IpSuffix[a-zA-Z_]*\)/HIDE(\1)/' \
|
|
|
|
-e 's/\(IpDad[a-zA-Z_]*\)/HIDE(\1)/' \
|
|
|
|
-e 's/\(ScopeLevel[a-zA-Z_]*\)/HIDE(\1)/' \
|
|
|
|
-e 's/\(SCOPE_LEVEL[a-zA-Z_]*\)/HIDE(\1)/' \
|
2011-07-12 22:58:51 +00:00
|
|
|
< "$(openjdk-src)/windows/native/java/net/NetworkInterface.h" \
|
|
|
|
> $(build)/openjdk/NetworkInterface.h
|
2010-12-02 03:05:22 +00:00
|
|
|
echo 'static int getAddrsFromAdapter(IP_ADAPTER_ADDRESSES *ptr, netaddr **netaddrPP);' >> $(build)/openjdk/NetworkInterface.h
|
2012-03-11 23:46:36 +00:00
|
|
|
endif
|
2013-12-07 23:38:00 +00:00
|
|
|
|
2016-11-07 02:16:11 +00:00
|
|
|
ifeq ($(kernel),darwin)
|
2012-03-11 23:46:36 +00:00
|
|
|
mkdir -p $(build)/openjdk/netinet
|
|
|
|
for file in \
|
2016-08-12 16:05:37 +00:00
|
|
|
$(header-sysroot)/usr/include/netinet/ip.h \
|
|
|
|
$(header-sysroot)/usr/include/netinet/in_systm.h \
|
|
|
|
$(header-sysroot)/usr/include/netinet/ip_icmp.h \
|
|
|
|
$(header-sysroot)/usr/include/netinet/in_var.h \
|
|
|
|
$(header-sysroot)/usr/include/netinet/icmp6.h \
|
|
|
|
$(header-sysroot)/usr/include/netinet/ip_var.h; do \
|
2012-03-11 23:46:36 +00:00
|
|
|
if [ ! -f "$(build)/openjdk/netinet/$$(basename $${file})" ]; then \
|
2017-07-10 16:01:56 +00:00
|
|
|
ln -s "$${file}" "$(build)/openjdk/netinet/$$(basename $${file})"; \
|
2012-03-11 23:46:36 +00:00
|
|
|
fi; \
|
|
|
|
done
|
|
|
|
mkdir -p $(build)/openjdk/netinet6
|
|
|
|
for file in \
|
2016-08-12 16:05:37 +00:00
|
|
|
$(header-sysroot)/usr/include/netinet6/in6_var.h; do \
|
2012-03-11 23:46:36 +00:00
|
|
|
if [ ! -f "$(build)/openjdk/netinet6/$$(basename $${file})" ]; then \
|
2017-07-10 16:01:56 +00:00
|
|
|
ln -s "$${file}" "$(build)/openjdk/netinet6/$$(basename $${file})"; \
|
2012-03-11 23:46:36 +00:00
|
|
|
fi; \
|
|
|
|
done
|
|
|
|
mkdir -p $(build)/openjdk/net
|
|
|
|
for file in \
|
2016-08-12 16:05:37 +00:00
|
|
|
$(header-sysroot)/usr/include/net/if_arp.h; do \
|
2012-03-11 23:46:36 +00:00
|
|
|
if [ ! -f "$(build)/openjdk/net/$$(basename $${file})" ]; then \
|
2017-07-10 16:01:56 +00:00
|
|
|
ln -s "$${file}" "$(build)/openjdk/net/$$(basename $${file})"; \
|
2012-03-11 23:46:36 +00:00
|
|
|
fi; \
|
|
|
|
done
|
|
|
|
mkdir -p $(build)/openjdk/sys
|
|
|
|
for file in \
|
2016-08-12 16:05:37 +00:00
|
|
|
$(header-sysroot)/usr/include/sys/kern_event.h \
|
|
|
|
$(header-sysroot)/usr/include/sys/sys_domain.h; do \
|
2012-03-11 23:46:36 +00:00
|
|
|
if [ ! -f "$(build)/openjdk/sys/$$(basename $${file})" ]; then \
|
2017-07-10 16:01:56 +00:00
|
|
|
ln -s "$${file}" "$(build)/openjdk/sys/$$(basename $${file})"; \
|
2012-03-11 23:46:36 +00:00
|
|
|
fi; \
|
|
|
|
done
|
2010-11-30 00:39:41 +00:00
|
|
|
endif
|
2010-11-04 17:02:09 +00:00
|
|
|
@touch $(@)
|
|
|
|
|
2010-11-15 23:27:00 +00:00
|
|
|
$(openjdk-jar-dep):
|
2010-11-04 17:02:09 +00:00
|
|
|
@echo "extracting openjdk classes"
|
|
|
|
@mkdir -p $(dir $(@))
|
|
|
|
@mkdir -p $(classpath-build)
|
2010-11-15 23:27:00 +00:00
|
|
|
(cd $(classpath-build) && \
|
2017-07-19 12:29:47 +00:00
|
|
|
$(jar) xf "$$($(native-path) "$(openjdk-image)/lib/rt.jar")" && \
|
|
|
|
$(jar) xf "$$($(native-path) "$(openjdk-image)/lib/charsets.jar")" && \
|
|
|
|
$(jar) xf "$$($(native-path) "$(openjdk-image)/lib/resources.jar")" && \
|
|
|
|
$(jar) xf "$$($(native-path) "$(openjdk-image)/lib/ext/sunec.jar")")
|
2010-11-04 17:02:09 +00:00
|
|
|
@touch $(@)
|