1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-19 04:52:12 +01:00

Merge branch 'parched/OP-1792_makefile_tidy' into next

This commit is contained in:
James Duley 2015-04-16 09:35:04 +12:00
commit 80f5a83b39
11 changed files with 177 additions and 246 deletions

167
Makefile
View File

@ -49,6 +49,8 @@ export BUILD_DIR := $(ROOT_DIR)/build
export PACKAGE_DIR := $(ROOT_DIR)/build/package export PACKAGE_DIR := $(ROOT_DIR)/build/package
export DIST_DIR := $(ROOT_DIR)/build/dist export DIST_DIR := $(ROOT_DIR)/build/dist
DIRS = $(DL_DIR) $(TOOLS_DIR) $(BUILD_DIR) $(PACKAGE_DIR) $(DIST_DIR)
# Set up default build configurations (debug | release) # Set up default build configurations (debug | release)
GCS_BUILD_CONF := release GCS_BUILD_CONF := release
UAVOGEN_BUILD_CONF := release UAVOGEN_BUILD_CONF := release
@ -140,20 +142,6 @@ all_clean:
.PONY: clean .PONY: clean
clean: all_clean clean: all_clean
$(DL_DIR):
$(MKDIR) -p $@
$(TOOLS_DIR):
$(MKDIR) -p $@
$(BUILD_DIR):
$(MKDIR) -p $@
$(PACKAGE_DIR):
$(MKDIR) -p $@
$(DIST_DIR):
$(MKDIR) -p $@
############################## ##############################
# #
@ -167,10 +155,12 @@ else
UAVOGEN_SILENT := silent UAVOGEN_SILENT := silent
endif endif
UAVOBJGENERATOR_DIR = $(BUILD_DIR)/uavobjgenerator
DIRS += $(UAVOBJGENERATOR_DIR)
.PHONY: uavobjgenerator .PHONY: uavobjgenerator
uavobjgenerator: uavobjgenerator: | $(UAVOBJGENERATOR_DIR)
$(V1) $(MKDIR) -p $(BUILD_DIR)/$@ $(V1) ( cd $(UAVOBJGENERATOR_DIR) && \
$(V1) ( cd $(BUILD_DIR)/$@ && \
$(QMAKE) $(ROOT_DIR)/ground/uavobjgenerator/uavobjgenerator.pro -spec $(QT_SPEC) -r CONFIG+="$(UAVOGEN_BUILD_CONF) $(UAVOGEN_SILENT)" && \ $(QMAKE) $(ROOT_DIR)/ground/uavobjgenerator/uavobjgenerator.pro -spec $(QT_SPEC) -r CONFIG+="$(UAVOGEN_BUILD_CONF) $(UAVOGEN_SILENT)" && \
$(MAKE) --no-print-directory -w ; \ $(MAKE) --no-print-directory -w ; \
) )
@ -183,8 +173,7 @@ uavobjects: $(addprefix uavobjects_, $(UAVOBJ_TARGETS))
UAVOBJ_XML_DIR := $(ROOT_DIR)/shared/uavobjectdefinition UAVOBJ_XML_DIR := $(ROOT_DIR)/shared/uavobjectdefinition
UAVOBJ_OUT_DIR := $(BUILD_DIR)/uavobject-synthetics UAVOBJ_OUT_DIR := $(BUILD_DIR)/uavobject-synthetics
$(UAVOBJ_OUT_DIR): DIRS += $(UAVOBJ_OUT_DIR)
$(V1) $(MKDIR) -p $@
uavobjects_%: $(UAVOBJ_OUT_DIR) uavobjgenerator uavobjects_%: $(UAVOBJ_OUT_DIR) uavobjgenerator
$(V1) ( cd $(UAVOBJ_OUT_DIR) && \ $(V1) ( cd $(UAVOBJ_OUT_DIR) && \
@ -214,6 +203,8 @@ export OPUAVTALK := $(ROOT_DIR)/flight/uavtalk
export OPUAVSYNTHDIR := $(BUILD_DIR)/uavobject-synthetics/flight export OPUAVSYNTHDIR := $(BUILD_DIR)/uavobject-synthetics/flight
export OPGCSSYNTHDIR := $(BUILD_DIR)/openpilotgcs-synthetics export OPGCSSYNTHDIR := $(BUILD_DIR)/openpilotgcs-synthetics
DIRS += $(OPGCSSYNTHDIR)
# Define supported board lists # Define supported board lists
ALL_BOARDS := coptercontrol oplinkmini revolution osd revoproto simposix discoveryf4bare gpsplatinum ALL_BOARDS := coptercontrol oplinkmini revolution osd revoproto simposix discoveryf4bare gpsplatinum
@ -460,8 +451,9 @@ sim_osx_%: uavobjects_flight
all_ground: openpilotgcs uploader all_ground: openpilotgcs uploader
# Convenience target for the GCS # Convenience target for the GCS
.PHONY: gcs gcs_clean .PHONY: gcs gcs_qmake gcs_clean
gcs: openpilotgcs gcs: openpilotgcs
gcs_qmake: openpilotgcs_qmake
gcs_clean: openpilotgcs_clean gcs_clean: openpilotgcs_clean
ifeq ($(V), 1) ifeq ($(V), 1)
@ -470,32 +462,25 @@ else
GCS_SILENT := silent GCS_SILENT := silent
endif endif
.NOTPARALLEL: OPENPILOTGCS_DIR := $(BUILD_DIR)/openpilotgcs_$(GCS_BUILD_CONF)
.PHONY: openpilotgcs DIRS += $(OPENPILOTGCS_DIR)
openpilotgcs: uavobjects_gcs openpilotgcs_qmake openpilotgcs_make
OPENPILOTGCS_MAKEFILE := $(OPENPILOTGCS_DIR)/Makefile
.PHONY: openpilotgcs_qmake .PHONY: openpilotgcs_qmake
openpilotgcs_qmake: openpilotgcs_qmake $(OPENPILOTGCS_MAKEFILE): | $(OPENPILOTGCS_DIR)
ifeq ($(QMAKE_SKIP),) $(V1) ( cd $(OPENPILOTGCS_DIR) && \
$(V1) $(MKDIR) -p $(BUILD_DIR)/openpilotgcs_$(GCS_BUILD_CONF)
$(V1) ( cd $(BUILD_DIR)/openpilotgcs_$(GCS_BUILD_CONF) && \
$(QMAKE) $(ROOT_DIR)/ground/openpilotgcs/openpilotgcs.pro -spec $(QT_SPEC) -r CONFIG+="$(GCS_BUILD_CONF) $(GCS_SILENT)" $(GCS_QMAKE_OPTS) \ $(QMAKE) $(ROOT_DIR)/ground/openpilotgcs/openpilotgcs.pro -spec $(QT_SPEC) -r CONFIG+="$(GCS_BUILD_CONF) $(GCS_SILENT)" $(GCS_QMAKE_OPTS) \
) )
else
@$(ECHO) "skipping qmake"
endif
.PHONY: openpilotgcs_make .PHONY: openpilotgcs
openpilotgcs_make: openpilotgcs: uavobjects_gcs $(OPENPILOTGCS_MAKEFILE)
$(V1) $(MKDIR) -p $(BUILD_DIR)/openpilotgcs_$(GCS_BUILD_CONF) $(V1) $(MAKE) -w -C $(OPENPILOTGCS_DIR)/$(MAKE_DIR);
$(V1) ( cd $(BUILD_DIR)/openpilotgcs_$(GCS_BUILD_CONF)/$(MAKE_DIR) && \
$(MAKE) -w ; \
)
.PHONY: openpilotgcs_clean .PHONY: openpilotgcs_clean
openpilotgcs_clean: openpilotgcs_clean:
@$(ECHO) " CLEAN $(call toprel, $(BUILD_DIR)/openpilotgcs_$(GCS_BUILD_CONF))" @$(ECHO) " CLEAN $(call toprel, $(OPENPILOTGCS_DIR))"
$(V1) [ ! -d "$(BUILD_DIR)/openpilotgcs_$(GCS_BUILD_CONF)" ] || $(RM) -r "$(BUILD_DIR)/openpilotgcs_$(GCS_BUILD_CONF)" $(V1) [ ! -d "$(OPENPILOTGCS_DIR)" ] || $(RM) -r "$(OPENPILOTGCS_DIR)"
################################ ################################
# #
@ -503,77 +488,27 @@ openpilotgcs_clean:
# #
################################ ################################
.NOTPARALLEL: UPLOADER_DIR := $(BUILD_DIR)/uploader_$(GCS_BUILD_CONF)
.PHONY: uploader DIRS += $(UPLOADER_DIR)
uploader: uploader_qmake uploader_make
UPLOADER_MAKEFILE := $(UPLOADER_DIR)/Makefile
.PHONY: uploader_qmake .PHONY: uploader_qmake
uploader_qmake: uploader_qmake $(UPLOADER_MAKEFILE): | $(UPLOADER_DIR)
ifeq ($(QMAKE_SKIP),) $(V1) ( cd $(UPLOADER_DIR) && \
$(V1) $(MKDIR) -p $(BUILD_DIR)/uploader_$(GCS_BUILD_CONF)
$(V1) ( cd $(BUILD_DIR)/uploader_$(GCS_BUILD_CONF) && \
$(QMAKE) $(ROOT_DIR)/ground/openpilotgcs/src/experimental/USB_UPLOAD_TOOL/upload.pro -spec $(QT_SPEC) -r CONFIG+="$(GCS_BUILD_CONF) $(GCS_SILENT)" $(GCS_QMAKE_OPTS) \ $(QMAKE) $(ROOT_DIR)/ground/openpilotgcs/src/experimental/USB_UPLOAD_TOOL/upload.pro -spec $(QT_SPEC) -r CONFIG+="$(GCS_BUILD_CONF) $(GCS_SILENT)" $(GCS_QMAKE_OPTS) \
) )
else
@$(ECHO) "skipping qmake"
endif
.PHONY: uploader_make .PHONY: uploader
uploader_make: uploader: $(UPLOADER_MAKEFILE)
$(V1) $(MKDIR) -p $(BUILD_DIR)/uploader_$(GCS_BUILD_CONF) $(V1) $(MAKE) -w -C $(UPLOADER_DIR)
$(V1) ( cd $(BUILD_DIR)/uploader_$(GCS_BUILD_CONF)/$(MAKE_DIR) && \
$(MAKE) -w ; \
)
.PHONY: uploader_clean .PHONY: uploader_clean
uploader_clean: uploader_clean:
@$(ECHO) " CLEAN $(call toprel, $(BUILD_DIR)/uploader_$(GCS_BUILD_CONF))" @$(ECHO) " CLEAN $(call toprel, $(UPLOADER_DIR))"
$(V1) [ ! -d "$(BUILD_DIR)/uploader_$(GCS_BUILD_CONF)" ] || $(RM) -r "$(BUILD_DIR)/uploader_$(GCS_BUILD_CONF)" $(V1) [ ! -d "$(UPLOADER_DIR)" ] || $(RM) -r "$(UPLOADER_DIR)"
################################
#
# Android GCS related components
#
################################
# Build the output directory for the Android GCS build
ANDROIDGCS_OUT_DIR := $(BUILD_DIR)/androidgcs
$(ANDROIDGCS_OUT_DIR):
$(V1) $(MKDIR) -p $@
# Build the asset directory for the android assets
ANDROIDGCS_ASSETS_DIR := $(ANDROIDGCS_OUT_DIR)/assets
$(ANDROIDGCS_ASSETS_DIR)/uavos:
$(V1) $(MKDIR) -p $@
ifeq ($(V), 1)
ANT_QUIET :=
ANDROID_SILENT :=
else
ANT_QUIET := -q
ANDROID_SILENT := -s
endif
.PHONY: androidgcs
androidgcs: uavo-collections_java
$(V0) @$(ECHO) " ANDROID $(call toprel, $(ANDROIDGCS_OUT_DIR))"
$(V1) $(MKDIR) -p $(ANDROIDGCS_OUT_DIR)
$(V1) $(ANDROID) $(ANDROID_SILENT) update project \
--target "Google Inc.:Google APIs:$(GOOGLE_API_VERSION)" \
--name androidgcs \
--path ./androidgcs
$(V1) $(ANT) -f ./androidgcs/build.xml \
$(ANT_QUIET) \
-Dout.dir="../$(call toprel, $(ANDROIDGCS_OUT_DIR)/bin)" \
-Dgen.absolute.dir="$(ANDROIDGCS_OUT_DIR)/gen" \
$(ANDROIDGCS_BUILD_CONF)
.PHONY: androidgcs_clean
androidgcs_clean:
@$(ECHO) " CLEAN $(call toprel, $(ANDROIDGCS_OUT_DIR))"
$(V1) [ ! -d "$(ANDROIDGCS_OUT_DIR)" ] || $(RM) -r "$(ANDROIDGCS_OUT_DIR)"
# We want to take snapshots of the UAVOs at each point that they change # We want to take snapshots of the UAVOs at each point that they change
# to allow the GCS to be compatible with as many versions as possible. # to allow the GCS to be compatible with as many versions as possible.
# We always include a pseudo collection called "srctree" which represents # We always include a pseudo collection called "srctree" which represents
@ -695,8 +630,7 @@ ALL_UNITTESTS := logfs math lednotification
# Build the directory for the unit tests # Build the directory for the unit tests
UT_OUT_DIR := $(BUILD_DIR)/unit_tests UT_OUT_DIR := $(BUILD_DIR)/unit_tests
$(UT_OUT_DIR): DIRS += $(UT_OUT_DIR)
$(V1) $(MKDIR) -p $@
.PHONY: all_ut .PHONY: all_ut
all_ut: $(addsuffix _elf, $(addprefix ut_, $(ALL_UNITTESTS))) all_ut: $(addsuffix _elf, $(addprefix ut_, $(ALL_UNITTESTS)))
@ -771,9 +705,8 @@ OPFW_CONTENTS := \
.PHONY: opfw_resource .PHONY: opfw_resource
opfw_resource: $(OPFW_RESOURCE) opfw_resource: $(OPFW_RESOURCE)
$(OPFW_RESOURCE): $(FW_TARGETS) $(OPFW_RESOURCE): $(FW_TARGETS) | $(OPGCSSYNTHDIR)
@$(ECHO) Generating OPFW resource file $(call toprel, $@) @$(ECHO) Generating OPFW resource file $(call toprel, $@)
$(V1) $(MKDIR) -p $(dir $@)
$(V1) $(ECHO) $(QUOTE)$(OPFW_CONTENTS)$(QUOTE) > $@ $(V1) $(ECHO) $(QUOTE)$(OPFW_CONTENTS)$(QUOTE) > $@
# If opfw_resource or all firmware are requested, GCS should depend on the resource # If opfw_resource or all firmware are requested, GCS should depend on the resource
@ -864,9 +797,8 @@ docs_all_clean:
############################## ##############################
.PHONY: build-info .PHONY: build-info
build-info: build-info: | $(BUILD_DIR)
@$(ECHO) " BUILD-INFO $(call toprel, $(BUILD_DIR)/$@.txt)" @$(ECHO) " BUILD-INFO $(call toprel, $(BUILD_DIR)/$@.txt)"
$(V1) $(MKDIR) -p $(BUILD_DIR)
$(V1) $(VERSION_INFO) \ $(V1) $(VERSION_INFO) \
--uavodir=$(ROOT_DIR)/shared/uavobjectdefinition \ --uavodir=$(ROOT_DIR)/shared/uavobjectdefinition \
--template="make/templates/$@.txt" \ --template="make/templates/$@.txt" \
@ -895,6 +827,17 @@ $(DIST_NAME).gz: $(DIST_VER_INFO) .git/index | $(DIST_DIR)
.PHONY: dist .PHONY: dist
dist: $(DIST_NAME).gz dist: $(DIST_NAME).gz
##############################
#
# Directories
#
##############################
$(DIRS):
$(V1) $(MKDIR) -p $@
############################## ##############################
# #
# Help message, the default Makefile goal # Help message, the default Makefile goal
@ -928,7 +871,6 @@ help:
@$(ECHO) " openocd_install - Install the OpenOCD JTAG daemon" @$(ECHO) " openocd_install - Install the OpenOCD JTAG daemon"
@$(ECHO) " stm32flash_install - Install the stm32flash tool for unbricking F1-based boards" @$(ECHO) " stm32flash_install - Install the stm32flash tool for unbricking F1-based boards"
@$(ECHO) " dfuutil_install - Install the dfu-util tool for unbricking F4-based boards" @$(ECHO) " dfuutil_install - Install the dfu-util tool for unbricking F4-based boards"
@$(ECHO) " android_sdk_install - Install the Android SDK tools"
@$(ECHO) " Install all available tools:" @$(ECHO) " Install all available tools:"
@$(ECHO) " all_sdk_install - Install all of above (platform-dependent)" @$(ECHO) " all_sdk_install - Install all of above (platform-dependent)"
@$(ECHO) " build_sdk_install - Install only essential for build tools (platform-dependent)" @$(ECHO) " build_sdk_install - Install only essential for build tools (platform-dependent)"
@ -1000,26 +942,19 @@ help:
@$(ECHO) @$(ECHO)
@$(ECHO) " [GCS]" @$(ECHO) " [GCS]"
@$(ECHO) " gcs - Build the Ground Control System (GCS) application (debug|release)" @$(ECHO) " gcs - Build the Ground Control System (GCS) application (debug|release)"
@$(ECHO) " Skip qmake: QMAKE_SKIP=1"
@$(ECHO) " Compile specific directory: MAKE_DIR=<dir>" @$(ECHO) " Compile specific directory: MAKE_DIR=<dir>"
@$(ECHO) " Example: make gcs QMAKE_SKIP=1 MAKE_DIR=src/plugins/coreplugin" @$(ECHO) " Example: make gcs MAKE_DIR=src/plugins/coreplugin"
@$(ECHO) " gcs_qmake - Run qmake for the Ground Control System (GCS) application (debug|release)"
@$(ECHO) " gcs_clean - Remove the Ground Control System (GCS) application (debug|release)" @$(ECHO) " gcs_clean - Remove the Ground Control System (GCS) application (debug|release)"
@$(ECHO) " Supported build configurations: GCS_BUILD_CONF=debug|release (default is $(GCS_BUILD_CONF))" @$(ECHO) " Supported build configurations: GCS_BUILD_CONF=debug|release (default is $(GCS_BUILD_CONF))"
@$(ECHO) @$(ECHO)
@$(ECHO) " [Uploader Tool]" @$(ECHO) " [Uploader Tool]"
@$(ECHO) " uploader - Build the serial uploader tool (debug|release)" @$(ECHO) " uploader - Build the serial uploader tool (debug|release)"
@$(ECHO) " Skip qmake: QMAKE_SKIP=1" @$(ECHO) " uploader_qmake - Run qmake for the serial uploader tool (debug|release)"
@$(ECHO) " Example: make uploader QMAKE_SKIP=1"
@$(ECHO) " uploader_clean - Remove the serial uploader tool (debug|release)" @$(ECHO) " uploader_clean - Remove the serial uploader tool (debug|release)"
@$(ECHO) " Supported build configurations: GCS_BUILD_CONF=debug|release (default is $(GCS_BUILD_CONF))" @$(ECHO) " Supported build configurations: GCS_BUILD_CONF=debug|release (default is $(GCS_BUILD_CONF))"
@$(ECHO) @$(ECHO)
@$(ECHO) @$(ECHO)
@$(ECHO) " [AndroidGCS]"
@$(ECHO) " androidgcs - Build the Android Ground Control System (GCS) application"
@$(ECHO) " androidgcs_install - Use ADB to install the Android GCS application"
@$(ECHO) " androidgcs_run - Run the Android GCS application"
@$(ECHO) " androidgcs_clean - Remove the Android GCS application"
@$(ECHO)
@$(ECHO) " [UAVObjects]" @$(ECHO) " [UAVObjects]"
@$(ECHO) " uavobjects - Generate source files from the UAVObject definition XML files" @$(ECHO) " uavobjects - Generate source files from the UAVObject definition XML files"
@$(ECHO) " uavobjects_test - Parse xml-files - check for valid, duplicate ObjId's, ..." @$(ECHO) " uavobjects_test - Parse xml-files - check for valid, duplicate ObjId's, ..."

View File

@ -1,36 +1,10 @@
include(openpilotgcs.pri) include(openpilotgcs.pri)
TEMPLATE = subdirs TEMPLATE = aux
# Copy Qt runtime libraries into the build directory (to run or package) # Copy Qt runtime libraries into the build directory (to run or package)
equals(copyqt, 1) { equals(copyqt, 1) {
# Copy QtQuick2 complete directories
# Some of these directories have a lot of files
# Easier to copy everything
QT_QUICK2_DIRS = QtQuick/Controls \
QtQuick/Dialogs \
QtQuick/Layouts \
QtQuick/LocalStorage \
QtQuick/Particles.2 \
QtQuick/PrivateWidgets \
QtQuick/Window.2 \
QtQuick/XmlListModel \
QtQuick.2
# create QtQuick directory
data_copy.commands += -@$(MKDIR) $$targetPath(\"$$GCS_QT_QML_PATH/QtQuick\") $$addNewline()
for(dir, QT_QUICK2_DIRS) {
data_copy.commands += @rm -rf $$targetPath(\"$$GCS_QT_QML_PATH/$$dir\") $$addNewline()
data_copy.commands += $(COPY_DIR) $$targetPath(\"$$[QT_INSTALL_QML]/$$dir\") $$targetPath(\"$$GCS_QT_QML_PATH/$$dir\") $$addNewline()
}
data_copy.target = FORCE
QMAKE_EXTRA_TARGETS += data_copy
linux { linux {
QT_LIBS = libQt5Core.so.5 \ QT_LIBS = libQt5Core.so.5 \
libQt5Gui.so.5 \ libQt5Gui.so.5 \
libQt5Widgets.so.5 \ libQt5Widgets.so.5 \
@ -56,22 +30,11 @@ equals(copyqt, 1) {
libicui18n.so.53 \ libicui18n.so.53 \
libicuuc.so.53 \ libicuuc.so.53 \
libicudata.so.53 libicudata.so.53
data_copy.commands += -@$(MKDIR) $$targetPath(\"$$GCS_QT_LIBRARY_PATH\") $$addNewline()
for(lib, QT_LIBS) { for(lib, QT_LIBS) {
data_copy.commands += $(COPY_FILE) $$targetPath(\"$$[QT_INSTALL_LIBS]/$$lib\") $$targetPath(\"$$GCS_QT_LIBRARY_PATH/$$lib\") $$addNewline() addCopyFileTarget($${lib},$$[QT_INSTALL_LIBS],$${GCS_QT_LIBRARY_PATH})
} }
# create Qt plugin directories QT_PLUGINS = iconengines/libqsvgicon.so \
QT_PLUGIN_DIRS = iconengines \
imageformats \
platforms \
mediaservice \
sqldrivers
for(dir, QT_PLUGIN_DIRS) {
data_copy.commands += -@$(MKDIR) $$targetPath(\"$$GCS_QT_PLUGINS_PATH/$$dir\") $$addNewline()
}
QT_PLUGIN_LIBS = iconengines/libqsvgicon.so \
imageformats/libqgif.so \ imageformats/libqgif.so \
imageformats/libqico.so \ imageformats/libqico.so \
imageformats/libqjpeg.so \ imageformats/libqjpeg.so \
@ -82,9 +45,6 @@ equals(copyqt, 1) {
mediaservice/libgstmediaplayer.so \ mediaservice/libgstmediaplayer.so \
platforms/libqxcb.so \ platforms/libqxcb.so \
sqldrivers/libqsqlite.so sqldrivers/libqsqlite.so
for(lib, QT_PLUGIN_LIBS) {
data_copy.commands += $(COPY_FILE) $$targetPath(\"$$[QT_INSTALL_PLUGINS]/$$lib\") $$targetPath(\"$$GCS_QT_PLUGINS_PATH/$$lib\") $$addNewline()
}
} }
win32 { win32 {
@ -106,7 +66,6 @@ equals(copyqt, 1) {
Qt5Script$${DS}.dll \ Qt5Script$${DS}.dll \
Qt5Concurrent$${DS}.dll \ Qt5Concurrent$${DS}.dll \
Qt5PrintSupport$${DS}.dll \ Qt5PrintSupport$${DS}.dll \
Qt5OpenGL$${DS}.dll \
Qt5SerialPort$${DS}.dll \ Qt5SerialPort$${DS}.dll \
Qt5Multimedia$${DS}.dll \ Qt5Multimedia$${DS}.dll \
Qt5MultimediaWidgets$${DS}.dll \ Qt5MultimediaWidgets$${DS}.dll \
@ -120,22 +79,25 @@ equals(copyqt, 1) {
libstdc++-6.dll \ libstdc++-6.dll \
libwinpthread-1.dll libwinpthread-1.dll
for(dll, QT_DLLS) { for(dll, QT_DLLS) {
data_copy.commands += $(COPY_FILE) $$targetPath(\"$$[QT_INSTALL_BINS]/$$dll\") $$targetPath(\"$$GCS_APP_PATH/$$dll\") $$addNewline() addCopyFileTarget($${dll},$$[QT_INSTALL_BINS],$${GCS_APP_PATH})
} }
# create Qt plugin directories # copy OpenSSL DLLs
QT_PLUGIN_DIRS = iconengines \ OPENSSL_DLLS = \
imageformats \ ssleay32.dll \
platforms \ libeay32.dll
mediaservice \ for(dll, OPENSSL_DLLS) {
sqldrivers \ addCopyFileTarget($${dll},$${OPENSSL_DIR},$${GCS_APP_PATH})
opengl32_32
for(dir, QT_PLUGIN_DIRS) {
data_copy.commands += -@$(MKDIR) $$targetPath(\"$$GCS_APP_PATH/$$dir\") $$addNewline()
} }
# copy Qt plugin DLLs # copy OpenGL DLL
QT_PLUGIN_DLLS = iconengines/qsvgicon$${DS}.dll \ OPENGL_DLLS = \
opengl32_32/opengl32.dll
for(dll, OPENGL_DLLS) {
addCopyFileTarget($${dll},$${MESAWIN_DIR},$${GCS_APP_PATH})
}
QT_PLUGINS = iconengines/qsvgicon$${DS}.dll \
imageformats/qgif$${DS}.dll \ imageformats/qgif$${DS}.dll \
imageformats/qico$${DS}.dll \ imageformats/qico$${DS}.dll \
imageformats/qjpeg$${DS}.dll \ imageformats/qjpeg$${DS}.dll \
@ -145,23 +107,25 @@ equals(copyqt, 1) {
platforms/qwindows$${DS}.dll \ platforms/qwindows$${DS}.dll \
mediaservice/dsengine$${DS}.dll \ mediaservice/dsengine$${DS}.dll \
sqldrivers/qsqlite$${DS}.dll sqldrivers/qsqlite$${DS}.dll
for(dll, QT_PLUGIN_DLLS) {
data_copy.commands += $(COPY_FILE) $$targetPath(\"$$[QT_INSTALL_PLUGINS]/$$dll\") $$targetPath(\"$$GCS_APP_PATH/$$dll\") $$addNewline()
} }
# copy OpenSSL DLLs for(plugin, QT_PLUGINS) {
OPENSSL_DLLS = \ addCopyFileTarget($${plugin},$$[QT_INSTALL_PLUGINS],$${GCS_QT_PLUGINS_PATH})
ssleay32.dll \
libeay32.dll
for(dll, OPENSSL_DLLS) {
data_copy.commands += $(COPY_FILE) $$targetPath(\"$${OPENSSL_DIR}/$$dll\") $$targetPath(\"$$GCS_APP_PATH/$$dll\") $$addNewline()
} }
# copy OpenGL DLL # Copy QtQuick2 complete directories
OPENGL_DLLS = \ # Some of these directories have a lot of files
opengl32_32/opengl32.dll # Easier to copy everything
for(dll, OPENGL_DLLS) { QT_QUICK2_DIRS = QtQuick/Controls \
data_copy.commands += $(COPY_FILE) $$targetPath(\"$${MESAWIN_DIR}/$$dll\") $$targetPath(\"$$GCS_APP_PATH/$$dll\") $$addNewline() QtQuick/Dialogs \
} QtQuick/Layouts \
QtQuick/LocalStorage \
QtQuick/Particles.2 \
QtQuick/PrivateWidgets \
QtQuick/Window.2 \
QtQuick/XmlListModel \
QtQuick.2
for(dir, QT_QUICK2_DIRS) {
addCopyDirTarget($${dir},$$[QT_INSTALL_QML],$${GCS_QT_QML_PATH})
} }
} }

View File

@ -32,6 +32,57 @@ defineReplace(qtLibraryName) {
return($$RET) return($$RET)
} }
defineTest(addCopyFileTarget) {
file = $$1
src = $$2/$$1
dest = $$3/$$1
$${file}.target = $$dest
$${file}.depends = $$src
# create directory. Better would be an order only dependency
$${file}.commands = -@$(MKDIR) \"$$targetPath($$dirname(dest))\" $$addNewline()
$${file}.commands += $(COPY_FILE) \"$$targetPath($$src)\" \"$$targetPath($$dest)\"
QMAKE_EXTRA_TARGETS += $$file
POST_TARGETDEPS += $$eval($${file}.target)
export($${file}.target)
export($${file}.depends)
export($${file}.commands)
export(QMAKE_EXTRA_TARGETS)
export(POST_TARGETDEPS)
return(true)
}
defineTest(addCopyDirTarget) {
dir = $$1
src = $$2/$$1
dest = $$3/$$1
$${dir}.target = $$dest
$${dir}.depends = $$src
# Windows does not update directory timestamp if files are modified
win32: $${dir}.depends += FORCE
$${dir}.commands = @rm -rf \"$$targetPath($$dest)\" $$addNewline()
# create directory. Better would be an order only dependency
$${dir}.commands += -@$(MKDIR) \"$$targetPath($$dirname(dest))\" $$addNewline()
$${dir}.commands += $(COPY_DIR) \"$$targetPath($$src)\" \"$$targetPath($$dest)\"
QMAKE_EXTRA_TARGETS += $$dir
POST_TARGETDEPS += $$eval($${dir}.target)
export($${dir}.target)
export($${dir}.depends)
export($${dir}.commands)
export(QMAKE_EXTRA_TARGETS)
export(POST_TARGETDEPS)
return(true)
}
# For use in custom compilers which just copy files # For use in custom compilers which just copy files
win32:i_flag = i win32:i_flag = i
defineReplace(stripSrcDir) { defineReplace(stripSrcDir) {
@ -119,6 +170,8 @@ macx {
contains(TEMPLATE, vc.*)|contains(TEMPLATE_PREFIX, vc):vcproj = 1 contains(TEMPLATE, vc.*)|contains(TEMPLATE_PREFIX, vc):vcproj = 1
GCS_APP_TARGET = openpilotgcs GCS_APP_TARGET = openpilotgcs
GCS_QT_PLUGINS_PATH = $$GCS_APP_PATH
GCS_QT_QML_PATH = $$GCS_APP_PATH GCS_QT_QML_PATH = $$GCS_APP_PATH
copyqt = $$copydata copyqt = $$copydata

View File

@ -0,0 +1,13 @@
include(../openpilotgcs.pri)
TEMPLATE = aux
DATACOLLECTIONS = cloudconfig default_configurations dials models pfd sounds diagrams mapicons stylesheets
equals(copydata, 1) {
for(dir, DATACOLLECTIONS) {
exists($$GCS_SOURCE_TREE/share/openpilotgcs/$$dir) {
addCopyDirTarget($$dir, $$GCS_SOURCE_TREE/share/openpilotgcs, $$GCS_DATA_PATH)
}
}
}

View File

@ -1,26 +1,5 @@
include(../openpilotgcs.pri)
TEMPLATE = subdirs TEMPLATE = subdirs
SUBDIRS = openpilotgcs/translations
DATACOLLECTIONS = cloudconfig default_configurations dials models pfd sounds diagrams mapicons stylesheets SUBDIRS = openpilotgcs/translations copydata
equals(copydata, 1) { copydata.file = copydata.pro
for(dir, DATACOLLECTIONS) {
exists($$GCS_SOURCE_TREE/share/openpilotgcs/$$dir) {
# Qt make macros (CHK_DIR_EXISTS, COPY_DIR, etc) have different syntax. They cannot be used
# reliably to copy subdirectories in two different Windows environments (bash and cmd/QtCreator).
# So undocumented QMAKE_SH variable is used to find out the real environment.
!isEmpty(QMAKE_SH) {
# sh environment (including Windows bash)
data_copy.commands += $(MKDIR) $$targetPath(\"$$GCS_DATA_PATH/$$dir\") $$addNewline()
data_copy.commands += $(COPY_DIR) $$targetPath(\"$$GCS_SOURCE_TREE/share/openpilotgcs/$$dir\") $$targetPath(\"$$GCS_DATA_PATH/\") $$addNewline()
} else {
# native Windows cmd environment
data_copy.commands += $(COPY_DIR) $$targetPath(\"$$GCS_SOURCE_TREE/share/openpilotgcs/$$dir\") $$targetPath(\"$$GCS_DATA_PATH/$$dir\") $$addNewline()
}
}
}
data_copy.target = FORCE
QMAKE_EXTRA_TARGETS += data_copy
}

View File

@ -1,18 +1,10 @@
equals(copydata, 1) { equals(copydata, 1) {
win32 { win32 {
# copy SDL DLL # copy SDL DLL
SDL_DLLS = \ SDL_DLLS = \
SDL.dll SDL.dll
for(dll, SDL_DLLS) { for(dll, SDL_DLLS) {
data_copy.commands += $(COPY_FILE) $$targetPath(\"$${SDL_DIR}/bin/$$dll\") $$targetPath(\"$$GCS_APP_PATH/$$dll\") $$addNewline() addCopyFileTarget($${dll},$${SDL_DIR}/bin,$${GCS_APP_PATH})
} }
# add make target
POST_TARGETDEPS += copydata
data_copy.target = copydata
QMAKE_EXTRA_TARGETS += data_copy
} }
} }

View File

@ -35,8 +35,6 @@ equals(copydata, 1) {
# Windows release only # Windows release only
win32:CONFIG(release, debug|release) { win32:CONFIG(release, debug|release) {
data_copy.commands += -@$(MKDIR) $$targetPath(\"$$PLUGIN_DIR\") $$addNewline()
# resources and sample configuration # resources and sample configuration
PLUGIN_RESOURCES = \ PLUGIN_RESOURCES = \
cc_off.tga \ cc_off.tga \
@ -46,7 +44,7 @@ equals(copydata, 1) {
cc_plugin.ini \ cc_plugin.ini \
plugin.txt plugin.txt
for(res, PLUGIN_RESOURCES) { for(res, PLUGIN_RESOURCES) {
data_copy.commands += $(COPY_FILE) $$targetPath(\"$$RES_DIR/$$res\") $$targetPath(\"$$PLUGIN_DIR/$$res\") $$addNewline() addCopyFileTarget($${res},$${RES_DIR},$${PLUGIN_DIR})
} }
# Qt DLLs # Qt DLLs
@ -54,7 +52,7 @@ equals(copydata, 1) {
Qt5Core.dll \ Qt5Core.dll \
Qt5Network.dll Qt5Network.dll
for(dll, QT_DLLS) { for(dll, QT_DLLS) {
data_copy.commands += $(COPY_FILE) $$targetPath(\"$$[QT_INSTALL_BINS]/$$dll\") $$targetPath(\"$$SIM_DIR/$$dll\") $$addNewline() addCopyFileTarget($${dll},$$[QT_INSTALL_BINS],$${SIM_DIR})
} }
# MinGW DLLs # MinGW DLLs
@ -62,10 +60,7 @@ equals(copydata, 1) {
# libgcc_s_dw2-1.dll \ # libgcc_s_dw2-1.dll \
# mingwm10.dll # mingwm10.dll
#for(dll, MINGW_DLLS) { #for(dll, MINGW_DLLS) {
# data_copy.commands += $(COPY_FILE) $$targetPath(\"$$(QTMINGW)/$$dll\") $$targetPath(\"$$SIM_DIR/$$dll\") $$addNewline() # addCopyFileTarget($${dll},$$(QTMINGW),$${SIM_DIR})
#} #}
data_copy.target = FORCE
QMAKE_EXTRA_TARGETS += data_copy
} }
} }

View File

@ -3,7 +3,7 @@
# Copyright (c) 2009-2013, The OpenPilot Team, http://www.openpilot.org # Copyright (c) 2009-2013, The OpenPilot Team, http://www.openpilot.org
# #
TEMPLATE = subdirs TEMPLATE = aux
# Some handy defines # Some handy defines
defineReplace(targetPath) { defineReplace(targetPath) {
@ -64,5 +64,6 @@ win32 {
uavobjects.commands += -spec $$SPEC CONFIG+=$${BUILD_CONFIG} -r $$addNewline() uavobjects.commands += -spec $$SPEC CONFIG+=$${BUILD_CONFIG} -r $$addNewline()
} }
uavobjects.target = FORCE uavobjects.depends = FORCE
QMAKE_EXTRA_TARGETS += uavobjects QMAKE_EXTRA_TARGETS += uavobjects
PRE_TARGETDEPS += uavobjects

View File

@ -136,7 +136,7 @@ endef
define OPFW_TEMPLATE define OPFW_TEMPLATE
FORCE: FORCE:
$(1).firmware_info.c: $(1) $(ROOT_DIR)/flight/templates/firmware_info.c.template FORCE $(1).firmware_info.c: $(1) $(ROOT_DIR)/flight/templates/firmware_info.c.template $(ROOT_DIR)/shared/uavobjectdefinition
@$(ECHO) $(MSG_FWINFO) $$(call toprel, $$@) @$(ECHO) $(MSG_FWINFO) $$(call toprel, $$@)
$(V1) $(VERSION_INFO) \ $(V1) $(VERSION_INFO) \
--template=$(ROOT_DIR)/flight/templates/firmware_info.c.template \ --template=$(ROOT_DIR)/flight/templates/firmware_info.c.template \

View File

@ -776,8 +776,8 @@ ifeq ($(UNAME), Windows)
$(eval $(call TOOL_INSTALL_TEMPLATE,openssl,$(OPENSSL_DIR),$(OPENSSL_URL),,$(notdir $(OPENSSL_URL)))) $(eval $(call TOOL_INSTALL_TEMPLATE,openssl,$(OPENSSL_DIR),$(OPENSSL_URL),,$(notdir $(OPENSSL_URL))))
ifeq ($(shell [ -d "$(OPENSSL_DIR)" ] && $(ECHO) "exists"), exists) ifeq ($(shell [ -d "$(OPENSSL_DIR)" ] && $(ECHO) "exists"), exists)
export OPENSSL := "$(OPENSSL_DIR)/bin/openssl" export OPENSSL := $(OPENSSL_DIR)/bin/openssl
export OPENSSL_DIR := "$(OPENSSL_DIR)" export OPENSSL_DIR
else else
# not installed, hope it's in the path... # not installed, hope it's in the path...
# $(info $(EMPTY) WARNING $(call toprel, $(OPENSSL_DIR)) not found (make openssl_install), using system PATH) # $(info $(EMPTY) WARNING $(call toprel, $(OPENSSL_DIR)) not found (make openssl_install), using system PATH)

View File

@ -316,7 +316,6 @@ SectionEnd
!insertmacro MUI_DESCRIPTION_TEXT ${InSecResources} $(DESC_InSecResources) !insertmacro MUI_DESCRIPTION_TEXT ${InSecResources} $(DESC_InSecResources)
!insertmacro MUI_DESCRIPTION_TEXT ${InSecSounds} $(DESC_InSecSounds) !insertmacro MUI_DESCRIPTION_TEXT ${InSecSounds} $(DESC_InSecSounds)
!insertmacro MUI_DESCRIPTION_TEXT ${InSecLocalization} $(DESC_InSecLocalization) !insertmacro MUI_DESCRIPTION_TEXT ${InSecLocalization} $(DESC_InSecLocalization)
!insertmacro MUI_DESCRIPTION_TEXT ${InSecFirmware} $(DESC_InSecFirmware)
!insertmacro MUI_DESCRIPTION_TEXT ${InSecUtilities} $(DESC_InSecUtilities) !insertmacro MUI_DESCRIPTION_TEXT ${InSecUtilities} $(DESC_InSecUtilities)
!insertmacro MUI_DESCRIPTION_TEXT ${InSecDrivers} $(DESC_InSecDrivers) !insertmacro MUI_DESCRIPTION_TEXT ${InSecDrivers} $(DESC_InSecDrivers)
!insertmacro MUI_DESCRIPTION_TEXT ${InSecInstallDrivers} $(DESC_InSecInstallDrivers) !insertmacro MUI_DESCRIPTION_TEXT ${InSecInstallDrivers} $(DESC_InSecInstallDrivers)