Linux: ; make gcj platform=Linux target=i686-pc-linux-gnu link_flags="-lX11 -lXext --static"
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="-lgcj -lSystem -lgcc -lmathCommon.A upstream/install/powerpc-apple-darwin/lib/crt1.o"
+Darwin: ; make gcj platform=Darwin target=powerpc-apple-darwin link_flags="-lSystem -lmathCommon.A"
#############################################################################
gcc := upstream/install/bin/$(target)-gcc $(gcc_flags)
jar := $(shell ((type fastjar &>/dev/null) && echo fastjar) || echo jar)
-
-
include Makefile.upstream
+
+# FIXME this should be done with -ljpeg
jpeg_c_sources := jdapimin.c jdapistd.c jcomapi.c jcparam.c jdmaster.c jdinput.c jdmainct.c jdcoefct.c jdpostct.c jdmarker.c
jpeg_c_sources += jdhuff.c jdphuff.c jddctmgr.c jidctint.c jidctfst.c jidctflt.c jidctred.c jdsample.c jdcolor.c jdmerge.c
jpeg_c_sources += jquant1.c jquant2.c jerror.c jutils.c jmemnobs.c jmemmgr.c
upstream/jpeg-6b/src/%.c: .download_jpeg-6b
-freetype_sources := ftsystem.c ftmm.c ftbbox.c ftinit.c ftdebug.c ftbase.c ftglyph.c smooth.c sfnt.c truetype.c
-upstream/freetype-2.1.4/%.c: .download_freetype-2.1.4
-
java_sources := $(patsubst src/%.java, build/java/%.java, $(shell find src -name \*.java))
java_sources += $(patsubst src/%.java.pp, build/java/%.java, $(shell find src -name \*.java.pp))
java_sources += build/java/org/xwt/Builtin.java
build/cc/%.cc: src/%.c ; @echo linking $@; mkdir -p $(@D); ln -s `echo $(@D) | sed 's_[^/]*\(/\|$$\)_../_g'`/$< $@
build/c/jpeg/%.c: upstream/jpeg-6b/src/%.c
@echo linking $@; mkdir -p $(@D); ln -s `echo $(@D) | sed 's_[^/]*\(/\|$$\)_../_g'`/$< $@
-build/c/freetype/%.c: upstream/freetype-2.1.4/src/base/%.c
- @echo linking $@; mkdir -p $(@D); ln -s `echo $(@D) | sed 's_[^/]*\(/\|$$\)_../_g'`/$< $@
-build/c/freetype/%.c: upstream/freetype-2.1.4/src/%/%.c
- @echo linking $@; mkdir -p $(@D); ln -s `echo $(@D) | sed 's_[^/]*\(/\|$$\)_../_g'`/$< $@
build/java/%.java: src/%.java.pp
@make -s build/class/org/xwt/util/Preprocessor.class
$(target_bin): $(target_bin).ar
@echo -e "\n\033[1mlinking .o -> $(target_bin)\033[0m"
mkdir -p build/$(platform)
- PATH=upstream/install/bin:$$PATH $(gcj) -nostdlib --main=org.xwt.Main -o build/$(platform)/$(target_bin) $(target_bin).ar -Lupstream/install/$(target)/lib $(link_flags)
+ PATH=upstream/install/bin:$$PATH $(gcj) --main=org.xwt.Main -o build/$(platform)/$(target_bin) $(target_bin).ar -Lupstream/install/$(target)/lib $(link_flags)
##############################################################################
# Freetype
#
-build/mips/%.c.o: build/c/freetype/%.c install_freetype-2.1.4
- make -s install_gcc-3.3 target=mips
- mkdir -p build/mips
+build/mips/%.c.o: src/%.c
+ make .install_freetype-2.1.4_mips-unknown-elf target=mips-unknown-elf
+ mkdir -p $(@D)
echo -e "\n\033[1mcompiling $< -> $@ (mips)\033[0m"
- upstream/install/bin/mips-gcc -march=mips1 -I upstream/freetype-2.1.4/include -c -o $@ $<
+ upstream/install/bin/mips-unknown-elf-gcc -march=r3000 -I upstream/freetype-2.1.4/src/include -c -o $@ $<
-build/mips/freetype.mips: $(freetype_sources:%.c=build/mips/%.c.o)
- make -s install_newlib-1.11.0 target=mips
- @echo -e "\n\033[1mcompiling .c -> .mips: $@\033[0m"
+build/mips/freetype.mips: build/mips/org/xwt/imp/Freetype.c.o build/mips/org/xwt/imp/crt0.c.o build/mips/org/xwt/imp/syscalls.c.o
+ make .install_freetype-2.1.4_mips-unknown-elf target=mips-unknown-elf
+ @echo -e "\n\033[1mlinking .o -> .mips: $@\033[0m"
mkdir -p build/mips
- upstream/install/bin/mips-gcc \
+ upstream/install/bin/mips-unknown-elf-gcc \
-nostdlib \
--static \
-march=mips1 \
-T src/org/xwt/imp/linker.ld \
-Lbuild/mips \
- -Lupstream/freetype-2.1.4/objs \
+ -Lupstream/freetype-2.1.4/src/objs \
-o $@ \
- build/mips/Freetype.o \
+ build/mips/org/xwt/imp/Freetype.c.o \
+ --strip \
-lfreetype
build/java/org/xwt/imp/Freetype.java: build/mips/freetype.mips build/class/org/xwt/imp/MIPS.class
echo
echo "*** DONE ******************************************"
-
-
-
-
-
-
-
-#mips: $(prefix)/mips/lib/libm.a
-#$(prefix)/mips/lib/libm.a: src/.newlib $(prefix)/bin/mips-gcc
-# mkdir -p build/$(target)/newlib
-# cd build/$(target)/newlib; PATH=$(prefix)/bin:$$PATH \
-# ../../../src/newlib-1.11.0/configure --nfp --enable-multilib --prefix=$(prefix) --target=mips
-# cd build/$(target)/newlib; PATH=$(prefix)/bin:$$PATH EXTRA_CFLAGS=-mstrict-align make
-# cd build/$(target)/newlib; make install
-# FIXME: this is probably going to cause problems... figure out how to get by without it
-# touch .empty.c
-# $(prefix)/bin/mips-gcc -c .empty.c -o $(prefix)/mips/lib/crt0.o