2003/09/26 02:54:50
[org.ibex.core.git] / Makefile
index 7d0cb52..7da3b84 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -4,10 +4,10 @@
 
 #
 
-all:      JVM Darwin Linux Win32 Solaris
+all:      JVM Linux Win32 Darwin Solaris
 
 JVM:        build/JVM/xwt.jar
-Linux:    ; make gcj platform=Linux   target=i686-pc-linux-gnu    link_flags="-lX11 -lXext --static"
+Linux:    ; make gcj platform=Linux   target=i686-pc-linux-gnu    link_flags="-lX11 -lXext"
 Solaris:  ; make gcj platform=Solaris target=sparc-sun-solaris2.7 link_flags="-lX11 -lXext"
 Win32:    ; make gcj platform=Win32   target=i686-pc-mingw32      link_flags="-Wl,--subsystem,windows -lcomdlg32" target_bin=xwt.exe
 Darwin:   ; make gcj platform=Darwin target=powerpc-apple-darwin link_flags="$(darwin_linker_flags)"
@@ -68,15 +68,18 @@ build/class/%.class: build/java/%.java .jikes
        mkdir -p build/class
        ./.jikes $<
 
+# this forces a clean build every time because jikes is so damn buggy
 compile: .compile
-.compile: $(all_java_sources)
+.compile: $(all_java_sources) .jikes
        @echo -e "\n\033[1mcompiling          .java -> .class: src/**/*.java\033[0m"
+       rm -rf build/class
        mkdir -p build/class
-       @./.jikes $^
+       @./.jikes $(all_java_sources)
        touch .compile
 
 # PHASE 4: gcj-generated headers
 java_headers          := $(all_java_sources:build/java/%.java=build/h/%.h) 
+build/h/edu/stanford/ejalbert/BrowserLauncher.h:; touch $@
 build/h/%.h: build/class/%.class
        @echo -e "\n\033[1mextracting        .class -> .h:     $<\033[0m"
        mkdir -p `dirname $@`
@@ -116,16 +119,16 @@ jpeg_sources    += jquant1.c jquant2.c jerror.c jutils.c jmemnobs.c jmemmgr.c
 upstream/jpeg-6b/build-$(target)/libjpeg.a: .install_jpeg-6b_$(target)
 java_objects := $(nonplat_java_sources:build/java/%.java=build/$(platform)/%.java.o)
 
-build/$(platform)/$(platform).ar: $(java_objects) build/$(platform)/org/xwt/plat/$(platform).cc.o build/$(platform)/org/xwt/builtin.res.o build/$(platform)/freetype.res.o $(plat_java_sources:build/java/%.java=build/$(platform)/%.java.o)
+build/$(platform)/$(platform).ar: $(java_objects) build/$(platform)/builtin.o $(plat_java_sources:build/java/%.java=build/$(platform)/%.java.o)
        @echo -e "\n\033[1marchiving             .o -> .a\033[0m"
        mkdir -p build/$(platform)
        upstream/install/bin/$(target)-ar rc $@ $?
        upstream/install/bin/$(target)-ranlib $@
 
-$(target_bin): build/$(platform)/$(platform).ar upstream/jpeg-6b/build-$(target)/libjpeg.a 
+$(target_bin): build/$(platform)/$(platform).ar build/$(platform)/org/xwt/plat/$(platform).cc.o upstream/jpeg-6b/build-$(target)/libjpeg.a 
        @echo -e "\n\033[1mlinking               .o -> $(target_bin)\033[0m"
        mkdir -p build/$(platform)
-       PATH=upstream/install/bin:$$PATH $(gcj) -v --main=org.xwt.Main -o build/$(platform)/$(target_bin) -Lupstream/install/$(target)/lib $(link_flags) $^ build/$(platform)/org/xwt/plat/$(platform).java.o
+       PATH=upstream/install/bin:$$PATH $(gcj) -v --main=org.xwt.Main -o build/$(platform)/$(target_bin) -Lupstream/install/$(target)/lib $^ build/$(platform)/org/xwt/plat/$(platform).java.o $(link_flags)
 
 
 ##############################################################################
@@ -151,7 +154,7 @@ build/$(platform)/builtin.o: build/res/builtin.jar
 # having the individual .o's depend on the .java's (otherwise every .o gets recompiled when one .java changes)
 gcj: .vendor .install_gcc-3.3_$(target) $(target_bin)
 
-build/JVM/xwt.jar: $(java_sources:build/java/%.java=build/class/%.class) build/res/builtin.jar
+build/JVM/xwt.jar: .compile build/res/builtin.jar
        @echo -e "\n\033[1marchiving         .class -> .jar:   build/JVM/xwt.jar\033[0m"
        mkdir -p build/JVM
        echo -e "Manifest-Version: 1.0\nMain-Class: org.xwt.Main\n" > build/JVM/.manifest