native builds are now oneshot compiled
[org.ibex.core.git] / Makefile
index 685b011..a5e0f7a 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -201,20 +201,15 @@ build/h/%.h: build/class/%.class .compile
 build/$(platform)/org/ibex/plat/Linux.cc.o: .install_WindowMaker-0.80.2_$(target) 
 build/$(platform)/org/ibex/plat/Solaris.cc.o: .install_WindowMaker-0.80.2_$(target) 
 
-build/$(platform)/org/ibex/plat/$(platform).cc.o: src/org/ibex/plat/$(platform).cc src/org/ibex/plat/*.cc .configure_jpeg-6b_$(target)
-       @make $(java_headers)
-       @echo -e "\n\033[1mcompiling            .cc -> .o:     $<\033[0m"
-       mkdir -p `dirname $@`
-       $(g++) -c $< -o $@
-
 libjava_dir := $(shell pwd)/upstream/gcc-3.3/build-$(target)/$(target)/libjava
 nat_libjava_files_ := boehm.o exception.o posix-threads.o posix.o prims.o resolve.o java/net/natInetAddress.o
-nat_libjava_files_ += java/net/natPlainSocketImpl.o java/io/natFile*.o java/util/zip/nat*.o gnu/gcj/runtime/natFirstThread.o
+nat_libjava_files_ += java/net/natPlainSocketImpl.o java/util/zip/nat*.o gnu/gcj/runtime/natFirstThread.o
 nat_libjava_files_ += gnu/gcj/runtime/natNameFinder.o gnu/gcj/runtime/natStackTrace.o gnu/gcj/runtime/natSharedLibLoader.o
 nat_libjava_files_ += gnu/gcj/runtime/natStringBuffer.o gnu/gcj/runtime/natVMClassLoader.o gnu/gcj/runtime/natFinalizerThread.o
 nat_libjava_files_ += $(shell cd $(libjava_dir) 2>/dev/null; find java/lang -name \*.o -not -name '*[A-Z]*' 2>/dev/null)
 nat_libjava_files_ += $(shell cd $(libjava_dir) 2>/dev/null; find java/lang -name nat\*.o 2>/dev/null)
 nat_libjava_files := $(nat_libjava_files_:%=$(libjava_dir)/%)
+nat_libjava_files += $(libjava_dir)/java/io/natFile.o $(libjava_dir)/java/io/natFileDescriptor.o
 
 build/$(platform)/natibex.a: $(nat_libjava_files)
        @echo -e "\n\033[1mdetecting CNI calls...\033[0m"
@@ -235,29 +230,55 @@ build/$(platform)/ibex.pruned.jar: .compile .install_jpeg-6b_$(target) build/$(p
        mkdir tmp; cd tmp; fastjar xvf ../build/$(platform)/ibex.jar.pruned; cp ../build/class/org/ibex/plat/GCJ* org/ibex/plat/; cp -r ../build/class/org/xwt/mips/* org/xwt/mips/; mkdir -p $(shell pwd)/build/$(platform)/java/lang; mv java/lang/Class.class $(shell pwd)/build/$(platform)/java/lang; fastjar cvf ../build/$(platform)/ibex.jar.pruned .; cd ..; rm -rf tmp
        mv build/$(platform)/ibex.jar.pruned $@
 
+ifeq ($(platform),Win32)
+filedes := $(shell pwd)/upstream/gcc-3.3/src/libjava/java/io/natFileWin32.cc
+filedes += $(shell pwd)/upstream/gcc-3.3/src/libjava/java/io/natFileDescriptorWin32.cc
+else
+filedes := $(shell pwd)/upstream/gcc-3.3/src/libjava/java/io/natFilePosix.cc
+filedes += $(shell pwd)/upstream/gcc-3.3/src/libjava/java/io/natFileDescriptorPosix.cc
+endif
+
 ifneq ($(target_bin_extension),jar)
-build/$(platform)/$(target_bin): build/$(platform)/ibex.pruned.jar build/$(platform)/natibex.a build/$(platform)/org/ibex/plat/$(platform).cc.o build/$(platform)/builtin.o
+build/$(platform)/$(target_bin): build/$(platform)/ibex.pruned.jar src/org/ibex/plat/*.cc build/$(platform)/builtin.o $(java_headers)
 
        @echo -e "\n\033[1mlinking              .jar -> $(target_bin).phat\033[0m"
-#      PATH=upstream/install/bin:$$PATH $(gcj)
-#              -Os -w                                                               
+# -Os
        cd build/$(platform); $(shell pwd)/upstream/install/bin/$(target)-gcj        \
                -fCLASSPATH=$(shell pwd)/upstream/install/share/java/libgcj-3.3.jar  \
+               -finhibit-reflection                                                 \
                -c java/lang/Class.class
-       PATH=upstream/install/bin:$$PATH upstream/install/bin/$(target)-gcj          \
-               -Wl,-O2,--relax,--gc-sections,--noinhibit-exec,--no-whole-archive    \
-               --main=org.ibex.plat.$(platform)                                     \
-               -Dfile.encoding=UTF8                                                 \
-               -Lupstream/install/$(target)/lib -Lupstream/install/lib              \
-               -w                                                                   \
-               build/$(platform)/org/ibex/plat/$(platform).cc.o                     \
-               build/$(platform)/ibex.pruned.jar                                    \
-               build/$(platform)/natibex.a                                          \
-               build/$(platform)/builtin.o                                          \
-               upstream/jpeg-6b/build-$(target)/libjpeg.a                           \
-               $(link_flags)                                                        \
-               $(libjava_dir)/../boehm-gc/.libs/libgcjgc.a                          \
-               build/$(platform)/Class.o                                            \
+       cd upstream/gcc-3.3/src/libjava/java/lang;\
+               ln -sf ../../../../build-$(target)/$(target)/libjava/java/lang/natConcreteProcess.cc
+       PATH=upstream/install/bin:$$PATH upstream/install/bin/$(target)-gcj              \
+               -Wl,-O2,--relax,--gc-sections,--noinhibit-exec,--no-whole-archive        \
+               --main=org.ibex.plat.$(platform)                                         \
+               -Dfile.encoding=UTF8                                                     \
+               -DPREFIX=\"\" \
+               -Lupstream/install/$(target)/lib -Lupstream/install/lib                  \
+               -finhibit-reflection                                                     \
+               -w -g                                                                    \
+               -Iupstream/jpeg-6b/build-$(target)/                                      \
+               -Iupstream/jpeg-6b/src                                                   \
+               -Ibuild/h                                                                \
+               -Iupstream/gcc-3.3/src/gcc \
+               -Iupstream/gcc-3.3/build-i686-pc-linux-gnu/i686-pc-linux-gnu/boehm-gc/    \
+               -Iupstream/gcc-3.3/build-i686-pc-linux-gnu/i686-pc-linux-gnu/boehm-gc/include    \
+               -Iupstream/gcc-3.3/src/boehm-gc                                           \
+               -Iupstream/gcc-3.3/src/boehm-gc/include                                       \
+               -Iupstream/gcc-3.3/build-i686-pc-linux-gnu/i686-pc-linux-gnu/libjava/    \
+               -Iupstream/gcc-3.3/build-i686-pc-linux-gnu/i686-pc-linux-gnu/libjava/include    \
+               -Iupstream/gcc-3.3/src/libjava                                           \
+               -Iupstream/gcc-3.3/src/libjava/include                                       \
+               -Ufile \
+               src/org/ibex/plat/$(platform).cc                                         \
+               $(nat_libjava_files_:%.o=$(shell pwd)/upstream/gcc-3.3/src/libjava/%.c*) \
+               $(filedes) \
+               build/$(platform)/ibex.pruned.jar                                        \
+               build/$(platform)/builtin.o                                              \
+               upstream/jpeg-6b/build-$(target)/libjpeg.a                               \
+               $(link_flags)                                                            \
+               $(libjava_dir)/../boehm-gc/.libs/libgcjgc.a                              \
+               build/$(platform)/Class.o                                                \
                -lz -o $@.phat
        @echo; ls -l $@.phat