2008-03-09 21:28:23 +00:00
|
|
|
MAKEFLAGS = -s
|
2007-06-03 23:16:07 +00:00
|
|
|
|
2008-02-19 18:06:52 +00:00
|
|
|
name = avian
|
2008-06-17 23:30:00 +00:00
|
|
|
version = 0.1.1
|
2008-01-19 00:54:36 +00:00
|
|
|
|
2008-10-10 17:43:40 +00:00
|
|
|
build-arch = $(shell uname -m | sed 's/^i.86$$/i386/')
|
2007-06-29 16:42:39 +00:00
|
|
|
|
2008-10-10 17:43:40 +00:00
|
|
|
build-platform = \
|
2008-10-11 20:46:20 +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)
|
2008-10-11 20:46:20 +00:00
|
|
|
platform = $(subst cygwin,windows,$(subst mingw32,windows,$(build-platform)))
|
2007-09-19 16:22:19 +00:00
|
|
|
|
2007-10-26 21:02:39 +00:00
|
|
|
ifeq ($(platform),windows)
|
|
|
|
arch = i386
|
|
|
|
endif
|
2007-09-25 23:53:11 +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
|
|
|
|
2008-03-07 23:34:24 +00:00
|
|
|
root = $(shell (cd .. && pwd))
|
2007-10-25 22:06:05 +00:00
|
|
|
build = build
|
2008-01-03 19:49:42 +00:00
|
|
|
native-build = $(build)/$(platform)-$(arch)-$(process)-$(mode)
|
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
|
2007-06-25 01:34:07 +00:00
|
|
|
classpath = classpath
|
2007-07-16 01:03:02 +00:00
|
|
|
test = test
|
2007-06-03 23:16:07 +00:00
|
|
|
|
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
|
|
|
|
2007-10-22 20:56:27 +00:00
|
|
|
cxx = $(build-cxx)
|
|
|
|
cc = $(build-cc)
|
2007-10-23 23:23:55 +00:00
|
|
|
ar = ar
|
|
|
|
ranlib = ranlib
|
2008-10-10 17:43:40 +00:00
|
|
|
dlltool = dlltool
|
2007-10-26 17:38:36 +00:00
|
|
|
objcopy = objcopy
|
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-10-10 17:43:40 +00:00
|
|
|
javac = "$(JAVA_HOME)/bin/javac"
|
2008-10-10 23:01:33 +00:00
|
|
|
jar = "$(JAVA_HOME)/bin/jar"
|
2007-08-19 19:45:51 +00:00
|
|
|
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
|
|
|
|
|
2008-10-28 21:40:50 +00:00
|
|
|
# note that we supress the non-virtual-dtor warning because we never
|
|
|
|
# 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 \
|
2008-10-10 17:43:40 +00:00
|
|
|
"-I$(JAVA_HOME)/include" -idirafter $(src) -I$(native-build) \
|
2008-03-31 03:43:43 +00:00
|
|
|
-D__STDC_LIMIT_MACROS -D_JNI_IMPLEMENTATION_ -DAVIAN_VERSION=\"$(version)\" \
|
|
|
|
-DBOOT_CLASSPATH=\"[classpathJar]\"
|
2007-10-23 23:23:55 +00:00
|
|
|
|
2007-10-26 14:34:54 +00:00
|
|
|
build-cflags = $(common-cflags) -fPIC -fvisibility=hidden \
|
2008-10-10 17:43:40 +00:00
|
|
|
"-I$(JAVA_HOME)/include/linux" -I$(src) -pthread
|
2007-10-26 14:34:54 +00:00
|
|
|
|
|
|
|
cflags = $(build-cflags)
|
|
|
|
|
2008-10-13 22:31:59 +00:00
|
|
|
common-lflags = -lm -lz
|
|
|
|
|
2008-10-11 20:46:20 +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
|
|
|
|
|
|
|
object-arch = i386:x86-64
|
|
|
|
object-format = elf64-x86-64
|
|
|
|
pointer-size = 8
|
|
|
|
|
2008-03-31 03:43:43 +00:00
|
|
|
so-prefix = lib
|
|
|
|
so-suffix = .so
|
|
|
|
|
|
|
|
shared = -shared
|
|
|
|
|
2008-10-11 20:46:20 +00:00
|
|
|
native-path = echo
|
|
|
|
|
2007-10-26 21:02:39 +00:00
|
|
|
ifeq ($(arch),i386)
|
|
|
|
object-arch = i386
|
|
|
|
object-format = elf32-i386
|
|
|
|
pointer-size = 4
|
|
|
|
endif
|
2007-10-22 20:56:27 +00:00
|
|
|
|
|
|
|
ifeq ($(platform),darwin)
|
2008-10-10 17:43:40 +00:00
|
|
|
build-cflags = $(common-cflags) -fPIC -fvisibility=hidden -I$(src)
|
2008-01-28 23:17:22 +00:00
|
|
|
lflags = $(common-lflags) -ldl -framework CoreFoundation
|
2008-03-31 04:23:51 +00:00
|
|
|
rdynamic =
|
2007-11-01 20:37:51 +00:00
|
|
|
strip-all = -S -x
|
2008-01-23 16:56:25 +00:00
|
|
|
binaryToMacho = $(native-build)/binaryToMacho
|
2008-03-31 03:43:43 +00:00
|
|
|
so-suffix = .jnilib
|
|
|
|
shared = -dynamiclib
|
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-10-11 16:10:11 +00:00
|
|
|
inc = "$(root)/win32/include"
|
|
|
|
lib = "$(root)/win32/lib"
|
2007-10-22 20:56:27 +00:00
|
|
|
|
|
|
|
system = windows
|
2007-10-26 21:02:39 +00:00
|
|
|
object-format = pe-i386
|
2007-10-23 20:05:59 +00:00
|
|
|
|
2008-03-31 03:43:43 +00:00
|
|
|
so-prefix =
|
|
|
|
so-suffix = .dll
|
2008-10-10 14:06:31 +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
|
2007-10-23 23:23:55 +00:00
|
|
|
cflags = $(common-cflags) -I$(inc)
|
2008-10-11 20:46:20 +00:00
|
|
|
|
|
|
|
ifeq (,$(filter mingw32 cygwin,$(build-platform)))
|
2008-10-10 17:43:40 +00:00
|
|
|
cxx = i586-mingw32msvc-g++
|
|
|
|
cc = i586-mingw32msvc-gcc
|
|
|
|
dlltool = i586-mingw32msvc-dlltool
|
|
|
|
ar = i586-mingw32msvc-ar
|
|
|
|
ranlib = i586-mingw32msvc-ranlib
|
|
|
|
objcopy = i586-mingw32msvc-objcopy
|
2008-10-11 20:46:20 +00:00
|
|
|
else
|
|
|
|
build-cflags = $(common-cflags) \
|
|
|
|
"-I$(JAVA_HOME)/include/win32" -I$(src) -mthreads
|
|
|
|
ifeq ($(build-platform),cygwin)
|
|
|
|
build-lflags += -mno-cygwin
|
|
|
|
build-cflags += -mno-cygwin
|
|
|
|
lflags += -mno-cygwin
|
|
|
|
cflags += -mno-cygwin
|
|
|
|
native-path = cygpath -m
|
|
|
|
endif
|
2008-10-10 17:43:40 +00:00
|
|
|
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
|
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
|
|
|
|
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
|
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
|
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-10-22 20:56:27 +00:00
|
|
|
strip = strip
|
2007-08-18 22:42:11 +00:00
|
|
|
endif
|
2008-09-29 17:13:31 +00:00
|
|
|
ifeq ($(mode),small)
|
|
|
|
cflags += -Os -g3 -DNDEBUG
|
|
|
|
strip = strip
|
|
|
|
endif
|
2007-06-03 23:16:07 +00:00
|
|
|
|
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-07-26 00:48:28 +00:00
|
|
|
jni-sources = $(shell find $(classpath) -name '*.cpp')
|
2007-10-25 22:06:05 +00:00
|
|
|
jni-objects = $(call cpp-objects,$(jni-sources),$(classpath),$(native-build))
|
2007-06-25 01:34:07 +00:00
|
|
|
|
2007-06-18 19:23:44 +00:00
|
|
|
generated-code = \
|
2007-10-25 22:06:05 +00:00
|
|
|
$(native-build)/type-enums.cpp \
|
|
|
|
$(native-build)/type-declarations.cpp \
|
|
|
|
$(native-build)/type-constructors.cpp \
|
|
|
|
$(native-build)/type-initializations.cpp \
|
|
|
|
$(native-build)/type-java-initializations.cpp
|
2007-07-06 23:50:26 +00:00
|
|
|
|
2008-01-19 00:54:36 +00:00
|
|
|
vm-depends = \
|
2007-06-18 19:23:44 +00:00
|
|
|
$(generated-code) \
|
2008-01-10 01:20:36 +00:00
|
|
|
$(src)/allocator.h \
|
2007-06-18 21:13:21 +00:00
|
|
|
$(src)/common.h \
|
|
|
|
$(src)/system.h \
|
2007-06-04 23:39:59 +00:00
|
|
|
$(src)/heap.h \
|
2007-08-10 23:45:47 +00:00
|
|
|
$(src)/finder.h \
|
2007-09-24 01:39:03 +00:00
|
|
|
$(src)/processor.h \
|
2007-09-27 00:01:38 +00:00
|
|
|
$(src)/process.h \
|
2007-06-18 21:13:21 +00:00
|
|
|
$(src)/stream.h \
|
|
|
|
$(src)/constants.h \
|
2007-07-06 23:50:26 +00:00
|
|
|
$(src)/jnienv.h \
|
2007-11-26 23:15:53 +00:00
|
|
|
$(src)/machine.h \
|
2008-01-10 01:20:36 +00:00
|
|
|
$(src)/util.h \
|
2008-02-11 17:21:41 +00:00
|
|
|
$(src)/zone.h \
|
|
|
|
$(src)/assembler.h \
|
|
|
|
$(src)/compiler.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 \
|
2007-07-20 14:36:31 +00:00
|
|
|
$(src)/builtin.cpp \
|
2008-01-28 17:27:02 +00:00
|
|
|
$(src)/jnienv.cpp \
|
2008-02-11 17:21:41 +00:00
|
|
|
$(src)/process.cpp \
|
|
|
|
$(src)/$(asm).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)
|
2008-01-19 00:54:36 +00:00
|
|
|
vm-depends += \
|
2007-12-09 22:45:43 +00:00
|
|
|
$(src)/compiler.h \
|
|
|
|
$(src)/vector.h
|
|
|
|
|
2008-01-19 00:54:36 +00:00
|
|
|
vm-sources += $(src)/compiler.cpp
|
2007-12-09 22:45:43 +00:00
|
|
|
|
2008-01-19 00:54:36 +00:00
|
|
|
vm-asm-sources += $(src)/compile.S
|
2007-10-22 20:56:27 +00:00
|
|
|
endif
|
2007-06-29 02:58:48 +00:00
|
|
|
|
2008-01-19 00:54:36 +00:00
|
|
|
vm-cpp-objects = $(call cpp-objects,$(vm-sources),$(src),$(native-build))
|
|
|
|
vm-asm-objects = $(call asm-objects,$(vm-asm-sources),$(src),$(native-build))
|
|
|
|
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 = \
|
|
|
|
$(call cpp-objects,$(heapwalk-sources),$(src),$(native-build))
|
|
|
|
|
|
|
|
ifeq ($(heapdump),true)
|
|
|
|
vm-sources += $(src)/heapdump.cpp
|
|
|
|
vm-heapwalk-objects = $(heapwalk-objects)
|
|
|
|
cflags += -DAVIAN_HEAPDUMP
|
|
|
|
endif
|
|
|
|
|
|
|
|
bootimage-sources = $(src)/bootimage.cpp
|
|
|
|
bootimage-objects = \
|
|
|
|
$(call cpp-objects,$(bootimage-sources),$(src),$(native-build))
|
|
|
|
bootimage = $(native-build)/bootimage
|
|
|
|
|
2008-03-31 03:43:43 +00:00
|
|
|
driver-source = $(src)/main.cpp
|
|
|
|
driver-object = $(native-build)/main.o
|
|
|
|
driver-dynamic-object = $(native-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
|
|
|
|
boot-object = $(native-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 = \
|
|
|
|
$(call cpp-objects,$(generator-sources),$(src),$(native-build))
|
|
|
|
generator = $(native-build)/generator
|
2007-06-03 23:16:07 +00:00
|
|
|
|
2008-03-31 03:43:43 +00:00
|
|
|
static-library = $(native-build)/lib$(name).a
|
2008-10-10 14:06:31 +00:00
|
|
|
executable = $(native-build)/$(name)${exe-suffix}
|
2008-03-31 03:43:43 +00:00
|
|
|
dynamic-library = $(native-build)/$(so-prefix)$(name)$(so-suffix)
|
2008-10-10 14:06:31 +00:00
|
|
|
executable-dynamic = $(native-build)/$(name)-dynamic${exe-suffix}
|
2007-06-30 02:39:01 +00:00
|
|
|
|
2007-10-25 22:06:05 +00:00
|
|
|
classpath-sources = $(shell find $(classpath) -name '*.java')
|
|
|
|
classpath-classes = \
|
|
|
|
$(call java-classes,$(classpath-sources),$(classpath),$(classpath-build))
|
2007-10-26 17:38:36 +00:00
|
|
|
classpath-object = $(native-build)/classpath-jar.o
|
2007-11-02 14:01:10 +00:00
|
|
|
classpath-dep = $(classpath-build)/dep
|
2007-07-16 01:03:02 +00:00
|
|
|
|
2007-10-28 01:54:30 +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))
|
2007-11-02 14:01:10 +00:00
|
|
|
test-dep = $(test-build)/dep
|
2007-07-16 01:03:02 +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) \
|
2008-11-21 23:20:35 +00:00
|
|
|
$(executable-dynamic) $(classpath-dep) $(test-dep) $(bootimage)
|
2007-06-03 23:16:07 +00:00
|
|
|
|
2007-11-02 14:01:10 +00:00
|
|
|
$(test-classes): $(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-10-11 17:59:18 +00:00
|
|
|
/bin/sh $(test)/test.sh 2>/dev/null \
|
2008-03-31 03:43:43 +00:00
|
|
|
$(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
|
|
|
|
2008-02-27 00:19:15 +00:00
|
|
|
.PHONY: javadoc
|
|
|
|
javadoc:
|
2008-03-11 18:51:07 +00:00
|
|
|
javadoc -sourcepath classpath -d build/javadoc -subpackages java \
|
|
|
|
-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
|
|
|
|
2007-08-19 19:45:51 +00:00
|
|
|
.PHONY: clean-native
|
|
|
|
clean-native:
|
2007-10-25 22:06:05 +00:00
|
|
|
@echo "removing $(native-build)"
|
|
|
|
rm -rf $(native-build)
|
2007-08-19 19:45:51 +00:00
|
|
|
|
2007-10-25 22:06:05 +00:00
|
|
|
gen-arg = $(shell echo $(1) | sed -e 's:$(native-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
|
|
|
|
2007-10-25 22:06:05 +00:00
|
|
|
$(native-build)/type-generator.o: \
|
2007-06-04 23:39:59 +00:00
|
|
|
$(generator-headers)
|
2007-06-03 23:16:07 +00:00
|
|
|
|
2007-10-25 22:06:05 +00:00
|
|
|
$(classpath-build)/%.class: $(classpath)/%.java
|
2007-11-02 14:01:10 +00:00
|
|
|
@echo $(<)
|
|
|
|
|
|
|
|
$(classpath-dep): $(classpath-sources)
|
|
|
|
@echo "compiling classpath classes"
|
2007-10-28 01:54:30 +00:00
|
|
|
@mkdir -p $(dir $(@))
|
2007-11-02 14:01:10 +00:00
|
|
|
$(javac) -d $(dir $(@)) -bootclasspath $(classpath-build) \
|
2008-10-10 17:43:40 +00:00
|
|
|
$(shell $(MAKE) -s --no-print-directory $(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"
|
2007-10-28 01:54:30 +00:00
|
|
|
@mkdir -p $(dir $(@))
|
2007-11-02 14:01:10 +00:00
|
|
|
$(javac) -d $(dir $(@)) -bootclasspath $(classpath-build) \
|
2008-10-10 17:43:40 +00:00
|
|
|
$(shell $(MAKE) -s --no-print-directory $(test-classes))
|
2007-10-25 22:06:05 +00:00
|
|
|
@touch $(@)
|
2007-06-03 23:16:07 +00:00
|
|
|
|
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 $(@))
|
2007-07-16 01:03:02 +00:00
|
|
|
$(cxx) $(cflags) -c $(<) -o $(@)
|
|
|
|
endef
|
2007-06-03 23:16:07 +00:00
|
|
|
|
2008-10-23 22:55:39 +00:00
|
|
|
define compile-asm-object
|
|
|
|
@echo "compiling $(@)"
|
|
|
|
@mkdir -p $(dir $(@))
|
|
|
|
$(cc) -I$(src) -c $(<) -o $(@)
|
|
|
|
endef
|
|
|
|
|
2008-01-19 00:54:36 +00:00
|
|
|
$(vm-cpp-objects): $(native-build)/%.o: $(src)/%.cpp $(vm-depends)
|
2007-10-25 22:06:05 +00:00
|
|
|
$(compile-object)
|
|
|
|
|
2008-01-19 00:54:36 +00:00
|
|
|
$(vm-asm-objects): $(native-build)/%-asm.o: $(src)/%.S
|
2008-10-23 22:55:39 +00:00
|
|
|
$(compile-asm-object)
|
2007-06-29 17:45:14 +00:00
|
|
|
|
2008-11-21 23:20:35 +00:00
|
|
|
$(bootimage-objects): $(native-build)/%.o: $(src)/%.cpp $(vm-depends)
|
|
|
|
$(compile-object)
|
|
|
|
|
|
|
|
$(heapwalk-objects): $(native-build)/%.o: $(src)/%.cpp $(vm-depends)
|
|
|
|
$(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 $(@))
|
2008-03-31 18:57:49 +00:00
|
|
|
$(cxx) $(cflags) -DBOOT_LIBRARY=\"$(so-prefix)$(name)$(so-suffix)\" \
|
|
|
|
-c $(<) -o $(@)
|
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)
|
2007-10-26 00:03:26 +00:00
|
|
|
(wd=$$(pwd); \
|
|
|
|
cd $(classpath-build); \
|
2008-10-11 20:46:20 +00:00
|
|
|
$(jar) c0f "$$($(native-path) "$${wd}/$(@)")" $$(find . -name '*.class'))
|
2007-10-25 22:06:05 +00:00
|
|
|
|
2008-01-23 16:56:25 +00:00
|
|
|
$(binaryToMacho): $(src)/binaryToMacho.cpp
|
|
|
|
$(cxx) $(^) -o $(@)
|
|
|
|
|
|
|
|
$(classpath-object): $(build)/classpath.jar $(binaryToMacho)
|
2008-03-31 04:23:51 +00:00
|
|
|
@echo "creating $(@)"
|
2008-01-23 16:56:25 +00:00
|
|
|
ifeq ($(platform),darwin)
|
|
|
|
$(binaryToMacho) $(build)/classpath.jar \
|
2008-03-31 03:43:43 +00:00
|
|
|
__binary_classpath_jar_start __binary_classpath_jar_end > $(@)
|
2008-01-23 16:56:25 +00:00
|
|
|
else
|
2007-10-26 17:38:36 +00:00
|
|
|
(wd=$$(pwd); \
|
|
|
|
cd $(build); \
|
|
|
|
$(objcopy) -I binary classpath.jar \
|
2008-10-11 16:10:11 +00:00
|
|
|
-O $(object-format) -B $(object-arch) "$${wd}/$(@)")
|
2008-01-23 16:56:25 +00:00
|
|
|
endif
|
2007-10-25 22:06:05 +00:00
|
|
|
|
|
|
|
$(generator-objects): $(native-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
|
|
|
|
2007-10-25 22:06:05 +00:00
|
|
|
$(jni-objects): $(native-build)/%.o: $(classpath)/%.cpp
|
2008-01-25 23:45:52 +00:00
|
|
|
$(compile-object)
|
2007-06-25 01:34:07 +00:00
|
|
|
|
2008-03-31 03:43:43 +00:00
|
|
|
$(static-library): $(vm-objects) $(jni-objects)
|
2007-10-23 23:23:55 +00:00
|
|
|
@echo "creating $(@)"
|
2007-10-26 21:02:39 +00:00
|
|
|
rm -rf $(@)
|
2007-10-23 23:23:55 +00:00
|
|
|
$(ar) cru $(@) $(^)
|
|
|
|
$(ranlib) $(@)
|
|
|
|
|
2008-03-31 03:43:43 +00:00
|
|
|
$(executable): \
|
|
|
|
$(vm-objects) $(classpath-object) $(jni-objects) $(driver-object) \
|
2008-11-21 23:20:35 +00:00
|
|
|
$(vm-heapwalk-objects) $(boot-object)
|
|
|
|
@echo "linking $(@)"
|
|
|
|
ifeq ($(platform),windows)
|
|
|
|
$(dlltool) -z $(@).def $(^)
|
|
|
|
$(dlltool) -d $(@).def -e $(@).exp
|
|
|
|
$(cc) $(@).exp $(^) $(lflags) -o $(@)
|
|
|
|
else
|
|
|
|
$(cc) $(^) $(rdynamic) $(lflags) -o $(@)
|
|
|
|
endif
|
|
|
|
$(strip) $(strip-all) $(@)
|
|
|
|
|
|
|
|
$(bootimage): \
|
|
|
|
$(vm-objects) $(classpath-object) $(jni-objects) $(heapwalk-objects) \
|
|
|
|
$(bootimage-objects)
|
2007-06-03 23:16:07 +00:00
|
|
|
@echo "linking $(@)"
|
2007-10-26 21:02:39 +00:00
|
|
|
ifeq ($(platform),windows)
|
|
|
|
$(dlltool) -z $(@).def $(^)
|
2008-10-10 23:37:36 +00:00
|
|
|
$(dlltool) -d $(@).def -e $(@).exp
|
2007-10-26 21:02:39 +00:00
|
|
|
$(cc) $(@).exp $(^) $(lflags) -o $(@)
|
|
|
|
else
|
2008-03-31 03:43:43 +00:00
|
|
|
$(cc) $(^) $(rdynamic) $(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
|
|
|
|
2008-03-31 03:43:43 +00:00
|
|
|
$(dynamic-library): \
|
|
|
|
$(vm-objects) $(classpath-object) $(dynamic-object) $(jni-objects) \
|
2008-11-21 23:20:35 +00:00
|
|
|
$(vm-heapwalk-objects) $(boot-object)
|
2008-03-31 03:43:43 +00:00
|
|
|
@echo "linking $(@)"
|
|
|
|
$(cc) $(^) $(shared) $(lflags) -o $(@)
|
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 $(@)"
|
|
|
|
$(cc) $(^) $(lflags) -o $(@)
|
|
|
|
$(strip) $(strip-all) $(@)
|
|
|
|
|
2007-10-25 22:06:05 +00:00
|
|
|
$(generator): $(generator-objects)
|
|
|
|
@echo "linking $(@)"
|
2008-10-11 20:46:20 +00:00
|
|
|
$(build-cc) $(^) $(build-lflags) -o $(@)
|
2007-10-25 22:06:05 +00:00
|
|
|
|