From: Uwe Hermann Date: Wed, 18 Jul 2012 17:02:29 +0000 (+0200) Subject: Makefile: Add an 'install' target. X-Git-Tag: sigrok-firmware-fx2lafw-0.1.0~12 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=a15c1f062cebebe9454f1dd69c6a257d15aeff46;p=sigrok-firmware-fx2lafw.git Makefile: Add an 'install' target. This installs all *.fw files into /usr/local/share/sigrok-firmware, which can be overridden via DESTDIR, like this: make install DESTDIR=/tmp/foo --- diff --git a/Makefile b/Makefile index 4c9335f0..0e878333 100644 --- a/Makefile +++ b/Makefile @@ -18,7 +18,11 @@ ## 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 diff --git a/Makefile.include b/Makefile.include index 81c4915a..c7211d8f 100644 --- a/Makefile.include +++ b/Makefile.include @@ -20,10 +20,8 @@ ## OBJCOPY ?= objcopy - FX2LIBDIR ?= ../../fx2lib BUILDDIR ?= build - SDCCFLAGS += -I../../include/ $(BUILDDIR)/$(BASENAME).fw: $(BUILDDIR)/$(BASENAME).ihx