comparison loadtools/Makefile @ 384:7ef814efbebe

loadtools: make install logic refactored in light of compalstage addition
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Tue, 10 Jun 2014 08:49:55 +0000
parents 7b3fd0e2a352
children a212b4968b29
comparison
equal deleted inserted replaced
383:326363ba5bf4 384:7ef814efbebe
1 CC= gcc 1 CC= gcc
2 CFLAGS= -O2 2 CFLAGS= -O2
3 PROGS= fc-iram fc-loadtool fc-xram 3 PROGS= fc-iram fc-loadtool fc-xram
4 LASRC= ../target-utils/loadagent
5 SCRIPTS=scripts/gta02.config scripts/k5a3281.init scripts/pirelli.config \
6 scripts/pirelli.init loadtool.help
7 INSTBIN=/usr/local/bin 4 INSTBIN=/usr/local/bin
8 INSTSCR=/usr/local/share/freecalypso
9 5
10 EXTRA_OBJ= compalload.o 6 EXTRA_OBJ= compalload.o
11 7
12 IRAM_OBJS= defpath.o hexdecode.o hwparam.o hwparamstubs.o romload.o \ 8 IRAM_OBJS= defpath.o hexdecode.o hwparam.o hwparamstubs.o romload.o \
13 sercomm.o sertool.o srecreader.o ttypassthru.o ${EXTRA_OBJ} 9 sercomm.o sertool.o srecreader.o ttypassthru.o ${EXTRA_OBJ}
31 ${CC} ${CFLAGS} -o $@ ${LOADTOOL_OBJS} 27 ${CC} ${CFLAGS} -o $@ ${LOADTOOL_OBJS}
32 28
33 fc-xram: ${XRAM_OBJS} 29 fc-xram: ${XRAM_OBJS}
34 ${CC} ${CFLAGS} -o $@ ${XRAM_OBJS} 30 ${CC} ${CFLAGS} -o $@ ${XRAM_OBJS}
35 31
36 # The loadagent.srec image needs to be installed in the "system" directory 32 install:
37 # where fc-loadtool and fc-xram will find it. However, we have a dilemma:
38 # loadagent is built in the ../target-utils tree with the target cross-gcc,
39 # but the logical place to install it is here. The following hack is our
40 # workaround.
41 #
42 # It is also conceivable that after the FreeCalypso project matures,
43 # some people will want to flash images built by others, without setting up
44 # their own cross-gcc environments for the ARM7TDMI target. However,
45 # the loadtools subpackage is something that every user will need to build
46 # from source on his/her "loading" machine. The planned solution is to
47 # package a "release" of fc-loadtools which will be the present source
48 # directory with a prebuilt loadagent.srec included.
49
50 loadagent.srec:
51 @if [ -r ${LASRC}/loadagent.srec ]; then \
52 true; \
53 else \
54 echo "Error: I need to install loadagent.srec in ${INSTSCR},"; \
55 echo "but I cannot find it: neither in . nor in ${LASRC}"; \
56 false; \
57 fi
58 ln -s ${LASRC}/loadagent.srec .
59
60 install: ${PROGS} ${SCRIPTS} loadagent.srec
61 mkdir -p ${INSTBIN} 33 mkdir -p ${INSTBIN}
62 install -c ${PROGS} ${INSTBIN} 34 install -c ${PROGS} ${INSTBIN}
63 mkdir -p ${INSTSCR} 35 ./install-helpers.sh
64 install -c loadagent.srec ${SCRIPTS} ${INSTSCR}
65 36
66 clean: 37 clean:
67 rm -f *.o *.out *errs ${PROGS} 38 rm -f *.o *.out *errs ${PROGS}