$(jpeg_sources):
make -sC upstream jpeg-6b/src
-freetype_sources := $(patsubst %,upstream/freetype-2.1.4/src/src/base/%,ftsystem.c ftmm.c ftbbox.c ftinit.c ftdebug.c ftbase.c ftglyph.c)
-freetype_sources += $(patsubst %,upstream/freetype-2.1.4/src/src/%,smooth/smooth.c autohint/autohint.c sfnt/sfnt.c truetype/truetype.c)
-$(freetype_sources):
- make -sC upstream freetype-2.1.4/.installed
+#freetype_sources := $(patsubst %,upstream/freetype-2.1.4/src/base/%,ftsystem.c ftmm.c ftbbox.c ftinit.c ftdebug.c ftbase.c ftglyph.c)
+#freetype_sources += $(patsubst %,upstream/freetype-2.1.4/src/%,smooth/smooth.c autohint/autohint.c sfnt/sfnt.c truetype/truetype.c)
+upstream/.freetype-mips:
+ make -sC upstream .freetype-mips
upstream/.jikes:
make -sC upstream .jikes
@rm -f $@
@java -cp build/class org.xwt.imp.MIPS org.xwt.imp.Freetype build/mips/freetype.mips > build/java/org/xwt/imp/Freetype.java
-build/mips/freetype.mips: $(freetype_mips_objects)
- @echo "compiling .c -> .mips: $@"
+$(gcc_path)/bin/mips-gcc:
+ @make -sC upstream gcc-3.3-mips target=mips
+
+build/mips/%.o: src/org/xwt/imp/%.c $(gcc_path)/bin/mips-gcc upstream/.freetype
@mkdir -p build/mips
- @make -sC upstream newlib-1.11.0/src newlib-1.11.0/build-mips/.installed gcc-3.3-mips freetype-2.1.4/src .headers target=mips
+ @echo "compiling $< -> $@ (mips)"
@$(gcc_path)/bin/mips-gcc \
+ -march=mips1 \
+ -I upstream/freetype-2.1.4/include \
+ -c -o $@ $<
+
+build/mips/freetype.mips: $(gcc_path)/bin/mips-gcc build/mips/crt0.o build/mips/syscalls.o build/mips/Freetype.o upstream/.freetype-mips
+ @echo "compiling .c -> .mips: $@"
+ @mkdir -p build/mips
+ @make -sC upstream newlib-1.11.0/src newlib-1.11.0/build-mips/.installed freetype-2.1.4/src target=mips
+ $(gcc_path)/bin/mips-gcc \
+ -nostdlib \
--static \
- -mabi=32 \
- -mips1 \
- -msoft-float \
+ -march=mips1 \
+ -T src/org/xwt/imp/linker.ld \
+ -Lbuild/mips \
+ -Lupstream/freetype-2.1.4/objs \
-o $@ \
- -I upstream/freetype-2.1.4/src/include \
- $(freetype_sources) \
- -mno-crt0 \
- -Tnullmon.ld \
- -Wl,--warn-once \
- src/org/xwt/imp/Freetype.c \
- -Wl,-s
-
+ build/mips/Freetype.o \
+ -lfreetype
##############################################################################
@cd $(patsubst %/build-$(target)/.installed,%,$@)/build-$(target); $(setcc) PATH=$$PATH:`pwd`/../../install/bin make install
@touch $(patsubst %/build-$(target)/.installed,%,$@)/build-$(target)/.installed
+
+.freetype:
+ @echo -e "\ndownloading freetype..."
+ @curl $(url_freetype-2.1.4) | tar xzf -
+ @touch $@
+
+.freetype-mips: .freetype
+ @cd freetype-2.1.4; make setup ansi; PATH=$$PATH:`pwd`/../install/bin make CC=mips-gcc AR=mips-ar
+ @PATH=$$PATH:`pwd`/../install/bin; mips-ranlib freetype-2.1.4/objs/libfreetype.a
+ @touch $@