]> sigrok.org Git - sigrok-firmware-fx2lafw.git/blobdiff - Makefile
s/make/$(MAKE)/ to fix build on FreeBSD.
[sigrok-firmware-fx2lafw.git] / Makefile
index 4c9335f08c1909cc640d5ab7a14c73143e3a9447..e754b04ab04fede9a630e2a56bc7c76e1f8206be 100644 (file)
--- a/Makefile
+++ b/Makefile
 ## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
 ##
 
-all: saleae-logic cwav-usbeeax cwav-usbeesx cypress-fx2 braintechnology-usb-lps
+# sigrok-firmware-fx2lafw package/tarball version number.
+VERSION = "0.1.0"
+
+DESTDIR ?= /usr/local/share/sigrok-firmware
+
+REPO = git://sigrok.git.sourceforge.net/gitroot/sigrok/fx2lafw
+
+TARBALLDIR = sigrok-firmware-fx2lafw-$(VERSION)
+
+all: build-all
+
+build-all: saleae-logic cwav-usbeeax cwav-usbeesx cypress-fx2 braintechnology-usb-lps
 
 saleae-logic:
        $(MAKE) -C hw/saleae-logic
@@ -35,12 +46,29 @@ cypress-fx2:
 braintechnology-usb-lps:
        $(MAKE) -C hw/braintechnology-usb-lps
 
+ChangeLog:
+       @git log > ChangeLog || touch ChangeLog
+
+dist:
+       git clone $(REPO) $(TARBALLDIR)
+       cd $(TARBALLDIR) && $(MAKE) ChangeLog && cd ..
+       @tar -c -z -f $(TARBALLDIR).tar.gz $(TARBALLDIR)
+       @rm -rf $(TARBALLDIR)
+
+install: build-all
+       @mkdir -p $(DESTDIR)
+       @cp hw/saleae-logic/build/*.fw $(DESTDIR)
+       @cp hw/cwav-usbeeax/build/*.fw $(DESTDIR)
+       @cp hw/cwav-usbeesx/build/*.fw $(DESTDIR)
+       @cp hw/cypress-fx2/build/*.fw $(DESTDIR)
+       @cp hw/braintechnology-usb-lps/build/*.fw $(DESTDIR)
+
 clean:
-       rm -rf hw/saleae-logic/build
-       rm -rf hw/cwav-usbeeax/build
-       rm -rf hw/cwav-usbeesx/build
-       rm -rf hw/cypress-fx2/build
-       rm -rf hw/braintechnology-usb-lps/build
+       @rm -rf hw/saleae-logic/build
+       @rm -rf hw/cwav-usbeeax/build
+       @rm -rf hw/cwav-usbeesx/build
+       @rm -rf hw/cypress-fx2/build
+       @rm -rf hw/braintechnology-usb-lps/build
 
 .PHONY: saleae-logic cwav-usbeeax cwav-usbeesx cypress-fx2 braintechnology-usb-lps