From 405cac36ad147e430495c8fa1368573b5c1f1e97 Mon Sep 17 00:00:00 2001 From: Oleg Semyonov Date: Fri, 13 May 2011 16:55:18 +0300 Subject: [PATCH] OP-483: add some platform-specific hooks for ground packaging --- release/Makefile | 27 ++++++++++++++++++++++++--- release/Makefile.linux | 10 ++++++++++ release/Makefile.osx | 10 ++++++++++ release/Makefile.win32 | 11 +++++++++++ 4 files changed, 55 insertions(+), 3 deletions(-) create mode 100644 release/Makefile.linux create mode 100644 release/Makefile.osx create mode 100644 release/Makefile.win32 diff --git a/release/Makefile b/release/Makefile index 0b64856c2..144a0a5dc 100644 --- a/release/Makefile +++ b/release/Makefile @@ -1,6 +1,16 @@ # Set up a default goal .DEFAULT_GOAL := help +# Tried the best to support parallel (-j) builds. But since this Makefile +# uses other Makefiles to build few targets which in turn have similar +# dependencies on uavobjects and other generated files, it is difficult +# to support parallel builds perfectly. +# +# Looks like it works for -j8, but fails for -j (unlimited jobs). +# So probably not a bad idea is to build release in single thread. +# +#.NOTPARALLEL: + # Locate the root of the tree WHEREAMI := $(dir $(lastword $(MAKEFILE_LIST))) ROOT_DIR := $(realpath $(WHEREAMI)/../) @@ -37,8 +47,7 @@ help: @echo " - release packages will be placed in $(RELEASE_DIR)" @echo -# Clean and create release directories -# Use dependence on uavobjects to make sure the build directory exists +# Clean and build uavobjects since all parts depend on them uavobjects: all_clean $(V1) $(MAKE) -C $(ROOT_DIR) $@ @@ -91,7 +100,7 @@ release_fw: | fw_common fw_pwm fw_spektrum # fw_ppm release_blupd: | $(BLUPD_TARGETS) -release_ground: +release_ground: | ground_package .PHONY: help uavobjects all_clean release release_flight release_fw release_blupd release_ground @@ -110,3 +119,15 @@ endif ifneq ($(V),1) MAKEFLAGS += --no-print-directory endif + +# Platform-dependent stuff +PLATFORM := win32 +UNAME := $(shell uname) +ifeq ($(UNAME), Linux) + PLATFORM := linux +endif +ifeq ($(UNAME), Darwin) + PLATFORM := osx +endif + +include $(WHEREAMI)/Makefile.$(PLATFORM) diff --git a/release/Makefile.linux b/release/Makefile.linux new file mode 100644 index 000000000..02e92c941 --- /dev/null +++ b/release/Makefile.linux @@ -0,0 +1,10 @@ +# +# Linux-specific packaging +# + +gcs: uavobjects + $(V1) $(MAKE) -C $(ROOT_DIR) GCS_BUILD_CONF=release $@ + +ground_package: | gcs + +.PHONY: gcs ground_package diff --git a/release/Makefile.osx b/release/Makefile.osx new file mode 100644 index 000000000..c213fbf6e --- /dev/null +++ b/release/Makefile.osx @@ -0,0 +1,10 @@ +# +# MacOSX-specific packaging +# + +gcs: uavobjects + $(V1) $(MAKE) -C $(ROOT_DIR) GCS_BUILD_CONF=release $@ + +ground_package: | gcs + +.PHONY: gcs ground_package diff --git a/release/Makefile.win32 b/release/Makefile.win32 new file mode 100644 index 000000000..aed3eca1f --- /dev/null +++ b/release/Makefile.win32 @@ -0,0 +1,11 @@ +# +# Windows-specific packaging +# + +# Generate GCS installer +gcs_installer: uavobjects + $(V1) $(MAKE) -C $(ROOT_DIR) GCS_BUILD_CONF=release $@ + +ground_package: | gcs_installer + +.PHONY: gcs_installer ground_package