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
|
2012-06-03 00:56:07 +00:00
|
|
|
version = 0.6
|
2008-01-19 00:54:36 +00:00
|
|
|
|
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/' \
|
2011-02-26 19:45:22 +00:00
|
|
|
| sed 's/^arm.*$$/arm/' \
|
|
|
|
| sed 's/ppc/powerpc/')
|
|
|
|
|
2009-02-15 19:51:39 +00:00
|
|
|
ifeq (Power,$(filter Power,$(build-arch)))
|
2008-06-04 22:21:27 +00:00
|
|
|
build-arch = powerpc
|
|
|
|
endif
|
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:] \
|
|
|
|
| sed 's/^mingw32.*$$/mingw32/' \
|
|
|
|
| sed 's/^cygwin.*$$/cygwin/')
|
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)
|
2009-06-01 18:12:29 +00:00
|
|
|
bootimage-platform = \
|
|
|
|
$(subst cygwin,windows,$(subst mingw32,windows,$(build-platform)))
|
|
|
|
platform = $(bootimage-platform)
|
2007-09-19 16:22:19 +00:00
|
|
|
|
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
|
|
|
|
endif
|
|
|
|
ifeq ($(heapdump),true)
|
|
|
|
options := $(options)-heapdump
|
|
|
|
endif
|
2009-05-26 05:27:10 +00:00
|
|
|
ifeq ($(tails),true)
|
|
|
|
options := $(options)-tails
|
|
|
|
endif
|
|
|
|
ifeq ($(continuations),true)
|
|
|
|
options := $(options)-continuations
|
|
|
|
endif
|
2010-09-10 21:05:29 +00:00
|
|
|
|
2010-09-20 23:31:23 +00:00
|
|
|
root := $(shell (cd .. && pwd))
|
|
|
|
build = build/$(platform)-$(arch)$(options)
|
|
|
|
classpath-build = $(build)/classpath
|
|
|
|
test-build = $(build)/test
|
|
|
|
src = src
|
|
|
|
classpath-src = classpath
|
|
|
|
test = test
|
2012-02-20 23:25:37 +00:00
|
|
|
win32 ?= $(root)/win32
|
|
|
|
win64 ?= $(root)/win64
|
2010-09-20 23:31:23 +00:00
|
|
|
|
2010-09-10 21:05:29 +00:00
|
|
|
classpath = avian
|
|
|
|
|
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
|
|
|
|
|
|
|
|
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 = :
|
|
|
|
|
|
|
|
ifneq (,$(filter mingw32 cygwin,$(build-platform)))
|
|
|
|
path-separator = ;
|
|
|
|
endif
|
|
|
|
|
2010-11-16 03:28:53 +00:00
|
|
|
library-path-variable = LD_LIBRARY_PATH
|
|
|
|
|
|
|
|
ifeq ($(build-platform),darwin)
|
|
|
|
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
|
|
|
|
2010-11-26 19:41:31 +00:00
|
|
|
ifneq ($(openjdk),)
|
2010-11-16 03:28:53 +00:00
|
|
|
openjdk-arch = $(arch)
|
|
|
|
ifeq ($(arch),x86_64)
|
|
|
|
openjdk-arch = amd64
|
|
|
|
endif
|
|
|
|
|
2010-11-26 19:41:31 +00:00
|
|
|
ifneq ($(openjdk-src),)
|
2010-11-04 17:02:09 +00:00
|
|
|
include openjdk-src.mk
|
|
|
|
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
|
2011-03-04 23:55:31 +00:00
|
|
|
javahome-files = lib/zi lib/currency.data lib/security/java.security \
|
2011-04-10 21:51:17 +00:00
|
|
|
lib/security/java.policy lib/security/cacerts
|
|
|
|
|
|
|
|
local-policy = lib/security/local_policy.jar
|
2011-07-12 22:58:51 +00:00
|
|
|
ifeq ($(shell test -e "$(openjdk)/$(local-policy)" && echo found),found)
|
2011-04-10 21:51:17 +00:00
|
|
|
javahome-files += $(local-policy)
|
|
|
|
endif
|
|
|
|
|
|
|
|
export-policy = lib/security/US_export_policy.jar
|
2011-07-12 22:58:51 +00:00
|
|
|
ifeq ($(shell test -e "$(openjdk)/$(export-policy)" && echo found),found)
|
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
|
2010-11-04 17:02:09 +00:00
|
|
|
else
|
|
|
|
options := $(options)-openjdk
|
2011-10-01 00:40:43 +00:00
|
|
|
test-executable = $(shell pwd)/$(executable-dynamic)
|
2012-03-16 17:01:20 +00:00
|
|
|
ifeq ($(build-platform),darwin)
|
|
|
|
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
|
|
|
|
|
2010-09-10 21:05: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
|
|
|
|
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
|
|
|
|
2012-06-01 23:43:42 +00:00
|
|
|
ifeq ($(use-clang),true)
|
2012-06-01 23:57:42 +00:00
|
|
|
build-cxx = clang -std=c++11
|
2012-06-01 23:43:42 +00:00
|
|
|
build-cc = clang
|
|
|
|
else
|
2012-08-02 16:40:49 +00:00
|
|
|
build-cxx = g++
|
|
|
|
build-cc = gcc
|
2012-06-01 23:43:42 +00:00
|
|
|
endif
|
2007-07-17 01:55:49 +00:00
|
|
|
|
2010-02-06 00:15:12 +00:00
|
|
|
mflag =
|
2010-02-05 23:40:48 +00:00
|
|
|
ifneq ($(platform),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
|
|
|
|
|
2010-02-06 00:15:12 +00:00
|
|
|
cxx = $(build-cxx) $(mflag)
|
|
|
|
cc = $(build-cc) $(mflag)
|
|
|
|
|
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
|
2008-11-11 15:20:49 +00:00
|
|
|
javac = "$(JAVA_HOME)/bin/javac"
|
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
|
|
|
|
|
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:
|
|
|
|
warnings = -Wall -Wextra -Werror -Wunused-parameter -Winit-self \
|
|
|
|
-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)
|
|
|
|
|
2012-08-01 16:02:55 +00:00
|
|
|
common-cflags = $(warnings) -fno-rtti -fno-exceptions -I$(classpath-src) \
|
2010-11-04 17:02:09 +00:00
|
|
|
"-I$(JAVA_HOME)/include" -idirafter $(src) -I$(build) $(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
|
|
|
|
2012-06-20 19:14:16 +00:00
|
|
|
asmflags = $(target-cflags)
|
|
|
|
|
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 \
|
2008-11-11 15:20:49 +00:00
|
|
|
"-I$(JAVA_HOME)/include/linux" -I$(src) -pthread
|
2007-10-26 14:34:54 +00:00
|
|
|
|
2012-05-01 19:16:32 +00:00
|
|
|
converter-cflags = -D__STDC_CONSTANT_MACROS -Isrc/binaryToObject -Isrc/ \
|
|
|
|
-fno-rtti -fno-exceptions \
|
|
|
|
-DAVIAN_TARGET_ARCH=AVIAN_ARCH_UNKNOWN \
|
2012-08-02 18:15:15 +00:00
|
|
|
-DAVIAN_TARGET_FORMAT=AVIAN_FORMAT_UNKNOWN \
|
2012-06-03 00:56:07 +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)
|
|
|
|
|
2010-09-10 21:05:29 +00:00
|
|
|
common-lflags = -lm -lz $(classpath-lflags)
|
2007-10-26 21:02:39 +00:00
|
|
|
|
2010-09-20 23:31:23 +00:00
|
|
|
build-lflags = -lz -lpthread -ldl
|
2008-11-11 15:20:49 +00:00
|
|
|
|
2008-03-31 03:43:43 +00:00
|
|
|
lflags = $(common-lflags) -lpthread -ldl
|
2007-10-26 14:34:54 +00:00
|
|
|
|
2012-09-05 08:29:12 +00:00
|
|
|
soname-flag = -Wl,-soname -Wl,$(so-prefix)jvm$(so-suffix)
|
2010-11-08 04:23:25 +00:00
|
|
|
version-script-flag = -Wl,--version-script=openjdk.ld
|
|
|
|
|
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
|
|
|
|
|
|
|
pointer-size = 8
|
|
|
|
|
2008-03-31 03:43:43 +00:00
|
|
|
so-prefix = lib
|
|
|
|
so-suffix = .so
|
|
|
|
|
|
|
|
shared = -shared
|
|
|
|
|
2012-06-04 15:51:11 +00:00
|
|
|
no-error = -Wno-error
|
|
|
|
|
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)
|
|
|
|
|
2012-03-07 15:55:01 +00:00
|
|
|
developer-dir := $(shell if test -d /Developer; then echo /Developer; \
|
|
|
|
else echo /Applications/Xcode.app/Contents/Developer; fi)
|
|
|
|
|
2011-08-30 01:00:17 +00:00
|
|
|
ifeq ($(build-arch),powerpc)
|
|
|
|
ifneq ($(arch),$(build-arch))
|
2011-09-01 03:18:00 +00:00
|
|
|
bootimage-cflags += -DTARGET_OPPOSITE_ENDIAN
|
2011-08-30 01:00:17 +00:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2012-05-02 20:52:19 +00:00
|
|
|
ifeq ($(arch),i386)
|
|
|
|
pointer-size = 4
|
|
|
|
endif
|
|
|
|
|
2008-06-04 22:21:27 +00:00
|
|
|
ifeq ($(arch),powerpc)
|
|
|
|
asm = powerpc
|
|
|
|
pointer-size = 4
|
2011-02-28 05:54:59 +00:00
|
|
|
|
2011-08-30 01:00:17 +00:00
|
|
|
ifneq ($(arch),$(build-arch))
|
2011-09-01 03:18:00 +00:00
|
|
|
bootimage-cflags += -DTARGET_OPPOSITE_ENDIAN
|
2011-08-30 01:00:17 +00:00
|
|
|
endif
|
|
|
|
|
2011-03-01 19:20:23 +00:00
|
|
|
ifneq ($(platform),darwin)
|
|
|
|
ifneq ($(arch),$(build-arch))
|
|
|
|
cxx = powerpc-linux-gnu-g++
|
|
|
|
cc = powerpc-linux-gnu-gcc
|
|
|
|
ar = powerpc-linux-gnu-ar
|
|
|
|
ranlib = powerpc-linux-gnu-ranlib
|
|
|
|
strip = powerpc-linux-gnu-strip
|
|
|
|
endif
|
2011-02-28 05:54:59 +00:00
|
|
|
endif
|
2008-06-04 22:21:27 +00:00
|
|
|
endif
|
2012-05-01 19:16:32 +00:00
|
|
|
|
2009-08-06 19:25:20 +00:00
|
|
|
ifeq ($(arch),arm)
|
2010-11-09 03:48:08 +00:00
|
|
|
asm = arm
|
|
|
|
pointer-size = 4
|
2012-05-01 19:16:32 +00:00
|
|
|
|
2011-09-22 22:55:45 +00:00
|
|
|
ifeq ($(build-platform),darwin)
|
|
|
|
ios = true
|
|
|
|
else
|
2012-01-15 17:02:36 +00:00
|
|
|
no-psabi = -Wno-psabi
|
|
|
|
cflags += -marm $(no-psabi)
|
2011-08-11 01:21:48 +00:00
|
|
|
endif
|
2010-11-09 18:28:58 +00:00
|
|
|
|
|
|
|
ifneq ($(arch),$(build-arch))
|
2011-08-11 01:21:48 +00:00
|
|
|
ifeq ($(platform),darwin)
|
2012-03-07 15:55:01 +00:00
|
|
|
ios-bin = $(developer-dir)/Platforms/iPhoneOS.platform/Developer/usr/bin
|
2012-10-03 19:36:51 +00:00
|
|
|
ifeq ($(use-clang),true)
|
|
|
|
cxx = clang -std=c++11
|
|
|
|
cc = clang
|
|
|
|
else
|
|
|
|
cxx = $(ios-bin)/g++
|
|
|
|
cc = $(ios-bin)/gcc
|
|
|
|
endif
|
2011-08-11 01:21:48 +00:00
|
|
|
ar = $(ios-bin)/ar
|
|
|
|
ranlib = $(ios-bin)/ranlib
|
|
|
|
strip = $(ios-bin)/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
|
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
|
|
|
|
2011-09-22 22:55:45 +00:00
|
|
|
ifeq ($(ios),true)
|
|
|
|
cflags += -DAVIAN_IOS
|
|
|
|
endif
|
2011-08-30 01:07:42 +00:00
|
|
|
|
2011-08-23 23:04:04 +00:00
|
|
|
ifeq ($(build-platform),darwin)
|
|
|
|
build-cflags = $(common-cflags) -fPIC -fvisibility=hidden -I$(src)
|
2012-10-03 19:36:51 +00:00
|
|
|
cflags += -I/System/Library/Frameworks/JavaVM.framework/Headers/ \
|
|
|
|
-Wno-deprecated-declarations
|
2011-08-23 23:04:04 +00:00
|
|
|
build-lflags += -framework CoreFoundation
|
2012-10-03 19:36:51 +00:00
|
|
|
soname-flag =
|
2011-08-23 23:04:04 +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
|
|
|
|
|
2007-10-22 20:56:27 +00:00
|
|
|
ifeq ($(platform),darwin)
|
2012-08-02 18:15:15 +00:00
|
|
|
target-format = macho
|
2011-06-02 21:15:08 +00:00
|
|
|
ifeq (${OSX_SDK_SYSROOT},)
|
|
|
|
OSX_SDK_SYSROOT = 10.4u
|
|
|
|
endif
|
|
|
|
ifeq (${OSX_SDK_VERSION},)
|
|
|
|
OSX_SDK_VERSION = 10.4
|
|
|
|
endif
|
2011-02-18 00:39:41 +00:00
|
|
|
ifneq ($(build-platform),darwin)
|
|
|
|
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
|
|
|
|
|
2010-11-08 04:23:25 +00:00
|
|
|
version-script-flag =
|
2012-06-04 15:52:06 +00:00
|
|
|
lflags = $(common-lflags) -ldl -framework CoreFoundation
|
|
|
|
|
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
|
|
|
|
|
2011-08-11 01:21:48 +00:00
|
|
|
ifneq ($(arch),arm)
|
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
|
2009-11-03 23:07:13 +00:00
|
|
|
|
2012-03-26 17:12:07 +00:00
|
|
|
sdk-dir = $(developer-dir)/Platforms/iPhoneOS.platform/Developer/SDKs
|
|
|
|
|
2011-08-11 01:21:48 +00:00
|
|
|
ifeq ($(arch),arm)
|
2012-04-07 23:15:59 +00:00
|
|
|
ios-version := \
|
2012-10-03 19:36:51 +00:00
|
|
|
$(shell if test -d $(sdk-dir)/iPhoneOS6.0.sdk; then echo 6.0; \
|
|
|
|
elif test -d $(sdk-dir)/iPhoneOS5.1.sdk; then echo 5.1; \
|
2012-04-07 23:15:59 +00:00
|
|
|
elif test -d $(sdk-dir)/iPhoneOS5.0.sdk; then echo 5.0; \
|
|
|
|
elif test -d $(sdk-dir)/iPhoneOS4.3.sdk; then echo 4.3; \
|
|
|
|
elif test -d $(sdk-dir)/iPhoneOS4.2.sdk; then echo 4.2; \
|
|
|
|
else echo; fi)
|
|
|
|
|
|
|
|
ifeq ($(ios-version),)
|
|
|
|
x := $(error "couldn't find SDK for iOS version")
|
|
|
|
endif
|
|
|
|
|
2012-03-02 23:00:08 +00:00
|
|
|
flags = -arch armv7 -isysroot \
|
2012-03-26 17:12:07 +00:00
|
|
|
$(sdk-dir)/iPhoneOS$(ios-version).sdk/
|
2011-08-11 01:21:48 +00:00
|
|
|
openjdk-extra-cflags += $(flags)
|
|
|
|
cflags += $(flags)
|
|
|
|
asmflags += $(flags)
|
|
|
|
lflags += $(flags)
|
|
|
|
endif
|
|
|
|
|
2009-11-03 23:07:13 +00:00
|
|
|
ifeq ($(arch),powerpc)
|
2011-05-26 17:57:30 +00:00
|
|
|
openjdk-extra-cflags += -arch ppc -mmacosx-version-min=${OSX_SDK_VERSION}
|
|
|
|
cflags += -arch ppc -mmacosx-version-min=${OSX_SDK_VERSION}
|
|
|
|
asmflags += -arch ppc -mmacosx-version-min=${OSX_SDK_VERSION}
|
|
|
|
lflags += -arch ppc -mmacosx-version-min=${OSX_SDK_VERSION}
|
2009-11-03 23:07:13 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(arch),i386)
|
2011-05-26 17:57:30 +00:00
|
|
|
openjdk-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}
|
2009-11-03 23:07:13 +00:00
|
|
|
endif
|
2009-12-01 21:24:33 +00:00
|
|
|
|
|
|
|
ifeq ($(arch),x86_64)
|
2010-11-16 03:28:53 +00:00
|
|
|
openjdk-extra-cflags += -arch x86_64
|
2009-12-01 21:24:33 +00:00
|
|
|
cflags += -arch x86_64
|
|
|
|
asmflags += -arch x86_64
|
|
|
|
lflags += -arch x86_64
|
|
|
|
endif
|
2007-10-22 20:56:27 +00:00
|
|
|
endif
|
2007-10-26 21:02:39 +00:00
|
|
|
|
2007-10-22 20:56:27 +00:00
|
|
|
ifeq ($(platform),windows)
|
2012-08-02 18:15:15 +00:00
|
|
|
target-format = pe
|
|
|
|
|
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
|
2008-03-31 03:43:43 +00:00
|
|
|
|
2012-03-17 18:59:22 +00:00
|
|
|
lflags = -L$(lib) $(common-lflags) -lws2_32 -liphlpapi -mwindows -mconsole
|
2012-05-03 14:45:17 +00:00
|
|
|
cflags = -I$(inc) $(common-cflags) -DWINVER=0x0500
|
2011-09-30 21:21:12 +00:00
|
|
|
|
2008-11-11 15:20:49 +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
|
|
|
|
dlltool = $(prefix)dlltool -mi386 --as-flags=--32
|
|
|
|
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
|
2009-02-14 00:03:46 +00:00
|
|
|
common-cflags += "-I$(JAVA_HOME)/include/win32"
|
2010-11-13 02:04:17 +00:00
|
|
|
build-cflags = $(common-cflags) -I$(src) -I$(inc) -mthreads
|
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)
|
2009-10-20 19:39:09 +00:00
|
|
|
dlltool = x86_64-w64-mingw32-dlltool
|
|
|
|
ar = x86_64-w64-mingw32-ar
|
|
|
|
ranlib = x86_64-w64-mingw32-ranlib
|
|
|
|
strip = 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
|
|
|
|
2012-11-13 08:11:49 +00:00
|
|
|
embed = $(build-embed)/embed.exe
|
|
|
|
embed-loader = $(build-embed-loader)/embed-loader.exe
|
|
|
|
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
|
|
|
|
2007-07-16 01:03:02 +00:00
|
|
|
ifeq ($(mode),debug)
|
2010-11-04 17:02:09 +00:00
|
|
|
optimization-cflags = -O0 -g3
|
2012-04-27 18:08:44 +00:00
|
|
|
converter-cflags += -O0 -g3
|
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)
|
2010-11-04 17:02:09 +00:00
|
|
|
optimization-cflags = -O0 -g3 -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)
|
2010-11-04 17:02:09 +00:00
|
|
|
optimization-cflags = -O0 -g3 -DVM_STRESS
|
2009-08-24 22:38:00 +00:00
|
|
|
strip = :
|
2007-07-16 01:03:02 +00:00
|
|
|
endif
|
|
|
|
ifeq ($(mode),stress-major)
|
2010-11-04 17:02:09 +00:00
|
|
|
optimization-cflags = -O0 -g3 -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)
|
2012-06-03 00:56:07 +00:00
|
|
|
ifeq ($(use-clang),true)
|
|
|
|
optimization-cflags = -O4 -g3 -DNDEBUG
|
|
|
|
else
|
|
|
|
optimization-cflags = -O3 -g3 -DNDEBUG
|
|
|
|
endif
|
2011-03-26 20:44:08 +00:00
|
|
|
use-lto = true
|
2007-08-18 22:42:11 +00:00
|
|
|
endif
|
2008-11-11 15:20:49 +00:00
|
|
|
ifeq ($(mode),small)
|
2012-06-01 23:43:42 +00:00
|
|
|
ifeq ($(use-clang),true)
|
|
|
|
optimization-cflags = -Oz -g3 -DNDEBUG
|
|
|
|
else
|
|
|
|
optimization-cflags = -Os -g3 -DNDEBUG
|
|
|
|
endif
|
2011-03-26 20:44:08 +00:00
|
|
|
use-lto = true
|
|
|
|
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)
|
|
|
|
|
2009-11-20 18:40:55 +00:00
|
|
|
ifneq ($(platform),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
|
2009-11-20 01:51:43 +00:00
|
|
|
|
2009-08-27 15:30:34 +00:00
|
|
|
output = -o $(1)
|
2009-08-27 00:26:44 +00:00
|
|
|
as := $(cc)
|
|
|
|
ld := $(cc)
|
|
|
|
build-ld := $(build-cc)
|
|
|
|
|
2012-12-05 22:30:49 +00:00
|
|
|
static = -static
|
|
|
|
|
2009-08-27 00:26:44 +00:00
|
|
|
ifdef msvc
|
2012-12-05 22:30:49 +00:00
|
|
|
static =
|
2012-06-04 15:51:11 +00:00
|
|
|
no-error =
|
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")
|
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"
|
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) \
|
|
|
|
-I"$(build)" \
|
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
|
|
|
|
|
|
|
ifneq ($(lzma),)
|
|
|
|
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
|
|
|
|
|
|
|
ifeq ($(mode),debug)
|
2009-09-01 14:42:33 +00:00
|
|
|
cflags += -Od -Zi -MDd
|
2009-08-27 00:26:44 +00:00
|
|
|
endif
|
|
|
|
ifeq ($(mode),debug-fast)
|
|
|
|
cflags += -Od -Zi -DNDEBUG
|
|
|
|
endif
|
|
|
|
ifeq ($(mode),fast)
|
2009-12-14 15:43:07 +00:00
|
|
|
cflags += -O2 -GL -Zi -DNDEBUG
|
2009-08-27 00:26:44 +00:00
|
|
|
lflags += -LTCG
|
|
|
|
endif
|
|
|
|
ifeq ($(mode),small)
|
|
|
|
cflags += -O1s -Zi -GL -DNDEBUG
|
|
|
|
lflags += -LTCG
|
|
|
|
endif
|
|
|
|
|
|
|
|
strip = :
|
|
|
|
endif
|
|
|
|
|
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)))
|
|
|
|
asm-objects = $(foreach x,$(1),$(patsubst $(2)/%.S,$(3)/%-asm.o,$(x)))
|
2007-10-25 22:06:05 +00:00
|
|
|
java-classes = $(foreach x,$(1),$(patsubst $(2)/%.java,$(3)/%.class,$(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-11 01:55:38 +00:00
|
|
|
vm-depends := $(generated-code) $(wildcard $(src)/*.h) $(wildcard $(src)/codegen/*.h)
|
2007-07-06 23:50:26 +00:00
|
|
|
|
2008-01-19 00:54:36 +00:00
|
|
|
vm-sources = \
|
2007-10-22 20:56:27 +00:00
|
|
|
$(src)/$(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 \
|
2007-06-20 19:20:25 +00:00
|
|
|
$(src)/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 \
|
2010-09-10 21:05:29 +00:00
|
|
|
$(src)/process.cpp
|
2007-06-29 02:58:48 +00:00
|
|
|
|
2008-01-19 00:54:36 +00:00
|
|
|
vm-asm-sources = $(src)/$(asm).S
|
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
|
|
|
|
|
|
|
|
embed-loader-sources = $(src)/embedded-loader.cpp
|
|
|
|
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))
|
|
|
|
|
2007-10-22 20:56:27 +00:00
|
|
|
ifeq ($(process),compile)
|
2009-02-15 19:51:39 +00:00
|
|
|
vm-sources += \
|
2013-02-11 01:55:38 +00:00
|
|
|
$(src)/codegen/compiler.cpp \
|
|
|
|
$(src)/codegen/$(target-asm)/assembler.cpp
|
2007-12-09 22:45:43 +00:00
|
|
|
|
2009-02-16 15:21:12 +00:00
|
|
|
vm-asm-sources += $(src)/compile-$(asm).S
|
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))
|
|
|
|
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
|
|
|
|
2008-11-21 23:20:35 +00:00
|
|
|
heapwalk-sources = $(src)/heapwalk.cpp
|
|
|
|
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
|
|
|
|
|
|
|
ifeq ($(heapdump),true)
|
|
|
|
vm-sources += $(src)/heapdump.cpp
|
|
|
|
vm-heapwalk-objects = $(heapwalk-objects)
|
|
|
|
cflags += -DAVIAN_HEAPDUMP
|
|
|
|
endif
|
|
|
|
|
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
|
|
|
|
|
2012-06-02 15:06:22 +00:00
|
|
|
bootimage-generator-sources = $(src)/bootimage.cpp
|
|
|
|
ifneq ($(lzma),)
|
|
|
|
bootimage-generator-sources += $(src)/lzma-encode.cpp
|
|
|
|
endif
|
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
|
|
|
|
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 = \
|
|
|
|
$(src)/type-generator.cpp \
|
2010-11-07 04:21:19 +00:00
|
|
|
$(src)/$(build-system).cpp \
|
2010-09-20 23:31:23 +00:00
|
|
|
$(src)/finder.cpp
|
2012-06-02 15:06:22 +00:00
|
|
|
|
|
|
|
ifneq ($(lzma),)
|
2012-06-02 21:43:42 +00:00
|
|
|
common-cflags += -I$(lzma) -DAVIAN_USE_LZMA -D_7ZIP_ST
|
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
|
|
|
|
|
|
|
|
lzma-encoder-cflags = -D__STDC_CONSTANT_MACROS -fno-rtti -fno-exceptions \
|
|
|
|
-I$(lzma)/C
|
|
|
|
|
|
|
|
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
|
|
|
|
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
|
|
|
|
2012-04-27 18:08:44 +00:00
|
|
|
converter-depends = \
|
|
|
|
$(src)/binaryToObject/tools.h \
|
|
|
|
$(src)/binaryToObject/endianness.h
|
|
|
|
|
2012-04-25 15:09:26 +00:00
|
|
|
converter-sources = \
|
|
|
|
$(src)/binaryToObject/tools.cpp \
|
|
|
|
$(src)/binaryToObject/elf.cpp \
|
|
|
|
$(src)/binaryToObject/mach-o.cpp \
|
|
|
|
$(src)/binaryToObject/pe.cpp
|
|
|
|
|
2012-05-01 19:16:32 +00:00
|
|
|
converter-tool-sources = \
|
|
|
|
$(src)/binaryToObject/main.cpp
|
|
|
|
|
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
|
|
|
|
|
|
|
static-library = $(build)/lib$(name).a
|
|
|
|
executable = $(build)/$(name)${exe-suffix}
|
|
|
|
dynamic-library = $(build)/$(so-prefix)jvm$(so-suffix)
|
|
|
|
executable-dynamic = $(build)/$(name)-dynamic${exe-suffix}
|
2007-06-30 02:39:01 +00:00
|
|
|
|
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 \
|
|
|
|
$(classpath-src)/avian/Assembler.java \
|
2010-09-10 21:05:29 +00:00
|
|
|
$(classpath-src)/avian/Callback.java \
|
|
|
|
$(classpath-src)/avian/CallbackReceiver.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 \
|
2011-02-17 21:28:51 +00:00
|
|
|
$(classpath-src)/avian/ConstantPool.java \
|
|
|
|
$(classpath-src)/avian/Continuations.java \
|
|
|
|
$(classpath-src)/avian/FieldAddendum.java \
|
2010-09-10 21:05:29 +00:00
|
|
|
$(classpath-src)/avian/IncompatibleContinuationException.java \
|
|
|
|
$(classpath-src)/avian/Machine.java \
|
|
|
|
$(classpath-src)/avian/MethodAddendum.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 \
|
2012-10-06 21:33:24 +00:00
|
|
|
$(classpath-src)/avian/avianvmresource/Handler.java
|
2010-09-15 00:52:57 +00:00
|
|
|
|
2010-11-26 19:41:31 +00:00
|
|
|
ifneq ($(openjdk),)
|
2010-09-15 00:52:57 +00:00
|
|
|
classpath-sources := $(classpath-sources) \
|
|
|
|
$(classpath-src)/avian/OpenJDK.java
|
|
|
|
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')
|
2009-05-18 15:17:09 +00:00
|
|
|
test-sources = $(wildcard $(test)/*.java)
|
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
|
|
|
|
2011-01-28 04:06:01 +00:00
|
|
|
ifeq ($(continuations),true)
|
|
|
|
continuation-tests = \
|
|
|
|
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),powerpc)
|
|
|
|
cflags += -DAVIAN_TARGET_ARCH=AVIAN_ARCH_POWERPC
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(target-arch),arm)
|
|
|
|
cflags += -DAVIAN_TARGET_ARCH=AVIAN_ARCH_ARM
|
|
|
|
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
|
|
|
|
2012-08-05 00:50:43 +00:00
|
|
|
test-flags = -Djava.library.path=$(build) -cp $(build)/test
|
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
|
|
|
|
2007-06-03 23:16:07 +00:00
|
|
|
.PHONY: build
|
2012-06-02 15:06:22 +00:00
|
|
|
build: $(static-library) $(executable) $(dynamic-library) $(lzma-loader) \
|
2012-06-02 19:23:52 +00:00
|
|
|
$(lzma-encoder) $(executable-dynamic) $(classpath-dep) $(test-dep) \
|
2012-11-13 08:11:49 +00:00
|
|
|
$(test-extra-dep) $(embed)
|
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
|
2010-11-04 17:02:09 +00:00
|
|
|
$(library-path) gdb --args $(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
|
2007-10-23 23:23:55 +00:00
|
|
|
test: build
|
2010-11-16 03:28:53 +00:00
|
|
|
$(library-path) /bin/sh $(test)/test.sh 2>/dev/null \
|
|
|
|
$(test-executable) $(mode) "$(test-flags)" \
|
2012-05-22 20:00:31 +00:00
|
|
|
$(call class-names,$(test-build),$(filter-out $(test-support-classes), $(test-classes))) \
|
2011-03-15 23:51:32 +00:00
|
|
|
$(continuation-tests) $(tail-tests)
|
2007-06-03 23:16:07 +00:00
|
|
|
|
2009-04-11 17:54:43 +00:00
|
|
|
.PHONY: tarball
|
|
|
|
tarball:
|
|
|
|
@echo "creating build/avian-$(version).tar.bz2"
|
|
|
|
@mkdir -p build
|
|
|
|
(cd .. && tar --exclude=build --exclude='.*' --exclude='*~' -cjf \
|
|
|
|
avian/build/avian-$(version).tar.bz2 avian)
|
|
|
|
|
2008-02-27 00:19:15 +00:00
|
|
|
.PHONY: javadoc
|
|
|
|
javadoc:
|
2009-05-30 00:32:16 +00:00
|
|
|
javadoc -sourcepath classpath -d build/javadoc -subpackages avian:java \
|
2008-03-11 18:51:07 +00:00
|
|
|
-windowtitle "Avian v$(version) Class Library API" \
|
|
|
|
-doctitle "Avian v$(version) Class Library API" \
|
|
|
|
-header "Avian v$(version)" \
|
|
|
|
-bottom "<a href=\"http://oss.readytalk.com/avian/\">http://oss.readytalk.com/avian</a>"
|
2008-02-27 00:19:15 +00:00
|
|
|
|
2007-06-03 23:16:07 +00:00
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
2007-06-29 16:42:39 +00:00
|
|
|
@echo "removing build"
|
|
|
|
rm -rf build
|
2007-06-03 23:16:07 +00:00
|
|
|
|
2010-09-17 22:03:37 +00:00
|
|
|
$(build)/compile-x86-asm.o: $(src)/continuations-x86.S
|
2007-08-19 19:45:51 +00:00
|
|
|
|
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 $(@))
|
2010-09-21 00:38:38 +00:00
|
|
|
$(generator) $(boot-classpath) $(<) $(@) $(call gen-arg,$(@))
|
2007-06-03 23:16:07 +00:00
|
|
|
|
2010-09-10 21:05:29 +00:00
|
|
|
$(classpath-build)/%.class: $(classpath-src)/%.java
|
2007-11-02 14:01:10 +00:00
|
|
|
@echo $(<)
|
|
|
|
|
2010-09-20 23:31:23 +00:00
|
|
|
$(classpath-dep): $(classpath-sources)
|
2007-11-02 14:01:10 +00:00
|
|
|
@echo "compiling classpath classes"
|
2009-06-04 23:54:06 +00:00
|
|
|
@mkdir -p $(classpath-build)
|
2010-09-20 23:31:23 +00:00
|
|
|
$(javac) -d $(classpath-build) -bootclasspath $(boot-classpath) \
|
2010-09-17 22:03:37 +00:00
|
|
|
$(shell $(MAKE) -s --no-print-directory build=$(build) \
|
|
|
|
$(classpath-classes))
|
2007-10-25 22:06:05 +00:00
|
|
|
@touch $(@)
|
2007-06-29 02:58:48 +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 \
|
2010-09-20 23:31:23 +00:00
|
|
|
$(javac) -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 \
|
2010-09-20 23:31:23 +00:00
|
|
|
$(javac) -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 $(@))
|
2009-08-27 00:26:44 +00:00
|
|
|
$(as) -I$(src) $(asmflags) -c $(<) -o $(@)
|
2008-11-11 15:20:49 +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)
|
|
|
|
|
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 $(@)"
|
|
|
|
ifdef msvc
|
|
|
|
$(ld) $(shared) $(lflags) $(^) -out:$(@) -PDB:$(@).pdb \
|
|
|
|
-IMPLIB:$(test-build)/$(name).lib -MANIFESTFILE:$(@).manifest
|
|
|
|
$(mt) -manifest $(@).manifest -outputresource:"$(@);2"
|
|
|
|
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)"
|
2012-12-05 22:30:49 +00:00
|
|
|
ifdef msvc
|
|
|
|
$(ld) $(lflags) $(^) -out:$(@) -PDB:$(@).pdb \
|
|
|
|
-IMPLIB:$(@).lib -MANIFESTFILE:$(@).manifest
|
|
|
|
$(mt) -manifest $(@).manifest -outputresource:"$(@);1"
|
|
|
|
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)
|
|
|
|
|
|
|
|
$(embed-loader): $(embed-loader-objects) $(static-library)
|
|
|
|
@mkdir -p $(dir $(@))
|
|
|
|
cd $(dir $(@)) && $(ar) x ../../../$(static-library)
|
2012-12-05 22:30:49 +00:00
|
|
|
ifdef msvc
|
|
|
|
$(ld) $(lflags) $(dir $(@))/*.o -out:$(@) -PDB:$(@).pdb \
|
|
|
|
-IMPLIB:$(@).lib -MANIFESTFILE:$(@).manifest
|
|
|
|
$(mt) -manifest $(@).manifest -outputresource:"$(@);1"
|
|
|
|
else
|
2012-11-13 08:11:49 +00:00
|
|
|
$(dlltool) -z $(addsuffix .def,$(basename $(@))) $(dir $(@))/*.o
|
|
|
|
$(dlltool) -d $(addsuffix .def,$(basename $(@))) -e $(addsuffix .exp,$(basename $(@)))
|
2012-12-05 22:30:49 +00:00
|
|
|
$(ld) $(addsuffix .exp,$(basename $(@))) $(dir $(@))/*.o \
|
|
|
|
$(lflags) $(bootimage-lflags) -o $(@)
|
|
|
|
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 $(@))
|
2012-06-04 15:51:11 +00:00
|
|
|
$(cxx) $(cflags) $(no-error) -c $$($(windows-path) $(<)) $(call output,$(@))
|
2012-06-02 15:06:22 +00:00
|
|
|
|
2010-09-17 22:03:37 +00:00
|
|
|
$(vm-asm-objects): $(build)/%-asm.o: $(src)/%.S
|
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)
|
|
|
|
|
2012-05-01 19:16:32 +00:00
|
|
|
$(converter-objects) $(converter-tool-objects): $(build)/binaryToObject/%.o: $(src)/binaryToObject/%.cpp $(converter-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)
|
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 $(@))
|
|
|
|
$(build-cxx) $(lzma-encoder-cflags) -c $(<) -o $(@)
|
|
|
|
|
|
|
|
$(lzma-encoder): $(lzma-encoder-objects) $(lzma-encoder-lzma-objects)
|
|
|
|
$(build-cc) $(^) -g -o $(@)
|
|
|
|
|
|
|
|
$(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 $(@))
|
|
|
|
$(build-cxx) -DPOINTER_SIZE=$(pointer-size) -O0 -g3 $(build-cflags) \
|
2012-06-04 15:51:11 +00:00
|
|
|
$(no-error) -c $(<) -o $(@)
|
2007-06-03 23:16:07 +00:00
|
|
|
|
2010-09-17 22:03:37 +00:00
|
|
|
$(jni-objects): $(build)/%.o: $(classpath-src)/%.cpp
|
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 $(@)"
|
2007-10-26 21:02:39 +00:00
|
|
|
rm -rf $(@)
|
2010-11-04 17:02:09 +00:00
|
|
|
$(ar) cru $(@) $(^)
|
2007-10-23 23:23:55 +00:00
|
|
|
$(ranlib) $(@)
|
|
|
|
|
2013-01-27 01:01:34 +00:00
|
|
|
$(bootimage-object) $(codeimage-object): $(bootimage-generator) \
|
|
|
|
$(build)/classpath.jar
|
2012-05-10 20:36:30 +00:00
|
|
|
$(<) -cp $(classpath-build) -bootimage $(bootimage-object) -codeimage $(codeimage-object) \
|
|
|
|
-bootimage-symbols _binary_bootimage_bin_start:_binary_bootimage_bin_end \
|
|
|
|
-codeimage-symbols _binary_codeimage_bin_start:_binary_codeimage_bin_end
|
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
|
|
|
|
2010-11-04 17:02:09 +00:00
|
|
|
$(executable): $(executable-objects)
|
2007-06-03 23:16:07 +00:00
|
|
|
@echo "linking $(@)"
|
2007-10-26 21:02:39 +00:00
|
|
|
ifeq ($(platform),windows)
|
2009-08-27 00:26:44 +00:00
|
|
|
ifdef msvc
|
2010-10-23 00:20:19 +00:00
|
|
|
$(ld) $(lflags) $(executable-objects) -out:$(@) -PDB:$(@).pdb \
|
|
|
|
-IMPLIB:$(@).lib -MANIFESTFILE:$(@).manifest
|
2009-09-01 14:42:33 +00:00
|
|
|
$(mt) -manifest $(@).manifest -outputresource:"$(@);1"
|
2009-08-27 00:26:44 +00:00
|
|
|
else
|
2010-11-04 17:02:09 +00:00
|
|
|
$(dlltool) -z $(@).def $(executable-objects)
|
2008-11-11 15:20:49 +00:00
|
|
|
$(dlltool) -d $(@).def -e $(@).exp
|
2010-11-04 17:02:09 +00:00
|
|
|
$(ld) $(@).exp $(executable-objects) $(lflags) -o $(@)
|
2009-08-27 00:26:44 +00:00
|
|
|
endif
|
2007-10-26 21:02:39 +00:00
|
|
|
else
|
2010-11-04 17:02:09 +00:00
|
|
|
$(ld) $(executable-objects) $(rdynamic) $(lflags) $(bootimage-lflags) -o $(@)
|
2007-10-26 21:02:39 +00:00
|
|
|
endif
|
2007-11-01 20:37:51 +00:00
|
|
|
$(strip) $(strip-all) $(@)
|
2007-06-03 23:16:07 +00:00
|
|
|
|
2012-04-30 18:36:54 +00:00
|
|
|
$(bootimage-generator): $(bootimage-generator-objects)
|
2012-05-03 14:45:17 +00:00
|
|
|
echo arch=$(arch) platform=$(platform)
|
2009-09-06 00:26:13 +00:00
|
|
|
$(MAKE) mode=$(mode) \
|
2008-12-05 00:24:38 +00:00
|
|
|
arch=$(build-arch) \
|
2012-05-01 19:16:32 +00:00
|
|
|
target-arch=$(arch) \
|
2009-06-01 18:12:29 +00:00
|
|
|
platform=$(bootimage-platform) \
|
2012-08-02 18:15:15 +00:00
|
|
|
target-format=$(target-format) \
|
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): \
|
2010-11-04 17:02:09 +00:00
|
|
|
$(vm-objects) $(classpath-object) $(classpath-objects) \
|
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)
|
2009-08-27 00:26:44 +00:00
|
|
|
ifdef msvc
|
2009-09-01 14:42:33 +00:00
|
|
|
$(ld) $(lflags) $(^) -out:$(@) -PDB:$(@).pdb -IMPLIB:$(@).lib \
|
|
|
|
-MANIFESTFILE:$(@).manifest
|
|
|
|
$(mt) -manifest $(@).manifest -outputresource:"$(@);1"
|
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
|
2009-08-27 00:26:44 +00:00
|
|
|
$(ld) $(@).exp $(^) $(lflags) -o $(@)
|
|
|
|
endif
|
2007-10-26 21:02:39 +00:00
|
|
|
else
|
2009-08-27 00:26:44 +00:00
|
|
|
$(ld) $(^) $(rdynamic) $(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 $(@)"
|
2009-08-27 00:26:44 +00:00
|
|
|
ifdef msvc
|
2010-11-05 19:18:28 +00:00
|
|
|
$(ld) $(shared) $(lflags) $(^) -out:$(@) -PDB:$(@).pdb \
|
|
|
|
-IMPLIB:$(build)/$(name).lib -MANIFESTFILE:$(@).manifest
|
2009-09-01 14:42:33 +00:00
|
|
|
$(mt) -manifest $(@).manifest -outputresource:"$(@);2"
|
2009-08-27 00:26:44 +00:00
|
|
|
else
|
2012-09-05 08:29:12 +00:00
|
|
|
$(ld) $(^) $(version-script-flag) $(soname-flag) \
|
|
|
|
$(shared) $(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 $(@)"
|
2009-08-27 00:26:44 +00:00
|
|
|
ifdef msvc
|
2010-09-17 22:03:37 +00:00
|
|
|
$(ld) $(lflags) -LIBPATH:$(build) -DEFAULTLIB:$(name) \
|
2010-11-27 21:46:07 +00:00
|
|
|
-PDB:$(@).pdb -IMPLIB:$(@).lib $(driver-dynamic-objects) -out:$(@) \
|
|
|
|
-MANIFESTFILE:$(@).manifest
|
2009-09-01 14:42:33 +00:00
|
|
|
$(mt) -manifest $(@).manifest -outputresource:"$(@);1"
|
2009-08-27 00:26:44 +00:00
|
|
|
else
|
2011-11-20 02:26:25 +00:00
|
|
|
$(ld) $(driver-dynamic-objects) -L$(build) -ljvm $(lflags) $(no-lto) -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 $(@)"
|
2009-08-27 00:26:44 +00:00
|
|
|
$(build-ld) $(^) $(build-lflags) -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 $(<))
|
2012-03-11 23:46:36 +00:00
|
|
|
ifeq ($(ios),true)
|
|
|
|
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
|
|
|
|
endif
|
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 $(<)) \
|
|
|
|
$(call output,$(@))
|
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
|
|
|
|
ifeq ($(platform),darwin)
|
|
|
|
mkdir -p $(build)/openjdk/netinet
|
|
|
|
for file in \
|
|
|
|
/usr/include/netinet/ip.h \
|
|
|
|
/usr/include/netinet/in_systm.h \
|
|
|
|
/usr/include/netinet/ip_icmp.h \
|
|
|
|
/usr/include/netinet/in_var.h \
|
|
|
|
/usr/include/netinet/icmp6.h \
|
|
|
|
/usr/include/netinet/ip_var.h; do \
|
|
|
|
if [ ! -f "$(build)/openjdk/netinet/$$(basename $${file})" ]; then \
|
|
|
|
ln "$${file}" "$(build)/openjdk/netinet/$$(basename $${file})"; \
|
|
|
|
fi; \
|
|
|
|
done
|
|
|
|
mkdir -p $(build)/openjdk/netinet6
|
|
|
|
for file in \
|
|
|
|
/usr/include/netinet6/in6_var.h; do \
|
|
|
|
if [ ! -f "$(build)/openjdk/netinet6/$$(basename $${file})" ]; then \
|
|
|
|
ln "$${file}" "$(build)/openjdk/netinet6/$$(basename $${file})"; \
|
|
|
|
fi; \
|
|
|
|
done
|
|
|
|
mkdir -p $(build)/openjdk/net
|
|
|
|
for file in \
|
|
|
|
/usr/include/net/if_arp.h; do \
|
|
|
|
if [ ! -f "$(build)/openjdk/net/$$(basename $${file})" ]; then \
|
|
|
|
ln "$${file}" "$(build)/openjdk/net/$$(basename $${file})"; \
|
|
|
|
fi; \
|
|
|
|
done
|
|
|
|
mkdir -p $(build)/openjdk/sys
|
|
|
|
for file in \
|
|
|
|
/usr/include/sys/kern_event.h \
|
|
|
|
/usr/include/sys/sys_domain.h; do \
|
|
|
|
if [ ! -f "$(build)/openjdk/sys/$$(basename $${file})" ]; then \
|
|
|
|
ln "$${file}" "$(build)/openjdk/sys/$$(basename $${file})"; \
|
|
|
|
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) && \
|
|
|
|
$(jar) xf "$$($(native-path) "$(openjdk)/jre/lib/rt.jar")" && \
|
|
|
|
$(jar) xf "$$($(native-path) "$(openjdk)/jre/lib/jsse.jar")" && \
|
|
|
|
$(jar) xf "$$($(native-path) "$(openjdk)/jre/lib/jce.jar")" && \
|
2012-03-27 23:58:52 +00:00
|
|
|
$(jar) xf "$$($(native-path) "$(openjdk)/jre/lib/charsets.jar")" && \
|
2011-03-04 23:55:31 +00:00
|
|
|
$(jar) xf "$$($(native-path) "$(openjdk)/jre/lib/ext/sunjce_provider.jar")" && \
|
2010-11-15 23:27:00 +00:00
|
|
|
$(jar) xf "$$($(native-path) "$(openjdk)/jre/lib/resources.jar")")
|
2010-11-04 17:02:09 +00:00
|
|
|
@touch $(@)
|