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 upstream/install/powerpc-apple-darwin/lib/crt1.o"
#############################################################################
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
+ make .install_freetype-2.1.4_mips-unknown-elf target=mips-unknown-elf
+ make build/mips/org/xwt/imp/Freetype.c.o target=mips-unknown-elf platform=mips
+ @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 \
-Lbuild/mips \
-Lupstream/freetype-2.1.4/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
# building gcc requires binutils
.configure_gcc-3.3_$(target): .install_binutils-2.13.2.1_$(target)
+# building newlib requires gcc
+.configure_newlib-1.11.0_$(target): .install_gcc-3.3_$(target)
+
# how to configure it
configure_gcc-3.3 := --enable-languages=c,c++,java --enable-gc-type=boehm --disable-shared --disable-jvmpi
-configure_gcc-3.3 += --disable-java-awt --disable-interpreter --enable-static
-configure_gcc-3.3 += --with-gnu-ld --with-gnu-as --enable-libgcj
+configure_gcc-3.3 += --disable-java-awt --disable-interpreter --enable-static --enable-libgcj
+configure_gcc-3.3 += --with-gnu-ld=$(shell pwd)/upstream/install/bin/$(target)-ld
+configure_gcc-3.3 += --with-as=$(shell pwd)/upstream/install/bin/$(target)-as
configure_gcc-3.3-powerpc-apple-darwin := --enable-threads=posix --disable-hash-synchronization --disable-multilib
configure_gcc-3.3-powerpc-apple-darwin += --with-headers=$(shell pwd)/upstream/install/powerpc-apple-darwin/include
configure_gcc-3.3-i686-pc-mingw32 := --enable-threads=win32 --enable-hash-synchronization
configure_gcc-3.3-i686-pc-linux-gnu := --enable-threads=posix --enable-hash-synchronization
configure_gcc-3.3-sparc-sun-solaris2.7 := --enable-threads=posix --disable-multilib
-configure_gcc-3.3-mips := --enable-languages=c --nfp --with-newlib=yes --enable-multilib --disable-threads
+configure_gcc-3.3-mips-unknown-elf := --enable-languages=c --nfp --enable-multilib --disable-threads
.PRECIOUS: .vendor .download_% .configure_%_$(target) .install_%_$(target)
$(configure_$*-$(target))
touch $@
+.install_freetype-2.1.4_mips-unknown-elf: .install_gcc-3.3_mips-unknown-elf .install_newlib-1.11.0_mips-unknown-elf .download_freetype-2.1.4
+ cd upstream/freetype-2.1.4/src; make setup ansi; PATH=$$PATH:`pwd`/../../install/bin make CC=mips-unknown-elf-gcc AR=mips-unknown-elf-ar
+ upstream/install/bin/mips-unknown-elf-ranlib upstream/freetype-2.1.4/src/objs/libfreetype.a
+ touch $@
+
.install_%_$(target): .configure_%_$(target)
@echo -e "\n\033[1mbuilding $*...\033[0m"
cd upstream/$*/build-$(target); $(setcc) PATH=$$PATH:`pwd`/../../install/bin make
cd upstream/$*/build-$(target); $(setcc) PATH=$$PATH:`pwd`/../../install/bin make install
touch $@
-.install_freetype-2.1.4_$(target): .download_freetype-2.1.4_$(target) .install_binutils-2.13.2.1_$(target) .install_gcc-3.3_$(target)
- @echo -e "\n\033[1mbuilding freetype $*...\033[0m"
- cd upstream/freetype-2.1.4/src; make setup ansi; PATH=$$PATH:`pwd`/../install/bin make CC=mips-gcc AR=mips-ar
- ../install/bin/mips-ranlib freetype-2.1.4/objs/libfreetype.a
- touch $@
-
# jikes has a special target to autodetect a pre-installed jikes, and to autodetect the JVM's $CLASSPATH
.jikes:
@echo -e "\n\033[1mdetecting your jikes installation...\033[0m"