]> sigrok.org Git - sigrok-firmware-fx2lafw.git/blob - hw/Makefile.inc
b726935f9176878ce042a63fb1a2d42231051449
[sigrok-firmware-fx2lafw.git] / hw / Makefile.inc
1 ##
2 ## This file is part of the fx2lafw project.
3 ##
4 ## Copyright (C) 2013 Uwe Hermann <uwe@hermann-uwe.de>
5 ##
6 ## This program 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 2 of the License, or
9 ## (at your option) any later version.
10 ##
11 ## This program 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 this program; if not, write to the Free Software
18 ## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
19 ##
20
21 EXTRA_DIST = dscr.a51
22
23 fx2lafw:
24         $(AM_V_at)cd ${top_builddir} && $(MAKE) fx2lafw
25
26 if FOUND_OBJCOPY
27 $(BASENAME).fw: $(BASENAME).ihx
28         $(AM_V_GEN)$(OBJCOPY) -Iihex $(BASENAME).ihx -Obinary $@
29 else
30 if FOUND_MAKEBIN
31 $(BASENAME).fw: $(BASENAME).ihx
32         $(AM_V_GEN)$(MAKEBIN) -p < $(BASENAME).ihx > $@
33 endif
34 endif
35
36 RELS = ${top_builddir}/fx2lafw.rel ${top_builddir}/gpif-acquisition.rel \
37        ${builddir}/dscr.rel
38
39 $(RELS): fx2lafw
40
41 $(builddir)/dscr.rel: dscr.a51
42         $(AM_V_at)if test "x${abs_top_srcdir}" != "x${abs_top_builddir}"; then \
43                 $(INSTALL_DATA) ${srcdir}/dscr.a51 ${builddir}; \
44         fi
45         $(AM_V_GEN)$(SDAS8051) -logs -I${top_srcdir}/include dscr.a51
46
47 $(BASENAME).ihx: fx2lafw $(RELS) $(top_builddir)/fx2lib/lib/fx2.lib $(top_builddir)/fx2lib/lib/interrupts/ints.lib
48         $(AM_V_GEN)$(SDCC) -mmcs51 $(SDCC_FLAGS) -o $@ $(RELS) -L$(top_builddir)/fx2lib/lib fx2.lib interrupts/ints.lib
49
50 install-data-local: $(BASENAME).fw
51         $(AM_V_at)$(MKDIR_P) $(DESTDIR)$(FIRMWARE_DIR)
52         $(AM_V_at)$(INSTALL_DATA) $(BASENAME).fw $(DESTDIR)$(FIRMWARE_DIR)
53
54 uninstall-local:
55         $(AM_V_at)-rm -f $(DESTDIR)$(FIRMWARE_DIR)/$(BASENAME).fw
56
57 clean-local:
58         $(AM_V_at)-rm -f *.lst *.rel *.rst *.sym *.lnk *.map *.mem *.ihx *.fw
59         $(AM_V_at)-rm -f *.cdb *.lk *.omf
60