General questions about installing Cross GCC

Charles Lefurgy lefurgy@eecs.umich.edu
Tue Jul 6 16:23:00 GMT 1999


    Anon> I have some general questions about installing Cross
    Anon> GCC. The target I have been building the development toolkit
    Anon> is for the ARM chip. The directory were I want all files to

Here is a makefile that I use to build an arm-coff toolchain
from binutils, newlib, and egcs.
This works great on my x86-linux and sparc-solaris machines.
The exact versions of the tools I use are are contained 
in the untar: rule.
Maybe you will find it useful.

--Charles



------------------------------

ISC_DIR= $(shell echo $$PWD)/..
TARGET=arm-coff
PREFIX=$(ISC_DIR)/softwareDev/Install
BIN_DIR=$(PREFIX)/bin

.PHONY: all binutils egcs gdb test untar

all:
	echo Using ISC_DIR=$(ISC_DIR)
	-mkdir $(PREFIX)
	$(MAKE) untar
	$(MAKE) binutils
	$(MAKE) egcs
	$(MAKE) gdb

untar:
	if [ ! -s gdb ]; then \
		tar -zxf gdb-4.17.tar.gz; \
		mv gdb-4.17 gdb; \
	fi
	if [ ! -s binutils ]; then \
		tar -zxf binutils-2.9.1.0.19a.tar.gz; \
		mv binutils-2.9.1.0.19a binutils; \
	fi
	if [ ! -s egcs ]; then \
		tar -x --use-compress-program bunzip2 -f egcs-1.1.1.tar.bz2; \
		mv egcs-1.1.1 egcs; \
	fi
	if [ ! -s newlib ]; then \
		tar -zxf newlib-1.8.1.tar.gz; \
		mv newlib-1.8.1 newlib; \
	fi

binutils:
	cd binutils; \
	./configure --target=$(TARGET) --prefix=$(PREFIX) -v
	$(MAKE) -C binutils all install

egcs-fix:
	-touch `find egcs -name configure -print`
	-touch `find egcs/texinfo -name Makefile.in -print`
	-touch `find egcs/texinfo -name \*.pot -print`
	-touch `find egcs/texinfo -name \*.gmo -print`
	-touch egcs/gcc/{c-parse.y,cstamp-h.in,c-gperf.h,c-parse.c,c-parse.h,cexp.c}
	-touch egcs/gcc/cp/parse.{c,h}
	-touch egcs/gcc/java/{parse.c,parse.h,parse-scan.c}
	-touch egcs/gcc/objc/objc-parse.{c,y}
	-touch egcs/libf2c/libU77/config.hin
	-touch egcs/libf2c/libU77/stamp-h.in
	-touch egcs/contrib/fixinc/{fixincl.x,inclhack.sh,fixincl.sh}
	-touch egcs/gcc/fixinc/{fixincl.x,inclhack.sh,fixincl.sh}

egcs:
	-ln -s ../newlib/newlib egcs/newlib
	$(MAKE) egcs-fix
	cd egcs; \
	./configure --target=$(TARGET) --prefix=$(PREFIX) -v --with-newlib --with-headers=../newlib/newlib/libc/include
	-PATH=$(BIN_DIR):$$PATH $(MAKE) -k -C egcs LANGUAGES="c c++"
# The above will fail with an error that xgcc doesn't work (becasue crt0.o isn't found).
# So we now make/install crt0.o from newlib and try again
	-PATH=$(BIN_DIR):$$PATH $(MAKE) -k -C egcs install LANGUAGES="c c++"
	-PATH=$(BIN_DIR):$$PATH $(MAKE) -k -C egcs cross LANGUAGES="c c++"
	-PATH=$(BIN_DIR):$$PATH $(MAKE) -k -C egcs install LANGUAGES="c c++"

gdb-compile:
	PATH=$(BIN_DIR):$$PATH $(MAKE) -C gdb all install

gdb:
	cd gdb ; \
	./configure --target=$(TARGET) --prefix=$(PREFIX) -v
	PATH=$(BIN_DIR):$$PATH $(MAKE) -C gdb all install

egcs-test:
	PATH=$(BIN_DIR):$$PATH $(MAKE) -k -C egcs cross LANGUAGES="c c++"

egcs-install:
	PATH=$(BIN_DIR):$$PATH $(MAKE) -k -C egcs install LANGUAGES="c c++"


_______________________________________________
New CrossGCC FAQ: http://www.objsw.com/CrossGCC
_______________________________________________
To remove yourself from the crossgcc list, send
mail to crossgcc-request@cygnus.com with the
text 'unsubscribe' (without the quotes) in the
body of the message.


More information about the crossgcc mailing list