diff --git a/flight/AHRS/Makefile b/flight/AHRS/Makefile index 4b0a6417b..2e4e0ff6b 100644 --- a/flight/AHRS/Makefile +++ b/flight/AHRS/Makefile @@ -399,6 +399,15 @@ size: $(OUTDIR)/$(TARGET).elf_size docs: doxygen $(DOXYGENDIR)/doxygen.cfg +# Install: install binary file with prefix/suffix into install directory +install: $(OUTDIR)/$(TARGET).bin +ifneq ($(INSTALL_DIR),) + @echo $(MSG_INSTALLING) $(call toprel, $<) + $(V1) $(INSTALL) -D $< $(INSTALL_DIR)/$(INSTALL_PFX)$(TARGET)$(INSTALL_SFX).bin +else + $(error INSTALL_DIR must be specified for $@) +endif + # Target: clean project. clean: clean_list @@ -434,6 +443,5 @@ else -include $(shell mkdir $(OUTDIR) 2>/dev/null) $(shell mkdir $(OUTDIR)/dep 2>/dev/null) $(wildcard $(OUTDIR)/dep/*) endif - # Listing of phony targets. -.PHONY : all build clean clean_list program +.PHONY : all build clean clean_list program install diff --git a/flight/CopterControl/Makefile b/flight/CopterControl/Makefile index f499d549a..e7607af74 100644 --- a/flight/CopterControl/Makefile +++ b/flight/CopterControl/Makefile @@ -591,6 +591,15 @@ size: $(OUTDIR)/$(TARGET).elf_size docs: doxygen $(DOXYGENDIR)/doxygen.cfg +# Install: install binary file with prefix/suffix into install directory +install: $(OUTDIR)/$(TARGET).bin +ifneq ($(INSTALL_DIR),) + @echo $(MSG_INSTALLING) $(call toprel, $<) + $(V1) $(INSTALL) -D $< $(INSTALL_DIR)/$(INSTALL_PFX)$(TARGET)$(INSTALL_SFX).bin +else + $(error INSTALL_DIR must be specified for $@) +endif + # Target: clean project. clean: clean_list @@ -630,5 +639,4 @@ else endif # Listing of phony targets. -.PHONY : all build clean clean_list program gencode - +.PHONY : all build clean clean_list program gencode install diff --git a/flight/INS/Makefile b/flight/INS/Makefile index 8e0423a45..5ef6adb86 100644 --- a/flight/INS/Makefile +++ b/flight/INS/Makefile @@ -416,6 +416,15 @@ size: $(OUTDIR)/$(TARGET).elf_size docs: doxygen $(DOXYGENDIR)/doxygen.cfg +# Install: install binary file with prefix/suffix into install directory +install: $(OUTDIR)/$(TARGET).bin +ifneq ($(INSTALL_DIR),) + @echo $(MSG_INSTALLING) $(call toprel, $<) + $(V1) $(INSTALL) -D $< $(INSTALL_DIR)/$(INSTALL_PFX)$(TARGET)$(INSTALL_SFX).bin +else + $(error INSTALL_DIR must be specified for $@) +endif + # Target: clean project. clean: clean_list @@ -450,6 +459,5 @@ else -include $(shell mkdir $(OUTDIR) 2>/dev/null) $(shell mkdir $(OUTDIR)/dep 2>/dev/null) $(wildcard $(OUTDIR)/dep/*) endif - # Listing of phony targets. -.PHONY : all build clean clean_list program +.PHONY : all build clean clean_list program install diff --git a/flight/OpenPilot/Makefile b/flight/OpenPilot/Makefile index 8bb3ed27c..548e6d188 100644 --- a/flight/OpenPilot/Makefile +++ b/flight/OpenPilot/Makefile @@ -570,6 +570,15 @@ size: $(OUTDIR)/$(TARGET).elf_size docs: doxygen $(DOXYGENDIR)/doxygen.cfg +# Install: install binary file with prefix/suffix into install directory +install: $(OUTDIR)/$(TARGET).bin +ifneq ($(INSTALL_DIR),) + @echo $(MSG_INSTALLING) $(call toprel, $<) + $(V1) $(INSTALL) -D $< $(INSTALL_DIR)/$(INSTALL_PFX)$(TARGET)$(INSTALL_SFX).bin +else + $(error INSTALL_DIR must be specified for $@) +endif + # Target: clean project. clean: clean_list @@ -609,5 +618,4 @@ else endif # Listing of phony targets. -.PHONY : all build clean clean_list program gencode - +.PHONY : all build clean clean_list program gencode install diff --git a/flight/PipXtreme/Makefile b/flight/PipXtreme/Makefile index 21d1c3d5a..876678a32 100644 --- a/flight/PipXtreme/Makefile +++ b/flight/PipXtreme/Makefile @@ -439,6 +439,15 @@ size: $(OUTDIR)/$(TARGET).elf_size docs: doxygen $(DOXYGENDIR)/doxygen.cfg +# Install: install binary file with prefix/suffix into install directory +install: $(OUTDIR)/$(TARGET).bin +ifneq ($(INSTALL_DIR),) + @echo $(MSG_INSTALLING) $(call toprel, $<) + $(V1) $(INSTALL) -D $< $(INSTALL_DIR)/$(INSTALL_PFX)$(TARGET)$(INSTALL_SFX).bin +else + $(error INSTALL_DIR must be specified for $@) +endif + # Target: clean project. clean: clean_list @@ -476,4 +485,4 @@ else endif # Listing of phony targets. -.PHONY : all build clean clean_list program +.PHONY : all build clean clean_list program install diff --git a/make/firmware-defs.mk b/make/firmware-defs.mk index f42211c4c..eee2d6e9c 100644 --- a/make/firmware-defs.mk +++ b/make/firmware-defs.mk @@ -10,6 +10,7 @@ OBJDUMP = $(TCHAIN_PREFIX)objdump SIZE = $(TCHAIN_PREFIX)size NM = $(TCHAIN_PREFIX)nm STRIP = $(TCHAIN_PREFIX)strip +INSTALL = install THUMB = -mthumb @@ -43,6 +44,7 @@ MSG_CLEANING := ${quote} CLEAN ${quote} MSG_ASMFROMC := ${quote} AS(C) ${quote} MSG_ASMFROMC_ARM := ${quote} AS(C)-ARM ${quote} MSG_PYMITEINIT := ${quote} PY ${quote} +MSG_INSTALLING := ${quote} INSTALL ${quote} toprel = $(subst $(realpath $(TOP))/,,$(abspath $(1)))