-$(gcj_java_objects): bin-$(platform)/%.o: src/%.java $(javac_java_objects)
- echo "compiling .java -> .o: $<"
+bin-$(platform)/org/xwt/builtin.o: bin/org/xwt/builtin.xwar
+ @echo "wrapping .xwar -> .o: bin/org/xwt/builtin.o"
+ @(echo "unsigned int builtin_xwar_length = ";\
+ (wc -c bin/org/xwt/builtin.xwar | sed "s_bin.*__");\
+ echo \;;\
+ echo "unsigned char builtin_xwar[] = {";\
+ hexdump -ve '"0x" 1/1 "%x,\n"' bin/org/xwt/builtin.xwar;\
+ echo "};") > .builtin.c
+ $(gcc) -c .builtin.c -o bin-$(platform)/org/xwt/builtin.o
+
+$(java_headers): bin/%.h: bin/%.class
+ @echo "extracting .class -> .h: $<"
+ cd bin; find `echo $< | sed s/.class$$// | sed s_^bin/__ `*.class |\
+ sed s_/_._g | sed s/.class$$// | sed s/.java$$// |\
+ xargs $(gcjh) --classpath .
+
+$(java_objects): bin-$(platform)/%.java.o: src/%.java
+ @echo "compiling .java -> .o: $<"