1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-29 14:52:12 +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:
Oleg Semyonov 2011-05-13 11:20:53 +03:00
parent bf8939eb30
commit 37868a4c10
6 changed files with 52 additions and 9 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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)))