Statistics
| Branch: | Tag: | Revision:

root / firmware / fx2 / src / usrp1 / Makefile.am @ b96088b6

History | View | Annotate | Download (4 kB)

1
#
2
# Copyright 2003,2006 Free Software Foundation, Inc.
3
# 
4
# This file is part of GNU Radio
5
# 
6
# GNU Radio is free software; you can redistribute it and/or modify
7
# it under the terms of the GNU General Public License as published by
8
# the Free Software Foundation; either version 3, or (at your option)
9
# any later version.
10
# 
11
# GNU Radio is distributed in the hope that it will be useful,
12
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
# GNU General Public License for more details.
15
# 
16
# You should have received a copy of the GNU General Public License
17
# along with GNU Radio; see the file COPYING.  If not, write to
18
# the Free Software Foundation, Inc., 51 Franklin Street,
19
# Boston, MA 02110-1301, USA.
20
# 
21

    
22
#firmwaredir = $(prefix)/share/uhd/images
23
#firmware_DATA = usrp1_fw.ihx
24

    
25
#eepromdir = $(firmwaredir)
26
#eepromfile = eeprom_boot.ihx
27
#eeprom_DATA = usrp1_eeprom.bin
28

    
29
EXTRA_DIST =			\
30
	edit-gpif		\
31
	_startup.a51		\
32
	blink_leds.c		\
33
	board_specific.c	\
34
	check_mdelay.c		\
35
	check_udelay.c		\
36
	eeprom_boot.a51		\
37
	eeprom_init.c		\
38
	eeprom_io.c		\
39
	eeprom_io.h		\
40
	fpga_load.c		\
41
	fpga_rev2.c		\
42
	fpga_rev2.h		\
43
	gpif.c			\
44
	init_gpif.c		\
45
	spi.c			\
46
	spi.h			\
47
	usb_descriptors.a51	\
48
	usrp_common.c		\
49
	usrp_common.h		\
50
	usrp_gpif.c		\
51
	usrp_main.c		\
52
	usrp_rev2_regs.h	\
53
	vectors.a51		
54

    
55

    
56
DEFINES=-DHAVE_USRP2
57
FW_INCLUDES=-I$(top_srcdir)/include \
58
         -I$(top_srcdir)/src/usrp1 \
59
	 -I$(top_srcdir)/src/common \
60
	 -I$(top_builddir)/src/common
61

    
62
# with EA = 0, the FX2 implements a portion of the 8051 "external memory"
63
# on chip.  This memory is mapped like this:
64
#
65
# The bottom 8K of memory (0x0000 - 0x1fff) is used for both data and
66
# code accesses.  There's also 512 bytes for data only from 0xe000 - 0xe1ff.
67
#
68
# We tell the linker to start the xdata segment at 0x1800, 6K up from
69
# the bottom.
70

    
71
MEMOPTS = --code-loc 0x0000 --code-size 0x1800 --xram-loc 0x1800 --xram-size 0x0800 \
72
 -Wl '-b USBDESCSEG = 0xE000'
73

    
74
LIBOPTS = -L ../../lib libfx2.lib
75
LIBDEP = ../../lib/libfx2.lib
76

    
77
LINKOPTS = $(MEMOPTS) $(LIBOPTS)
78

    
79
EXECUTABLES = 			\
80
	std.ihx			\
81
	blink_leds.ihx 		\
82
	check_mdelay.ihx	\
83
	check_udelay.ihx	\
84
	eeprom_boot.ihx		
85

    
86
STARTUP = _startup.rel
87

    
88
.c.rel:
89
	$(XCC) $(FW_INCLUDES) $(DEFINES) \
90
		-c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<
91

    
92
.a51.rel:
93
	test -f `basename '$<'` || $(LN_S) '$<' .
94
	test -f ../common/`basename '$<'` -o \
95
		\! -f `dirname '$<'`/../common/`basename '$<'` \
96
		|| $(LN_S) `dirname '$<'`/../common/`basename '$<'` ../common/`basename '$<'`
97
	$(XAS) `basename '$<'`
98

    
99

    
100
EEPROM_BOOT_OBJS = eeprom_boot.rel eeprom_init.rel $(STARTUP)
101

    
102
eeprom_boot.ihx: $(EEPROM_BOOT_OBJS) $(LIBDEP)
103
	$(XCC) $(LINKOPTS) -o $@ $(EEPROM_BOOT_OBJS)
104

    
105
usrp1_eeprom.bin: eeprom_boot.bin
106
	$(PYTHON) ../common/build_eeprom.py -r4 $< $@
107

    
108
eeprom_boot.bin: eeprom_boot.ihx
109
	objcopy -I ihex -O binary $< $@
110

    
111
USRP_OBJS = \
112
	vectors.rel 						\
113
	usrp_main.rel usrp_common.rel board_specific.rel	\
114
	fpga_load.rel fpga_rev2.rel init_gpif.rel usrp_gpif.rel \
115
	usb_descriptors.rel spi.rel eeprom_io.rel $(STARTUP)
116

    
117
std.ihx: $(USRP_OBJS) $(LIBDEP)
118
	$(XCC) $(LINKOPTS) -o $@ $(USRP_OBJS)
119

    
120
CLEANFILES = 		\
121
	*.ihx *.lnk *.lst *.map *.mem *.rel *.rst *.sym *.asm *.lib	*.bin \
122
	usrp_gpif.c usrp_gpif_inline.h
123

    
124
DISTCLEANFILES = 	\
125
	*.ihx *.lnk *.lst *.map *.mem *.rel *.rst *.sym *.asm *.lib *.bin
126

    
127
# build gpif stuff
128

    
129
all: usrp_gpif.c std.ihx usrp1_eeprom.bin
130

    
131
usrp_gpif.c usrp_gpif_inline.h : gpif.c
132
	srcdir=$(srcdir) $(PYTHON) $(srcdir)/edit-gpif $(srcdir)/gpif.c usrp_gpif.c usrp_gpif_inline.h
133

    
134
# dependencies
135

    
136
usrp_main.rel: usrp_gpif_inline.h
137

    
138
#usrp_main.rel: fpga.h usrp_common.h ../../include/usrp_commands.h usrp_gpif_inline.h  ../../include/usrp_config.h usrp_rev2_regs.h ../../include/fx2regs.h
139
#usrp_common.rel: usrp_common.h ../../include/usrp_commands.h ../../include/usrp_config.h usrp_rev2_regs.h ../../include/fx2regs.h
140
#fpga.rel: usrp_common.h ../../include/usrp_commands.h fpga.h ../../include/usrp_config.h usrp_rev2_regs.h ../../include/fx2regs.h
141
#init_gpif.rel: usrp_common.h ../../include/usrp_config.h usrp_rev2_regs.h ../../include/fx2regs.h