view loadtools/Makefile @ 320:397b22c607c8

gsm-fw/gpf/misc/*.c: import from Leonardo semi-src
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Sat, 12 Apr 2014 07:59:49 +0000
parents 02cb0206aa47
children 7b3fd0e2a352
line wrap: on
line source

CC=	gcc
CFLAGS=	-O2
PROGS=	fc-iram fc-loadtool fc-xram
LASRC=	../target-utils/loadagent
SCRIPTS=scripts/gta02.config scripts/k5a3281.init scripts/pirelli.config \
	scripts/pirelli.init loadtool.help
INSTBIN=/usr/local/bin
INSTSCR=/usr/local/share/freecalypso
EXTRA_OBJ=

IRAM_OBJS=	defpath.o hexdecode.o hwparam.o hwparamstubs.o romload.o \
		sercomm.o sertool.o srecreader.o ttypassthru.o ${EXTRA_OBJ}

LOADTOOL_OBJS=	crc32tab.o defpath.o flerase.o flprogbin.o flprogsrec.o \
		flutil.o hexdecode.o hwparam.o labaud.o ltdispatch.o ltdump.o \
		ltexit.o ltflash.o lthelp.o ltmain.o ltmisc.o ltpassthru.o \
		ltscript.o romload.o sercomm.o srecreader.o tpinterf.o \
		tpinterf2.o tpinterf3.o ${EXTRA_OBJ}

XRAM_OBJS=	chainload.o clmain.o defpath.o hexdecode.o hwparam.o \
		hwparamstubs.o initscript.o labaud.o romload.o sercomm.o \
		srecreader.o tpinterf.o ttypassthru.o ${EXTRA_OBJ}

all:	${PROGS}

fc-iram:	${IRAM_OBJS}
	${CC} ${CFLAGS} -o $@ ${IRAM_OBJS}

fc-loadtool:	${LOADTOOL_OBJS}
	${CC} ${CFLAGS} -o $@ ${LOADTOOL_OBJS}

fc-xram:	${XRAM_OBJS}
	${CC} ${CFLAGS} -o $@ ${XRAM_OBJS}

# The loadagent.srec image needs to be installed in the "system" directory
# where fc-loadtool and fc-xram will find it.  However, we have a dilemma:
# loadagent is built in the ../target-utils tree with the target cross-gcc,
# but the logical place to install it is here.  The following hack is our
# workaround.
#
# It is also conceivable that after the FreeCalypso project matures,
# some people will want to flash images built by others, without setting up
# their own cross-gcc environments for the ARM7TDMI target.  However,
# the loadtools subpackage is something that every user will need to build
# from source on his/her "loading" machine.  The planned solution is to
# package a "release" of fc-loadtools which will be the present source
# directory with a prebuilt loadagent.srec included.

loadagent.srec:
	@if [ -r ${LASRC}/loadagent.srec ]; then \
		true; \
	else \
		echo "Error: I need to install loadagent.srec in ${INSTSCR},"; \
		echo "but I cannot find it: neither in . nor in ${LASRC}"; \
		false; \
	fi
	ln -s ${LASRC}/loadagent.srec .

install:	${PROGS} ${SCRIPTS} loadagent.srec
	mkdir -p ${INSTBIN}
	install -c ${PROGS} ${INSTBIN}
	mkdir -p ${INSTSCR}
	install -c loadagent.srec ${SCRIPTS} ${INSTSCR}

clean:
	rm -f *.o *.out *errs ${PROGS}