Merge branch 'prefix' of git://gnuradio.org/jabele
[debian/gnuradio] / usrp / firmware / src / usrp2 / Makefile.am
index e708312d9445e58598c0a83976a63505c0158f46..4402cd6365901e4cba936a26f7d3d41448e63b42 100644 (file)
@@ -5,7 +5,7 @@
 # 
 # GNU Radio is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
+# the Free Software Foundation; either version 3, or (at your option)
 # any later version.
 # 
 # GNU Radio is distributed in the hope that it will be useful,
@@ -15,8 +15,8 @@
 # 
 # You should have received a copy of the GNU General Public License
 # along with GNU Radio; see the file COPYING.  If not, write to
-# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-# Boston, MA 02111-1307, USA.
+# the Free Software Foundation, Inc., 51 Franklin Street,
+# Boston, MA 02110-1301, USA.
 # 
 
 firmware2dir = $(prefix)/share/usrp/rev2
@@ -54,7 +54,10 @@ EXTRA_DIST =                 \
 
 
 DEFINES=-DHAVE_USRP2
-INCLUDES=-I$(top_srcdir)/usrp/firmware/include -I$(top_srcdir)/usrp/firmware/src/usrp2 -I$(top_srcdir)/usrp/firmware/src/common -I./ -I../common
+FW_INCLUDES=-I$(top_srcdir)/usrp/firmware/include \
+         -I$(top_srcdir)/usrp/firmware/src/usrp2 \
+        -I$(top_srcdir)/usrp/firmware/src/common \
+        -I$(top_builddir)/usrp/firmware/src/common
 
 # with EA = 0, the FX2 implements a portion of the 8051 "external memory"
 # on chip.  This memory is mapped like this:
@@ -87,15 +90,15 @@ noinst_SCRIPTS =            \
        burn-usrp4-eeprom
 
 
-%.rel : %.c
-       $(XCC) $(INCLUDES) $(DEFINES) \
+.c.rel:
+       $(XCC) $(FW_INCLUDES) $(DEFINES) \
                -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<
 
-%.rel : %.a51
-       test -f `basename '$<'` || ln -s '$<' .
+.a51.rel:
+       test -f `basename '$<'` || $(LN_S) '$<' .
        test -f ../common/`basename '$<'` -o \
                \! -f `dirname '$<'`/../common/`basename '$<'` \
-               || ln -s `dirname '$<'`/../common/`basename '$<'` ../common/.
+               || $(LN_S) `dirname '$<'`/../common/`basename '$<'` ../common/`basename '$<'`
        $(XAS) `basename '$<'`
 
 
@@ -105,11 +108,11 @@ eeprom_boot.ihx: $(EEPROM_BOOT_OBJS) $(LIBDEP)
        $(XCC) $(LINKOPTS) -o $@ $(EEPROM_BOOT_OBJS)
 
 burn-usrp2-eeprom: eeprom_boot.ihx
-       $(srcdir)/../common/build_eeprom.py -r2 $< > $@
+       $(PYTHON) $(srcdir)/../common/build_eeprom.py -p$(prefix) -r2 eeprom_boot.ihx > $@
        chmod +x $@
 
 burn-usrp4-eeprom: eeprom_boot.ihx
-       $(srcdir)/../common/build_eeprom.py -r4 $< > $@
+       $(PYTHON) $(srcdir)/../common/build_eeprom.py -p$(prefix) -r4 eeprom_boot.ihx > $@
        chmod +x $@
 
 
@@ -156,7 +159,7 @@ DISTCLEANFILES =    \
 all: usrp_gpif.c
 
 usrp_gpif.c usrp_gpif_inline.h : gpif.c
-       srcdir=$(srcdir) $(srcdir)/edit-gpif $(srcdir)/gpif.c usrp_gpif.c usrp_gpif_inline.h
+       srcdir=$(srcdir) $(PYTHON) $(srcdir)/edit-gpif $(srcdir)/gpif.c usrp_gpif.c usrp_gpif_inline.h
 
 
 # dependencies