]> sigrok.org Git - sigrok-firmware-fx2lafw.git/blob - Makefile
Use makebin if objcopy is not available.
[sigrok-firmware-fx2lafw.git] / Makefile
1 ##
2 ## This file is part of the fx2lafw project.
3 ##
4 ## Copyright (C) 2012 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 # sigrok-firmware-fx2lafw package/tarball version number.
22 VERSION = "0.1.0"
23
24 DESTDIR ?= /usr/local/share/sigrok-firmware
25
26 REPO = git://sigrok.org/sigrok-firmware-fx2lafw
27
28 TARBALLDIR = sigrok-firmware-fx2lafw-$(VERSION)
29 TARBALLBINDIR = sigrok-firmware-fx2lafw-bin-$(VERSION)
30
31 all: build-all
32
33 build-all: saleae-logic cwav-usbeeax cwav-usbeedx cwav-usbeesx cypress-fx2 braintechnology-usb-lps
34
35 saleae-logic:
36         @$(MAKE) -C hw/saleae-logic
37
38 cwav-usbeeax:
39         @$(MAKE) -C hw/cwav-usbeeax
40
41 cwav-usbeedx:
42         @$(MAKE) -C hw/cwav-usbeedx
43
44 cwav-usbeesx:
45         @$(MAKE) -C hw/cwav-usbeesx
46
47 cypress-fx2:
48         @$(MAKE) -C hw/cypress-fx2
49
50 braintechnology-usb-lps:
51         @$(MAKE) -C hw/braintechnology-usb-lps
52
53 ChangeLog:
54         @git log > ChangeLog || touch ChangeLog
55
56 dist:
57         @git clone $(REPO) $(TARBALLDIR)
58         @cd $(TARBALLDIR) && $(MAKE) ChangeLog && cd ..
59         @rm -rf $(TARBALLDIR)/.git
60         @tar -c -z -f $(TARBALLDIR).tar.gz $(TARBALLDIR)
61         @rm -rf $(TARBALLDIR)
62
63 distbin: build-all ChangeLog
64         @mkdir $(TARBALLBINDIR)
65         @cp hw/*/build/*.fw $(TARBALLBINDIR)
66         @cp README NEWS ChangeLog $(TARBALLBINDIR)
67         @tar -c -z -f $(TARBALLBINDIR).tar.gz $(TARBALLBINDIR)
68         @rm -rf $(TARBALLBINDIR)
69         @rm -f ChangeLog
70
71 install: build-all
72         @mkdir -p $(DESTDIR)
73         @cp hw/saleae-logic/build/*.fw $(DESTDIR)
74         @cp hw/cwav-usbeeax/build/*.fw $(DESTDIR)
75         @cp hw/cwav-usbeedx/build/*.fw $(DESTDIR)
76         @cp hw/cwav-usbeesx/build/*.fw $(DESTDIR)
77         @cp hw/cypress-fx2/build/*.fw $(DESTDIR)
78         @cp hw/braintechnology-usb-lps/build/*.fw $(DESTDIR)
79
80 clean:
81         @rm -rf hw/saleae-logic/build
82         @rm -rf hw/cwav-usbeeax/build
83         @rm -rf hw/cwav-usbeedx/build
84         @rm -rf hw/cwav-usbeesx/build
85         @rm -rf hw/cypress-fx2/build
86         @rm -rf hw/braintechnology-usb-lps/build
87         @$(MAKE) -C fx2lib clean
88
89 .PHONY: saleae-logic cwav-usbeeax cwav-usbeedx cwav-usbeesx cypress-fx2 braintechnology-usb-lps