]> sigrok.org Git - sigrok-firmware-fx2lafw.git/commitdiff
Makefile: Add an 'install' target.
authorUwe Hermann <redacted>
Wed, 18 Jul 2012 17:02:29 +0000 (19:02 +0200)
committerUwe Hermann <redacted>
Sun, 22 Jul 2012 16:06:17 +0000 (18:06 +0200)
This installs all *.fw files into /usr/local/share/sigrok-firmware,
which can be overridden via DESTDIR, like this:

 make install DESTDIR=/tmp/foo

Makefile
Makefile.include

index 4c9335f08c1909cc640d5ab7a14c73143e3a9447..0e8783331af24831a04c1de305e91a9f2c13c97e 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
+DESTDIR ?= /usr/local/share/sigrok-firmware
+
+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 +39,20 @@ cypress-fx2:
 braintechnology-usb-lps:
        $(MAKE) -C hw/braintechnology-usb-lps
 
+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
 
index 81c4915a83bc6a4d7e839b7cae0b7eb90cdf8786..c7211d8f06c4ae5d208152a70d0d8645b135e4cc 100644 (file)
 ##
 
 OBJCOPY ?= objcopy
-
 FX2LIBDIR ?= ../../fx2lib
 BUILDDIR ?= build
-
 SDCCFLAGS += -I../../include/
 
 $(BUILDDIR)/$(BASENAME).fw: $(BUILDDIR)/$(BASENAME).ihx