1 #-----------------------------------------------------------------------------
\r
2 # Makefile for usb_jtag FX2 firmware
\r
3 #-----------------------------------------------------------------------------
\r
4 # Copyright 2007 Kolja Waschk, ixo.de
\r
5 #-----------------------------------------------------------------------------
\r
6 # This code is part of usbjtag. usbjtag is free software; you can redistribute
\r
7 # it and/or modify it under the terms of the GNU General Public License as
\r
8 # published by the Free Software Foundation; either version 2 of the License,
\r
9 # or (at your option) any later version. usbjtag is distributed in the hope
\r
10 # that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
\r
11 # warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
12 # GNU General Public License for more details. You should have received a
\r
13 # copy of the GNU General Public License along with this program in the file
\r
14 # COPYING; if not, write to the Free Software Foundation, Inc., 51 Franklin
\r
15 # St, Fifth Floor, Boston, MA 02110-1301 USA
\r
16 #-----------------------------------------------------------------------------
\r
29 CFLAGS+=-mmcs51 --no-xinit-opt -I${LIBDIR} -D${HARDWARE}
\r
31 CFLAGS+=--opt-code-size
\r
36 LDFLAGS=--code-loc 0x0000 --code-size 0x1800
\r
37 LDFLAGS+=--xram-loc 0x1800 --xram-size 0x0800
\r
38 LDFLAGS+=-Wl '-b USBDESCSEG = 0xE100'
\r
39 LDFLAGS+=-L ${LIBDIR}
\r
45 $(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@
\r
47 default: usbjtag.iic
\r
50 ./hex2bix -ir -f 0xC2 -m 0xF000 -c 0x1 -o $@ $<
\r
52 usbjtag.hex: vectors.rel usbjtag.rel dscr.rel eeprom.rel ${HARDWARE}.rel startup.rel ${LIBDIR}/${LIB}
\r
53 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $+
\r
54 packihx $@ > .tmp.hex
\r
63 -test -e /dev/usb_jtag && /sbin/fxload -D /dev/usb_jtag -I usbjtag.hex -t fx2
\r
64 -test -e /dev/tracii_xl2 && /sbin/fxload -D /dev/tracii_xl2 -I usbjtag.hex -t fx2
\r
65 -test -e /dev/xilinx_xpcu && /sbin/fxload -D /dev/xilinx_xpcu -I usbjtag.hex -t fx2
\r
67 REF=/home/kawk/work/xilinx/xtern/xusbdfwu/xusbdfwu-1025.hex
\r
71 -test -e /dev/usb_jtag && /sbin/fxload -D /dev/usb_jtag -I ${REF} -t fx2
\r
72 -test -e /dev/tracii_xl2 && /sbin/fxload -D /dev/tracii_xl2 -I ${REF} -t fx2
\r
73 -test -e /dev/xilinx_xpcu && /sbin/fxload -D /dev/xilinx_xpcu -I ${REF} -t fx2
\r
76 eeprom.rel: eeprom.c eeprom.h
\r
77 usbjtag.rel: usbjtag.c hardware.h eeprom.h
\r
78 ${HARDWARE}.rel: ${HARDWARE}.c hardware.h
\r
80 .PHONY: clean distclean
\r
83 make -C ${LIBDIR} clean
\r
84 rm -f *.lst *.asm *.lib *.sym *.rel *.mem *.map *.rst *.lnk *.hex *.ihx *.iic
\r