From 2d926fe082a7cd53823e1045fc424be25dac549f Mon Sep 17 00:00:00 2001 From: Philippe Renon Date: Thu, 8 Sep 2016 19:58:47 +0200 Subject: [PATCH] LP-404 make Makefile more vendor neutral --- Makefile | 39 ++++++++++---------- ground/gcs/src/plugins/uploader/uploader.pro | 7 ++-- 2 files changed, 24 insertions(+), 22 deletions(-) diff --git a/Makefile b/Makefile index ff952865c..318931eb6 100644 --- a/Makefile +++ b/Makefile @@ -50,9 +50,9 @@ export TOOLS_DIR export BUILD_DIR := $(CURDIR)/build export PACKAGE_DIR := $(BUILD_DIR)/package export DIST_DIR := $(BUILD_DIR)/dist -export OPGCSSYNTHDIR := $(BUILD_DIR)/gcs-synthetics +export GCS_SYNTH_DIR := $(BUILD_DIR)/gcs-synthetics -DIRS := $(DL_DIR) $(TOOLS_DIR) $(BUILD_DIR) $(PACKAGE_DIR) $(DIST_DIR) $(OPGCSSYNTHDIR) +DIRS := $(DL_DIR) $(TOOLS_DIR) $(BUILD_DIR) $(PACKAGE_DIR) $(DIST_DIR) $(GCS_SYNTH_DIR) # Naming for binaries and packaging etc,. export ORG_BIG_NAME := LibrePilot @@ -225,9 +225,9 @@ uavobjects_clean: # When building any of the "all_*" targets, tell all sub makefiles to display # additional details on each line of output to describe which build and target -# that each line applies to. The same applies also to all, opfw_resource, +# that each line applies to. The same applies also to all, fw_resource, # package targets -ifneq ($(strip $(filter all_% all opfw_resource package,$(MAKECMDGOALS))),) +ifneq ($(strip $(filter all_% all fw_resource package,$(MAKECMDGOALS))),) export ENABLE_MSG_EXTRA := yes endif @@ -323,38 +323,39 @@ PACKAGE_FW_TARGETS := fw_coptercontrol fw_oplinkmini fw_revolution fw_osd fw_rev # Rules to generate GCS resources used to embed firmware binaries into the GCS. # They are used later by the vehicle setup wizard to update board firmware. # To open a firmware image use ":/firmware/fw_coptercontrol.opfw" -OPFW_RESOURCE := $(OPGCSSYNTHDIR)/opfw_resource.qrc +FW_RESOURCE := $(GCS_SYNTH_DIR)/fw_resource.qrc ifeq ($(WITH_PREBUILT_FW),) FIRMWARE_DIR := $(FLIGHT_OUT_DIR) # We need to build the FW targets -$(OPFW_RESOURCE): $(PACKAGE_FW_TARGETS) +$(FW_RESOURCE): $(PACKAGE_FW_TARGETS) else FIRMWARE_DIR := $(WITH_PREBUILT_FW) endif -OPFW_FILES := $(foreach fw_targ, $(PACKAGE_FW_TARGETS), $(FIRMWARE_DIR)/$(fw_targ)/$(fw_targ).opfw) -OPFW_CONTENTS := \ +FW_FILES := $(foreach fw_targ, $(PACKAGE_FW_TARGETS), $(FIRMWARE_DIR)/$(fw_targ)/$(fw_targ).opfw) +FW_CONTENTS := \ \ \ - $(foreach fw_file, $(OPFW_FILES), $(call system_path,$(fw_file))) \ + $(foreach fw_file, $(FW_FILES), $(call system_path,$(fw_file))) \ \ -.PHONY: opfw_resource -opfw_resource: $(OPFW_RESOURCE) +.PHONY: fw_resource +fw_resource: $(FW_RESOURCE) +fw_resource: $(FW_RESOURCE) -$(OPFW_RESOURCE): | $(OPGCSSYNTHDIR) - @$(ECHO) Generating OPFW resource file $(call toprel, $@) - $(V1) $(ECHO) $(QUOTE)$(OPFW_CONTENTS)$(QUOTE) > $@ +$(FW_RESOURCE): | $(GCS_SYNTH_DIR) + @$(ECHO) Generating FW resource file $(call toprel, $@) + $(V1) $(ECHO) $(QUOTE)$(FW_CONTENTS)$(QUOTE) > $@ -# If opfw_resource or all firmware are requested, GCS should depend on the resource -ifneq ($(strip $(filter opfw_resource all all_fw all_flight package,$(MAKECMDGOALS))),) -$(GCS_MAKEFILE): $(OPFW_RESOURCE) +# If fw_resource or all firmware are requested, GCS should depend on the resource +ifneq ($(strip $(filter fw_resource all all_fw all_flight package,$(MAKECMDGOALS))),) +$(GCS_MAKEFILE): $(FW_RESOURCE) endif # Packaging targets: package -# - builds all firmware, opfw_resource, gcs +# - builds all firmware, fw_resource, gcs # - copies firmware into a package directory # - calls paltform-specific packaging script @@ -712,7 +713,7 @@ help: @$(ECHO) @$(ECHO) " [Packaging]" @$(ECHO) " package - Build and package the platform-dependent package (no clean)" - @$(ECHO) " opfw_resource - Generate resources to embed firmware binaries into the GCS" + @$(ECHO) " fw_resource - Generate resources to embed firmware binaries into the GCS" @$(ECHO) " dist - Generate source archive for distribution" @$(ECHO) " fw_dist - Generate archive of firmware" @$(ECHO) " install - Install GCS to \"DESTDIR\" with prefix \"prefix\" (Linux only)" diff --git a/ground/gcs/src/plugins/uploader/uploader.pro b/ground/gcs/src/plugins/uploader/uploader.pro index 23990f5a2..0d4c97441 100644 --- a/ground/gcs/src/plugins/uploader/uploader.pro +++ b/ground/gcs/src/plugins/uploader/uploader.pro @@ -63,8 +63,9 @@ FORMS += \ RESOURCES += uploader.qrc -exists( ../../../../../build/gcs-synthetics/opfw_resource.qrc ) { - RESOURCES += ../../../../../build/gcs-synthetics/opfw_resource.qrc +# TODO should use GCS_SYNTH_DIR... but that will break QtCreator +exists( ../../../../../build/gcs-synthetics/fw_resource.qrc ) { + RESOURCES += ../../../../../build/gcs-synthetics/fw_resource.qrc } else { - message("opfw_resource.qrc is not available, automatic firmware upgrades are disabled") + message("fw_resource.qrc is not available, automatic firmware upgrades are disabled") }