mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-02-17 07:54:17 +01:00
OP-483: add install target for firmware
make INSTALL_DIR=dir INSTALL_PFX=pfx INSTALL_SFX=sfx install installs binary file into specified install directory adding optional prefix and/or suffix.
This commit is contained in:
parent
bf8939eb30
commit
37868a4c10
@ -399,6 +399,15 @@ size: $(OUTDIR)/$(TARGET).elf_size
|
|||||||
docs:
|
docs:
|
||||||
doxygen $(DOXYGENDIR)/doxygen.cfg
|
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.
|
# Target: clean project.
|
||||||
clean: clean_list
|
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/*)
|
-include $(shell mkdir $(OUTDIR) 2>/dev/null) $(shell mkdir $(OUTDIR)/dep 2>/dev/null) $(wildcard $(OUTDIR)/dep/*)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
# Listing of phony targets.
|
# Listing of phony targets.
|
||||||
.PHONY : all build clean clean_list program
|
.PHONY : all build clean clean_list program install
|
||||||
|
@ -591,6 +591,15 @@ size: $(OUTDIR)/$(TARGET).elf_size
|
|||||||
docs:
|
docs:
|
||||||
doxygen $(DOXYGENDIR)/doxygen.cfg
|
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.
|
# Target: clean project.
|
||||||
clean: clean_list
|
clean: clean_list
|
||||||
|
|
||||||
@ -630,5 +639,4 @@ else
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
# Listing of phony targets.
|
# Listing of phony targets.
|
||||||
.PHONY : all build clean clean_list program gencode
|
.PHONY : all build clean clean_list program gencode install
|
||||||
|
|
||||||
|
@ -416,6 +416,15 @@ size: $(OUTDIR)/$(TARGET).elf_size
|
|||||||
docs:
|
docs:
|
||||||
doxygen $(DOXYGENDIR)/doxygen.cfg
|
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.
|
# Target: clean project.
|
||||||
clean: clean_list
|
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/*)
|
-include $(shell mkdir $(OUTDIR) 2>/dev/null) $(shell mkdir $(OUTDIR)/dep 2>/dev/null) $(wildcard $(OUTDIR)/dep/*)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
# Listing of phony targets.
|
# Listing of phony targets.
|
||||||
.PHONY : all build clean clean_list program
|
.PHONY : all build clean clean_list program install
|
||||||
|
@ -570,6 +570,15 @@ size: $(OUTDIR)/$(TARGET).elf_size
|
|||||||
docs:
|
docs:
|
||||||
doxygen $(DOXYGENDIR)/doxygen.cfg
|
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.
|
# Target: clean project.
|
||||||
clean: clean_list
|
clean: clean_list
|
||||||
|
|
||||||
@ -609,5 +618,4 @@ else
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
# Listing of phony targets.
|
# Listing of phony targets.
|
||||||
.PHONY : all build clean clean_list program gencode
|
.PHONY : all build clean clean_list program gencode install
|
||||||
|
|
||||||
|
@ -439,6 +439,15 @@ size: $(OUTDIR)/$(TARGET).elf_size
|
|||||||
docs:
|
docs:
|
||||||
doxygen $(DOXYGENDIR)/doxygen.cfg
|
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.
|
# Target: clean project.
|
||||||
clean: clean_list
|
clean: clean_list
|
||||||
|
|
||||||
@ -476,4 +485,4 @@ else
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
# Listing of phony targets.
|
# Listing of phony targets.
|
||||||
.PHONY : all build clean clean_list program
|
.PHONY : all build clean clean_list program install
|
||||||
|
@ -10,6 +10,7 @@ OBJDUMP = $(TCHAIN_PREFIX)objdump
|
|||||||
SIZE = $(TCHAIN_PREFIX)size
|
SIZE = $(TCHAIN_PREFIX)size
|
||||||
NM = $(TCHAIN_PREFIX)nm
|
NM = $(TCHAIN_PREFIX)nm
|
||||||
STRIP = $(TCHAIN_PREFIX)strip
|
STRIP = $(TCHAIN_PREFIX)strip
|
||||||
|
INSTALL = install
|
||||||
|
|
||||||
THUMB = -mthumb
|
THUMB = -mthumb
|
||||||
|
|
||||||
@ -43,6 +44,7 @@ MSG_CLEANING := ${quote} CLEAN ${quote}
|
|||||||
MSG_ASMFROMC := ${quote} AS(C) ${quote}
|
MSG_ASMFROMC := ${quote} AS(C) ${quote}
|
||||||
MSG_ASMFROMC_ARM := ${quote} AS(C)-ARM ${quote}
|
MSG_ASMFROMC_ARM := ${quote} AS(C)-ARM ${quote}
|
||||||
MSG_PYMITEINIT := ${quote} PY ${quote}
|
MSG_PYMITEINIT := ${quote} PY ${quote}
|
||||||
|
MSG_INSTALLING := ${quote} INSTALL ${quote}
|
||||||
|
|
||||||
toprel = $(subst $(realpath $(TOP))/,,$(abspath $(1)))
|
toprel = $(subst $(realpath $(TOP))/,,$(abspath $(1)))
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user