1 #-----------------------------------------------------------------------------
\r
3 # Makefile for usb_jtag FX2 firmware
\r
5 #-----------------------------------------------------------------------------
\r
7 # Copyright 2007 Kolja Waschk, ixo.de
\r
9 #-----------------------------------------------------------------------------
\r
11 # This code is part of usbjtag. usbjtag is free software; you can redistribute
\r
13 # it and/or modify it under the terms of the GNU General Public License as
\r
15 # published by the Free Software Foundation; either version 2 of the License,
\r
17 # or (at your option) any later version. usbjtag is distributed in the hope
\r
19 # that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
\r
21 # warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
23 # GNU General Public License for more details. You should have received a
\r
25 # copy of the GNU General Public License along with this program in the file
\r
27 # COPYING; if not, write to the Free Software Foundation, Inc., 51 Franklin
\r
29 # St, Fifth Floor, Boston, MA 02110-1301 USA
\r
31 #-----------------------------------------------------------------------------
\r
55 CFLAGS+=-mmcs51 --no-xinit-opt -I${LIBDIR} -D${HARDWARE}
\r
57 CFLAGS+=--opt-code-size
\r
67 LDFLAGS=--code-loc 0x0000 --code-size 0x1800
\r
69 LDFLAGS+=--xram-loc 0x1800 --xram-size 0x0800
\r
71 LDFLAGS+=-Wl '-b USBDESCSEG = 0xE100'
\r
73 LDFLAGS+=-L ${LIBDIR}
\r
85 $(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@
\r
91 ./hex2bix -ir -f 0xC2 -m 0xF000 -c 0x1 -o $@ $<
\r
95 default: usbjtag.iic
\r
99 usbjtag.hex: vectors.rel usbjtag.rel dscr.rel eeprom.rel ${HARDWARE}.rel startup.rel ${LIBDIR}/${LIB}
\r
101 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $+
\r
103 packihx $@ > .tmp.hex
\r
121 -test -e /dev/usb_jtag && /sbin/fxload -D /dev/usb_jtag -I usbjtag.hex -t fx2
\r
123 -test -e /dev/tracii_xl2 && /sbin/fxload -D /dev/tracii_xl2 -I usbjtag.hex -t fx2
\r
125 -test -e /dev/xilinx_xpcu && /sbin/fxload -D /dev/xilinx_xpcu -I usbjtag.hex -t fx2
\r
129 REF=/home/kawk/work/xilinx/xtern/xusbdfwu/xusbdfwu-1025.hex
\r
137 -test -e /dev/usb_jtag && /sbin/fxload -D /dev/usb_jtag -I ${REF} -t fx2
\r
139 -test -e /dev/tracii_xl2 && /sbin/fxload -D /dev/tracii_xl2 -I ${REF} -t fx2
\r
141 -test -e /dev/xilinx_xpcu && /sbin/fxload -D /dev/xilinx_xpcu -I ${REF} -t fx2
\r
147 eeprom.rel: eeprom.c eeprom.h
\r
149 usbjtag.rel: usbjtag.c hardware.h eeprom.h
\r
151 ${HARDWARE}.rel: ${HARDWARE}.c hardware.h
\r
155 .PHONY: clean distclean
\r
161 make -C ${LIBDIR} clean
\r
163 rm -f *.lst *.asm *.lib *.sym *.rel *.mem *.map *.rst *.lnk *.hex *.ihx *.iic
\r