2010-09-14 16:49:41 +00:00
|
|
|
MAKEFLAGS = -s
|
2007-06-03 23:16:07 +00:00
|
|
|
|
2008-02-19 18:06:52 +00:00
|
|
|
name = avian
|
2009-12-03 02:09:28 +00:00
|
|
|
version = 0.3
|
2008-01-19 00:54:36 +00:00
|
|
|
|
2010-04-20 21:51:35 +00:00
|
|
|
build-arch := $(shell uname -m | sed 's/^i.86$$/i386/' | sed 's/^arm.*$$/arm/')
|
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)
|
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
|
|
|
|
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
|
|
|
|
|
|
|
classpath = avian
|
|
|
|
|
|
|
|
test-library-path = .
|
|
|
|
test-executable = $(executable)
|
|
|
|
|
2009-06-03 00:55:49 +00:00
|
|
|
ifdef gnu
|
2010-09-10 21:05:29 +00:00
|
|
|
classpath = gnu
|
2009-06-03 00:55:49 +00:00
|
|
|
options := $(options)-gnu
|
2010-09-10 21:05:29 +00:00
|
|
|
classapth-jar = $(gnu)/share/classpath/glibj.zip
|
|
|
|
classpath-libraries = \
|
2009-06-06 20:18:33 +00:00
|
|
|
$(gnu)/lib/classpath/libjavaio.a \
|
|
|
|
$(gnu)/lib/classpath/libjavalang.a \
|
|
|
|
$(gnu)/lib/classpath/libjavalangreflect.a \
|
|
|
|
$(gnu)/lib/classpath/libjavamath.a \
|
|
|
|
$(gnu)/lib/classpath/libjavanet.a \
|
|
|
|
$(gnu)/lib/classpath/libjavanio.a \
|
|
|
|
$(gnu)/lib/classpath/libjavautil.a
|
2010-09-10 21:05:29 +00:00
|
|
|
classpath-cflags = -DBOOT_BUILTINS=\"javaio,javalang,javalangreflect,javamath,javanet,javanio,javautil\" -DAVIAN_GNU
|
|
|
|
classpath-lflags = -lgmp
|
|
|
|
endif
|
|
|
|
ifdef openjdk
|
|
|
|
classpath = openjdk
|
|
|
|
options := $(options)-openjdk
|
|
|
|
ifeq ($(arch),x86_64)
|
|
|
|
openjdk-lib-dir = $(openjdk)/jre/lib/amd64
|
|
|
|
else
|
|
|
|
openjdk-lib-dir = $(openjdk)/jre/lib
|
|
|
|
endif
|
|
|
|
classpath-jar = $(openjdk)/jre/lib/rt.jar
|
2010-09-17 22:03:37 +00:00
|
|
|
test-library-path = $(openjdk-lib-dir):$(build)
|
2010-09-10 21:05:29 +00:00
|
|
|
test-executable = $(executable-dynamic)
|
2009-06-03 00:55:49 +00:00
|
|
|
endif
|
2009-03-14 21:16:05 +00:00
|
|
|
|
2009-09-05 21:21:45 +00:00
|
|
|
root := $(shell (cd .. && pwd))
|
2010-09-17 22:03:37 +00:00
|
|
|
build = build/$(platform)-$(arch)$(options)
|
2007-10-25 22:06:05 +00:00
|
|
|
classpath-build = $(build)/classpath
|
|
|
|
test-build = $(build)/test
|
2007-06-03 23:16:07 +00:00
|
|
|
src = src
|
2010-09-10 21:05:29 +00:00
|
|
|
classpath-src = classpath
|
2007-07-16 01:03:02 +00:00
|
|
|
test = test
|
2007-06-03 23:16:07 +00:00
|
|
|
|
2010-09-10 21:05:29 +00:00
|
|
|
ifneq ($(classpath),avian)
|
|
|
|
classpath-object-dep = $(build)/classpath-object.dep
|
|
|
|
classpath-objects = $(shell find $(build)/classpath-objects -name "*.o")
|
2009-06-04 23:54:06 +00:00
|
|
|
else
|
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))
|
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
|
|
|
|
2007-10-22 20:56:27 +00:00
|
|
|
build-cxx = g++
|
|
|
|
build-cc = gcc
|
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
|
|
|
|
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"
|
|
|
|
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
|
|
|
|
2008-11-20 01:10:29 +00:00
|
|
|
common-cflags = $(warnings) -fno-rtti -fno-exceptions -fno-omit-frame-pointer \
|
2010-09-17 22:03:37 +00:00
|
|
|
"-I$(JAVA_HOME)/include" -idirafter $(src) -I$(build) \
|
2008-03-31 03:43:43 +00:00
|
|
|
-D__STDC_LIMIT_MACROS -D_JNI_IMPLEMENTATION_ -DAVIAN_VERSION=\"$(version)\" \
|
2010-09-10 21:05:29 +00:00
|
|
|
-DUSE_ATOMIC_OPERATIONS $(classpath-cflags)
|
2007-10-23 23:23:55 +00:00
|
|
|
|
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
|
|
|
|
|
|
|
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
|
|
|
|
2008-11-11 15:20:49 +00:00
|
|
|
build-lflags =
|
|
|
|
|
2008-03-31 03:43:43 +00:00
|
|
|
lflags = $(common-lflags) -lpthread -ldl
|
2007-10-26 14:34:54 +00:00
|
|
|
|
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
|
|
|
|
|
2008-11-11 15:20:49 +00:00
|
|
|
native-path = echo
|
|
|
|
|
2007-10-26 21:02:39 +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
|
|
|
|
endif
|
2009-08-06 19:25:20 +00:00
|
|
|
ifeq ($(arch),arm)
|
2009-10-29 16:12:30 +00:00
|
|
|
asm = arm
|
2009-08-06 19:25:20 +00:00
|
|
|
pointer-size = 4
|
|
|
|
endif
|
2007-10-22 20:56:27 +00:00
|
|
|
|
|
|
|
ifeq ($(platform),darwin)
|
2008-11-11 15:20:49 +00:00
|
|
|
build-cflags = $(common-cflags) -fPIC -fvisibility=hidden -I$(src)
|
2009-07-02 09:30:05 +00:00
|
|
|
lflags = $(common-lflags) -ldl -framework CoreFoundation -framework CoreServices
|
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
|
2008-03-31 03:43:43 +00:00
|
|
|
so-suffix = .jnilib
|
|
|
|
shared = -dynamiclib
|
2009-11-03 23:07:13 +00:00
|
|
|
|
|
|
|
ifeq ($(arch),powerpc)
|
|
|
|
cflags += -arch ppc
|
|
|
|
asmflags += -arch ppc
|
|
|
|
lflags += -arch ppc
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(arch),i386)
|
|
|
|
cflags += -arch i386
|
|
|
|
asmflags += -arch i386
|
|
|
|
lflags += -arch i386
|
|
|
|
endif
|
2009-12-01 21:24:33 +00:00
|
|
|
|
|
|
|
ifeq ($(arch),x86_64)
|
|
|
|
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)
|
2008-11-11 15:20:49 +00:00
|
|
|
inc = "$(root)/win32/include"
|
|
|
|
lib = "$(root)/win32/lib"
|
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
|
|
|
|
2008-04-09 23:15:28 +00:00
|
|
|
lflags = -L$(lib) $(common-lflags) -lws2_32 -mwindows -mconsole
|
2009-02-23 00:04:14 +00:00
|
|
|
cflags = -I$(inc) $(common-cflags)
|
2008-11-11 15:20:49 +00:00
|
|
|
|
|
|
|
ifeq (,$(filter mingw32 cygwin,$(build-platform)))
|
2010-06-09 22:03:48 +00:00
|
|
|
cxx = i586-mingw32msvc-g++
|
|
|
|
cc = i586-mingw32msvc-gcc
|
|
|
|
dlltool = i586-mingw32msvc-dlltool
|
|
|
|
ar = i586-mingw32msvc-ar
|
|
|
|
ranlib = i586-mingw32msvc-ranlib
|
|
|
|
strip = i586-mingw32msvc-strip
|
2008-11-11 15:20:49 +00:00
|
|
|
else
|
2009-02-14 00:03:46 +00:00
|
|
|
common-cflags += "-I$(JAVA_HOME)/include/win32"
|
|
|
|
build-cflags = $(common-cflags) -I$(src) -mthreads
|
2008-11-11 15:20:49 +00:00
|
|
|
ifeq ($(build-platform),cygwin)
|
|
|
|
build-lflags += -mno-cygwin
|
|
|
|
build-cflags += -mno-cygwin
|
|
|
|
lflags += -mno-cygwin
|
|
|
|
cflags += -mno-cygwin
|
|
|
|
native-path = cygpath -m
|
|
|
|
endif
|
|
|
|
endif
|
2009-06-11 15:36:53 +00:00
|
|
|
|
|
|
|
ifeq ($(arch),x86_64)
|
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
|
2009-06-11 15:36:53 +00:00
|
|
|
inc = "$(root)/win64/include"
|
|
|
|
lib = "$(root)/win64/lib"
|
|
|
|
endif
|
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)
|
2007-12-11 21:26:59 +00:00
|
|
|
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)
|
|
|
|
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)
|
2007-12-16 22:41:07 +00:00
|
|
|
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)
|
2007-12-16 22:41:07 +00:00
|
|
|
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)
|
2007-10-29 21:40:05 +00:00
|
|
|
cflags += -O3 -g3 -DNDEBUG
|
2007-08-18 22:42:11 +00:00
|
|
|
endif
|
2008-11-11 15:20:49 +00:00
|
|
|
ifeq ($(mode),small)
|
|
|
|
cflags += -Os -g3 -DNDEBUG
|
|
|
|
endif
|
2007-06-03 23:16:07 +00:00
|
|
|
|
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:
|
|
|
|
cflags += -march=i486
|
|
|
|
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)
|
|
|
|
|
|
|
|
ifdef msvc
|
2009-09-05 21:21:45 +00:00
|
|
|
windows-java-home := $(shell cygpath -m "$(JAVA_HOME)")
|
|
|
|
zlib := $(shell cygpath -m "$(root)/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_ \
|
2010-04-15 17:11:10 +00:00
|
|
|
-DUSE_ATOMIC_OPERATIONS \
|
2010-09-17 22:03:37 +00:00
|
|
|
-Fd$(build)/$(name).pdb -I"$(zlib)/include" -I$(src) -I"$(build)" \
|
|
|
|
-I"$(windows-java-home)/include" -I"$(windows-java-home)/include/win32"
|
2009-08-27 00:26:44 +00:00
|
|
|
shared = -dll
|
|
|
|
lflags = -nologo -LIBPATH:"$(zlib)/lib" -DEFAULTLIB:ws2_32 \
|
2009-12-14 15:43:07 +00:00
|
|
|
-DEFAULTLIB:zlib -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
|
|
|
|
|
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 \
|
|
|
|
$(build)/type-java-initializations.cpp
|
2007-07-06 23:50:26 +00:00
|
|
|
|
2010-09-10 21:05:29 +00:00
|
|
|
vm-depends := $(generated-code) $(wildcard $(src)/*.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
|
|
|
|
|
|
|
ifeq ($(process),compile)
|
2009-02-15 19:51:39 +00:00
|
|
|
vm-sources += \
|
|
|
|
$(src)/compiler.cpp \
|
|
|
|
$(src)/$(asm).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
|
|
|
|
|
2008-11-29 23:08:14 +00:00
|
|
|
bootimage-generator-sources = $(src)/bootimage.cpp
|
|
|
|
bootimage-generator-objects = \
|
2010-09-17 22:03:37 +00:00
|
|
|
$(call cpp-objects,$(bootimage-generator-sources),$(src),$(build))
|
2008-12-05 00:24:38 +00:00
|
|
|
bootimage-generator = \
|
2009-06-01 18:12:29 +00:00
|
|
|
$(build)/$(bootimage-platform)-$(build-arch)$(options)/bootimage-generator
|
2008-11-29 23:08:14 +00:00
|
|
|
|
2010-09-17 22:03:37 +00:00
|
|
|
bootimage-bin = $(build)/bootimage.bin
|
|
|
|
bootimage-object = $(build)/bootimage-bin.o
|
2008-11-29 23:08:14 +00:00
|
|
|
|
|
|
|
ifeq ($(bootimage),true)
|
2008-12-05 00:24:38 +00:00
|
|
|
ifneq ($(build-arch),$(arch))
|
2009-12-03 17:47:50 +00:00
|
|
|
$(error "bootimage cross-builds not yet supported")
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(arch),x86_64)
|
|
|
|
ifneq ($(build-platform),$(platform))
|
|
|
|
$(error "bootimage cross-builds not yet supported")
|
|
|
|
endif
|
2008-12-05 00:24:38 +00:00
|
|
|
endif
|
|
|
|
|
2008-11-29 23:08:14 +00:00
|
|
|
vm-classpath-object = $(bootimage-object)
|
|
|
|
cflags += -DBOOT_IMAGE=\"bootimageBin\"
|
|
|
|
else
|
|
|
|
vm-classpath-object = $(classpath-object)
|
|
|
|
cflags += -DBOOT_CLASSPATH=\"[classpathJar]\"
|
|
|
|
endif
|
2008-11-21 23:20:35 +00:00
|
|
|
|
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
|
|
|
|
driver-dynamic-object = $(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
|
|
|
|
2007-11-04 21:15:28 +00:00
|
|
|
generator-headers = $(src)/constants.h
|
2007-10-25 22:06:05 +00:00
|
|
|
generator-sources = $(src)/type-generator.cpp
|
|
|
|
generator-objects = \
|
2010-09-17 22:03:37 +00:00
|
|
|
$(call cpp-objects,$(generator-sources),$(src),$(build))
|
|
|
|
generator = $(build)/generator
|
2007-06-03 23:16:07 +00:00
|
|
|
|
2009-10-14 01:00:16 +00:00
|
|
|
converter-objects = \
|
2010-09-17 22:03:37 +00:00
|
|
|
$(build)/binaryToObject-main.o \
|
|
|
|
$(build)/binaryToObject-elf64.o \
|
|
|
|
$(build)/binaryToObject-elf32.o \
|
|
|
|
$(build)/binaryToObject-mach-o64.o \
|
|
|
|
$(build)/binaryToObject-mach-o32.o \
|
|
|
|
$(build)/binaryToObject-pe.o
|
|
|
|
converter = $(build)/binaryToObject
|
|
|
|
|
|
|
|
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)
|
|
|
|
classpath-sources := \
|
|
|
|
$(classpath-src)/avian/Continuations.java \
|
|
|
|
$(classpath-src)/avian/Callback.java \
|
|
|
|
$(classpath-src)/avian/CallbackReceiver.java \
|
|
|
|
$(classpath-src)/avian/IncompatibleContinuationException.java \
|
|
|
|
$(classpath-src)/avian/SystemClassLoader.java \
|
|
|
|
$(classpath-src)/avian/Machine.java \
|
|
|
|
$(classpath-src)/avian/Addendum.java \
|
|
|
|
$(classpath-src)/avian/ClassAddendum.java \
|
|
|
|
$(classpath-src)/avian/MethodAddendum.java \
|
|
|
|
$(classpath-src)/avian/FieldAddendum.java \
|
|
|
|
$(classpath-src)/avian/VMClass.java \
|
|
|
|
$(classpath-src)/avian/VMField.java \
|
|
|
|
$(classpath-src)/avian/VMMethod.java \
|
|
|
|
$(classpath-src)/avian/resource/Handler.java
|
2010-09-15 00:52:57 +00:00
|
|
|
|
|
|
|
ifdef openjdk
|
|
|
|
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
|
|
|
|
2009-05-18 15:17:09 +00:00
|
|
|
test-sources = $(wildcard $(test)/*.java)
|
2007-10-25 22:06:05 +00:00
|
|
|
test-classes = $(call java-classes,$(test-sources),$(test),$(test-build))
|
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
|
|
|
|
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
|
|
|
|
2008-01-23 16:56:25 +00:00
|
|
|
flags = -cp $(test-build)
|
2007-12-27 15:46:17 +00:00
|
|
|
|
2007-12-31 22:40:56 +00:00
|
|
|
args = $(flags) $(input)
|
2007-06-21 01:38:02 +00:00
|
|
|
|
2007-06-03 23:16:07 +00:00
|
|
|
.PHONY: build
|
2008-03-31 03:43:43 +00:00
|
|
|
build: $(static-library) $(executable) $(dynamic-library) \
|
2009-05-18 15:17:09 +00:00
|
|
|
$(executable-dynamic) $(classpath-dep) $(test-dep) $(test-extra-dep)
|
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
|
2008-03-31 03:43:43 +00:00
|
|
|
$(executable) $(args)
|
2007-06-03 23:16:07 +00:00
|
|
|
|
|
|
|
.PHONY: debug
|
2007-09-30 16:32:17 +00:00
|
|
|
debug: build
|
2008-03-31 03:43:43 +00:00
|
|
|
gdb --args $(executable) $(args)
|
2007-06-03 23:16:07 +00:00
|
|
|
|
|
|
|
.PHONY: vg
|
2007-09-30 16:32:17 +00:00
|
|
|
vg: build
|
2008-03-31 03:43:43 +00:00
|
|
|
$(vg) $(executable) $(args)
|
2007-06-03 23:16:07 +00:00
|
|
|
|
|
|
|
.PHONY: test
|
2007-10-23 23:23:55 +00:00
|
|
|
test: build
|
2008-11-11 15:20:49 +00:00
|
|
|
/bin/sh $(test)/test.sh 2>/dev/null \
|
2010-09-10 21:05:29 +00:00
|
|
|
$(test-library-path) $(test-executable) $(mode) "$(flags)" \
|
2007-10-28 01:54:30 +00:00
|
|
|
$(call class-names,$(test-build),$(test-classes))
|
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 $(@))
|
2007-11-04 21:15:28 +00:00
|
|
|
$(generator) $(classpath-build) $(call gen-arg,$(@)) < $(<) > $(@)
|
2007-06-03 23:16:07 +00:00
|
|
|
|
2010-09-17 22:03:37 +00:00
|
|
|
$(build)/type-generator.o: \
|
2007-06-04 23:39:59 +00:00
|
|
|
$(generator-headers)
|
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-10 21:05:29 +00:00
|
|
|
$(classpath-dep): $(classpath-sources) $(classpath-jar)
|
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-10 21:05:29 +00:00
|
|
|
ifneq ($(classpath),avian)
|
2009-06-04 23:54:06 +00:00
|
|
|
(wd=$$(pwd) && \
|
|
|
|
cd $(classpath-build) && \
|
2010-09-10 21:05:29 +00:00
|
|
|
$(jar) xf $(classpath-jar))
|
2009-06-03 22:17:55 +00:00
|
|
|
endif
|
2010-09-10 21:05:29 +00:00
|
|
|
$(javac) -d $(classpath-build) \
|
|
|
|
-bootclasspath $(classpath-build) \
|
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 $(<)
|
|
|
|
|
2007-11-02 14:01:10 +00:00
|
|
|
$(test-dep): $(test-sources)
|
|
|
|
@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 \
|
|
|
|
$(javac) -d $(test-build) -bootclasspath $(classpath-build) $${files}; \
|
|
|
|
fi
|
2009-06-11 00:15:00 +00:00
|
|
|
$(javac) -source 1.2 -target 1.1 -XDjsrlimit=0 -d $(test-build) \
|
2008-11-12 17:07:30 +00:00
|
|
|
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 \
|
|
|
|
$(javac) -d $(test-build) -bootclasspath $(classpath-build) $${files}; \
|
|
|
|
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 $(@))
|
2009-08-27 15:30:34 +00:00
|
|
|
$(cxx) $(cflags) -c $(<) $(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)
|
|
|
|
|
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)
|
|
|
|
|
|
|
|
$(driver-dynamic-object): $(driver-source)
|
|
|
|
@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
|
|
|
|
2007-11-02 14:01:10 +00:00
|
|
|
$(build)/classpath.jar: $(classpath-dep)
|
2009-06-04 23:54:06 +00:00
|
|
|
(wd=$$(pwd) && \
|
|
|
|
cd $(classpath-build) && \
|
2009-06-03 00:55:49 +00:00
|
|
|
$(jar) c0f "$$($(native-path) "$${wd}/$(@)")" .)
|
2007-10-25 22:06:05 +00:00
|
|
|
|
2010-09-17 22:03:37 +00:00
|
|
|
$(build)/binaryToObject-main.o: $(src)/binaryToObject/main.cpp
|
2009-10-14 01:00:16 +00:00
|
|
|
$(build-cxx) -c $(^) -o $(@)
|
|
|
|
|
2010-09-17 22:03:37 +00:00
|
|
|
$(build)/binaryToObject-elf64.o: $(src)/binaryToObject/elf.cpp
|
2009-10-14 01:00:16 +00:00
|
|
|
$(build-cxx) -DBITS_PER_WORD=64 -c $(^) -o $(@)
|
|
|
|
|
2010-09-17 22:03:37 +00:00
|
|
|
$(build)/binaryToObject-elf32.o: $(src)/binaryToObject/elf.cpp
|
2009-10-14 01:00:16 +00:00
|
|
|
$(build-cxx) -DBITS_PER_WORD=32 -c $(^) -o $(@)
|
2008-01-23 16:56:25 +00:00
|
|
|
|
2010-09-17 22:03:37 +00:00
|
|
|
$(build)/binaryToObject-mach-o64.o: $(src)/binaryToObject/mach-o.cpp
|
2009-10-14 01:00:16 +00:00
|
|
|
$(build-cxx) -DBITS_PER_WORD=64 -c $(^) -o $(@)
|
|
|
|
|
2010-09-17 22:03:37 +00:00
|
|
|
$(build)/binaryToObject-mach-o32.o: $(src)/binaryToObject/mach-o.cpp
|
2009-10-14 01:00:16 +00:00
|
|
|
$(build-cxx) -DBITS_PER_WORD=32 -c $(^) -o $(@)
|
|
|
|
|
2010-09-17 22:03:37 +00:00
|
|
|
$(build)/binaryToObject-pe.o: $(src)/binaryToObject/pe.cpp
|
2009-10-14 01:00:16 +00:00
|
|
|
$(build-cxx) -c $(^) -o $(@)
|
|
|
|
|
|
|
|
$(converter): $(converter-objects)
|
|
|
|
$(build-cxx) $(^) -o $(@)
|
|
|
|
|
|
|
|
$(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 \
|
|
|
|
_binary_classpath_jar_end $(platform) $(arch)
|
2007-10-25 22:06:05 +00:00
|
|
|
|
2010-09-17 22:03:37 +00:00
|
|
|
$(generator-objects): $(build)/%.o: $(src)/%.cpp
|
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 $(@)
|
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-09-10 21:05:29 +00:00
|
|
|
$(static-library): $(classpath-object-dep)
|
2008-12-03 02:37:16 +00:00
|
|
|
$(static-library): $(vm-objects) $(jni-objects) $(vm-heapwalk-objects)
|
2007-10-23 23:23:55 +00:00
|
|
|
@echo "creating $(@)"
|
2007-10-26 21:02:39 +00:00
|
|
|
rm -rf $(@)
|
2010-09-10 21:05:29 +00:00
|
|
|
$(ar) cru $(@) $(^) $(call classpath-objects)
|
2007-10-23 23:23:55 +00:00
|
|
|
$(ranlib) $(@)
|
|
|
|
|
2008-11-29 23:08:14 +00:00
|
|
|
$(bootimage-bin): $(bootimage-generator)
|
2009-06-01 18:12:29 +00:00
|
|
|
$(<) $(classpath-build) $(@)
|
2008-11-29 23:08:14 +00:00
|
|
|
|
2009-10-14 01:00:16 +00:00
|
|
|
$(bootimage-object): $(bootimage-bin) $(converter)
|
2008-11-29 23:08:14 +00:00
|
|
|
@echo "creating $(@)"
|
2009-10-14 01:00:16 +00:00
|
|
|
$(converter) $(<) $(@) _binary_bootimage_bin_start \
|
|
|
|
_binary_bootimage_bin_end $(platform) $(arch) $(pointer-size) \
|
|
|
|
writable executable
|
2008-11-29 23:08:14 +00:00
|
|
|
|
2010-09-10 21:05:29 +00:00
|
|
|
$(classpath-object-dep): $(classpath-libraries)
|
|
|
|
@mkdir -p $(build)/classpath-objects
|
|
|
|
(cd $(build)/classpath-objects && \
|
|
|
|
for x in $(classpath-libraries); do ar x $${x}; done)
|
2009-06-06 20:18:33 +00:00
|
|
|
@touch $(@)
|
|
|
|
|
2010-09-10 21:05:29 +00:00
|
|
|
$(executable): $(classpath-object-dep)
|
2008-03-31 03:43:43 +00:00
|
|
|
$(executable): \
|
2008-11-29 23:08:14 +00:00
|
|
|
$(vm-objects) $(jni-objects) $(driver-object) $(vm-heapwalk-objects) \
|
|
|
|
$(boot-object) $(vm-classpath-object)
|
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
|
2010-09-10 21:05:29 +00:00
|
|
|
$(dlltool) -z $(@).def $(^) $(call classpath-objects)
|
2008-11-11 15:20:49 +00:00
|
|
|
$(dlltool) -d $(@).def -e $(@).exp
|
2010-09-10 21:05:29 +00:00
|
|
|
$(ld) $(@).exp $(^) $(call classpath-objects) $(lflags) -o $(@)
|
2009-08-27 00:26:44 +00:00
|
|
|
endif
|
2007-10-26 21:02:39 +00:00
|
|
|
else
|
2010-09-10 21:05:29 +00:00
|
|
|
$(ld) $(^) $(call classpath-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
|
|
|
|
2009-09-06 00:26:13 +00:00
|
|
|
$(bootimage-generator):
|
|
|
|
$(MAKE) mode=$(mode) \
|
2008-12-05 00:24:38 +00:00
|
|
|
arch=$(build-arch) \
|
2009-06-01 18:12:29 +00:00
|
|
|
platform=$(bootimage-platform) \
|
2008-12-05 00:24:38 +00:00
|
|
|
bootimage-generator= \
|
|
|
|
build-bootimage-generator=$(bootimage-generator) \
|
2009-09-06 00:26:13 +00:00
|
|
|
$(bootimage-generator)
|
2008-12-05 00:24:38 +00:00
|
|
|
|
|
|
|
$(build-bootimage-generator): \
|
2008-11-21 23:20:35 +00:00
|
|
|
$(vm-objects) $(classpath-object) $(jni-objects) $(heapwalk-objects) \
|
2008-11-29 23:08:14 +00:00
|
|
|
$(bootimage-generator-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-09-10 21:05:29 +00:00
|
|
|
$(dynamic-library): $(classpath-object-dep)
|
2008-03-31 03:43:43 +00:00
|
|
|
$(dynamic-library): \
|
2008-11-29 23:08:14 +00:00
|
|
|
$(vm-objects) $(dynamic-object) $(jni-objects) $(vm-heapwalk-objects) \
|
2010-09-10 21:05:29 +00:00
|
|
|
$(boot-object) $(vm-classpath-object) $(classpath-libraries)
|
2008-03-31 03:43:43 +00:00
|
|
|
@echo "linking $(@)"
|
2009-08-27 00:26:44 +00:00
|
|
|
ifdef msvc
|
|
|
|
$(ld) $(shared) $(lflags) $(^) -out:$(@) -PDB:$(@).pdb \
|
2010-09-17 22:03:37 +00:00
|
|
|
-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
|
2010-09-10 21:05:29 +00:00
|
|
|
$(ld) $(^) -Wl,--version-script=openjdk.ld \
|
|
|
|
$(call classpath-objects) $(shared) $(lflags) $(bootimage-lflags) -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
|
|
|
|
|
|
|
$(executable-dynamic): $(driver-dynamic-object) $(dynamic-library)
|
|
|
|
@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) \
|
2009-09-01 14:42:33 +00:00
|
|
|
-PDB:$(@).pdb -IMPLIB:$(@).lib $(<) -out:$(@) -MANIFESTFILE:$(@).manifest
|
|
|
|
$(mt) -manifest $(@).manifest -outputresource:"$(@);1"
|
2009-08-27 00:26:44 +00:00
|
|
|
else
|
2010-09-17 22:03:37 +00:00
|
|
|
$(ld) $(<) -L$(build) -ljvm $(lflags) -o $(@)
|
2009-08-27 00:26:44 +00:00
|
|
|
endif
|
2008-03-31 03:43:43 +00:00
|
|
|
$(strip) $(strip-all) $(@)
|
|
|
|
|
2007-10-25 22:06:05 +00:00
|
|
|
$(generator): $(generator-objects)
|
|
|
|
@echo "linking $(@)"
|
2009-08-27 00:26:44 +00:00
|
|
|
$(build-ld) $(^) $(build-lflags) -o $(@)
|