gcc_flags += -Iupstream/install/lib/gcc-lib/$(target)/3.3/include -Iupstream/install/$(target)/include
gcc_flags += -ffunction-sections -fdata-sections -fno-omit-frame-pointer
gcj := upstream/install/bin/$(target)-gcj $(gcc_flags) -fCLASSPATH=build/java
-gcj += -fassume-compiled -fmerge-all-constants -finhibit-reflection
+ifneq ($(platform),Darwin)
+gcj += -finhibit-reflection
+endif
+gcj += -fassume-compiled -fmerge-all-constants
gcj += -foptimize-static-class-initialization -feliminate-dwarf2-dups -w
gcjh := $(shell pwd)/upstream/install/bin/$(shell test -e upstream/install/bin/$(target)-gcjh && echo $(target)-)gcjh
g++ := upstream/install/bin/$(target)-gcj $(gcc_flags) -Iupstream/install/include -Wno-multichar
@echo -e "\033[1mpreprocessing .java -> .java: $<\033[0m"
@mkdir -p `dirname $@`; java -cp build/class:upstream/gnu.regexp-1.1.4/src/src org.ibex.util.Preprocessor < $< > $@
-upstream/org.ibex.crypto/%.java:; @make -s .download_org.ibex.crypto &>/dev/null
-upstream/org.ibex.nestedvm/%.java:; @make -s .download_org.ibex.nestedvm &>/dev/null
+upstream/org.ibex.crypto/%.java:; @make .download_org.ibex.crypto
+upstream/org.ibex.nestedvm/%.java:; @make .download_org.ibex.nestedvm
link_upstream = build/java/$(1): $(2)/$(1);
-link_upstream += @echo -e "\033[1mlinking .java -> .java: $$< -> $$@\033[0m";
+link_upstream += @echo -e "\033[1mlinking .java -> .java: $$@\033[0m";
link_upstream += mkdir -p $$(@D);
link_upstream += ln -fs `echo $$(@D)/ | sed 's_[^/]*//*_../_g'`/$$< $$@
$(call link_upstream,org/xwt/mips/%.java,upstream/org.ibex.nestedvm/src,.download_org.ibex.nestedvm)
### Java Class Files ##############################################################################
compile: .compile
-.compile: .download_org.ibex.nestedvm .download_bcel-5.1 $(java_sources) $(java_classes); touch $@
-
-build/class/org/ibex/util/Preprocessor.class: src/org/ibex/util/Preprocessor.java src/org/ibex/util/Vec.java .download_gnu.regexp-1.1.4
- @echo -e "\n\033[1mcompiling .java -> .class: $<\033[0m"
+.compile: .download_org.ibex.nestedvm .download_bcel-5.1 .download_gnu.regexp-1.1.4 $(java_sources)
+ @echo -e "\n\033[1mcompiling .java -> .class\033[0m"
+ @mkdir -p build/java build/class
@mkdir -p build/class/org/ibex/util build/class/gnu/regexp build/java build/class
- $(javac) src/org/ibex/util/Preprocessor.java src/org/ibex/util/Vec.java upstream/gnu.regexp-1.1.4/src/src/gnu/regexp/*.java
+ @test -e build/class/org/ibex/util/Preprocessor.class || \
+ $(javac) src/org/ibex/util/Preprocessor.java \
+ src/org/ibex/util/Vec.java upstream/gnu.regexp-1.1.4/src/src/gnu/regexp/*.java
+ @echo $(java_sources) | tr ' ' '\n' | sed 's_build/java/_ _' | sed 's_/_._g' | sed 's_.java$$__g'
+ @$(javac) $(java_sources) -d build/class
+
build/class/org/ibex/util/MIPSApps.class: build/mips/mipsapps.mips .install_org.ibex.nestedvm
@mkdir -p build/java/org/ibex/util
java -cp upstream/org.ibex.nestedvm/build:upstream/org.ibex.nestedvm/upstream/build/bcel-5.1/bcel-5.1.jar \
org.xwt.mips.Compiler org.ibex.util.MIPSApps $< -outfile $@
-$(java_classes): build/class/org/ibex/util/Preprocessor.class $(java_sources)
- @echo -e "\n\033[1mcompiling .java -> .class: $<\033[0m"
- @mkdir -p build/java build/class
- $(javac) $(java_sources) -d build/class
-
build/Java2/ibex.jar: .compile build/res/builtin.jar build/class/org/ibex/util/MIPSApps.class
@echo -e "\n\033[1marchiving .class -> .jar: build/Java2/ibex.jar\033[0m"
mkdir -p build/Java2
@rm .darcspatch
commit: propose-patch
- darcs push --and-apply xwt@xwt.org:/var/www/org/ibex/core/
+ darcs push xwt@xwt.org:/var/www/org/ibex/core/
doc/%.pdf: build/class/org/ibex/util/XML.class build/class/org/ibex/util/Doc.class doc/%.xml
cd $(@D); java -cp ../../build/class org.ibex.util.Doc slides < `basename $*`.xml > `basename $*`.tex