From 5413cb065ffaf7632d5b7cd27af925f6fbd9fcb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20Ka=CC=88fer?= Date: Thu, 30 Oct 2014 11:02:55 -0400 Subject: [PATCH 1/4] restructure Makefile to avoid concurrent makefile generation --- Makefile | 85 +++++++++++++++++++++++++++++++++----------------------- 1 file changed, 50 insertions(+), 35 deletions(-) diff --git a/Makefile b/Makefile index c4d42bfd4..73e4c8799 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,7 @@ PLATFORM ?= osx endif PLATFORM ?= linux - +.PHONY: all all: mbgl-core mbgl-platform mbgl-headless config.gypi: configure @@ -17,28 +17,60 @@ config.gypi: configure config-ios.gypi: configure MASON_PLATFORM=ios ./configure config-ios.gypi -# Builds the regular library -mbgl-core: config.gypi mapboxgl.gyp - deps/run_gyp mapboxgl.gyp -Iconfig.gypi -Dplatform=$(PLATFORM) --depth=. -Goutput_dir=.. --generator-output=./build/mbgl -f make +#### Library builds ############################################################ + +.PHONY: mbgl-core +mbgl-core: build/mbgl/Makefile $(MAKE) -C build/mbgl BUILDTYPE=$(BUILDTYPE) V=$(V) mbgl-core -mbgl-platform: config.gypi mapboxgl.gyp - deps/run_gyp mapboxgl.gyp -Iconfig.gypi -Dplatform=$(PLATFORM) --depth=. -Goutput_dir=.. --generator-output=./build/mbgl -f make +.PHONY: mbgl-platform +mbgl-platform: build/mbgl/Makefile $(MAKE) -C build/mbgl BUILDTYPE=$(BUILDTYPE) V=$(V) mbgl-$(PLATFORM) -mbgl-headless: config.gypi mapboxgl.gyp - deps/run_gyp mapboxgl.gyp -Iconfig.gypi -Dplatform=$(PLATFORM) --depth=. -Goutput_dir=.. --generator-output=./build/mbgl -f make +.PHONY: mbgl-headless +mbgl-headless: build/mbgl/Makefile $(MAKE) -C build/mbgl BUILDTYPE=$(BUILDTYPE) V=$(V) mbgl-headless -install: config.gypi mapboxgl.gyp - deps/run_gyp mapboxgl.gyp -Iconfig.gypi -Dplatform=$(PLATFORM) -Dinstall_prefix=$(PREFIX) --depth=. -Goutput_dir=.. --generator-output=./build/mbgl -f make +.PHONY: install +install: build/mbgl/Makefile $(MAKE) -C build/mbgl BUILDTYPE=$(BUILDTYPE) V=$(V) install -##### Test cases ############################################################### +#### Build scripts ############################################################# -build/test/Makefile: src common config.gypi test/test.gyp +.PHONY: build/mbgl/Makefile +build/mbgl/Makefile: mapboxgl.gyp config.gypi + deps/run_gyp mapboxgl.gyp -Iconfig.gypi -Dplatform=$(PLATFORM) -Dinstall_prefix=$(PREFIX) --depth=. -Goutput_dir=.. --generator-output=./build/mbgl -f make + +.PHONY: build/test/Makefile +build/test/Makefile: test/test.gyp config.gypi deps/run_gyp test/test.gyp -Iconfig.gypi -Dplatform=$(PLATFORM) --depth=. -Goutput_dir=.. --generator-output=./build/test -f make +.PHONY: build/linux/Makefile +build/linux/Makefile: linux/mapboxgl-app.gyp config.gypi + deps/run_gyp linux/mapboxgl-app.gyp -Iconfig.gypi -Dplatform=linux --depth=. -Goutput_dir=.. --generator-output=./build/linux -f make + +.PHONY: build/macosx/Makefile +build/macosx/Makefile: macosx/mapboxgl-app.gyp config.gypi + deps/run_gyp macosx/mapboxgl-app.gyp -Iconfig.gypi -Dplatform=osx --depth=. -Goutput_dir=.. --generator-output=./build/macosx -f make + +.PHONY: build/test/test.xcodeproj +build/test/test.xcodeproj: test/test.gyp config.gypi + deps/run_gyp test/test.gyp -Iconfig.gypi -Dplatform=osx --depth=. -Goutput_dir=.. --generator-output=./build -f xcode + +.PHONY: build/macosx/mapboxgl-app.xcodeproj +build/macosx/mapboxgl-app.xcodeproj: macosx/mapboxgl-app.gyp config.gypi + deps/run_gyp macosx/mapboxgl-app.gyp -Iconfig.gypi -Dplatform=osx --depth=. --generator-output=./build -f xcode + +.PHONY: build/ios/mapbox-gl-cocoa/app/mapboxgl-app.xcodeproj +build/ios/mapbox-gl-cocoa/app/mapboxgl-app.xcodeproj: ios/mapbox-gl-cocoa/app/mapboxgl-app.gyp config-ios.gypi + deps/run_gyp ios/mapbox-gl-cocoa/app/mapboxgl-app.gyp -Iconfig-ios.gypi -Dplatform=ios --depth=. --generator-output=./build -f xcode + +.PHONY: build/linux/mapboxgl-app.xcodeproj +build/linux/mapboxgl-app.xcodeproj: linux/mapboxgl-app.gyp config.gypi + deps/run_gyp linux/mapboxgl-app.gyp -Iconfig.gypi -Dplatform=linux --depth=. --generator-output=./build -f xcode + +##### Test cases ############################################################### + test: build/test/Makefile $(MAKE) -C build/test BUILDTYPE=$(BUILDTYPE) V=$(V) test @@ -47,27 +79,22 @@ test_%: build/test/Makefile (cd build/$(BUILDTYPE) && exec ./test_$*) # build Mac OS X project for Xcode -xtest: config.gypi clear_xcode_cache - deps/run_gyp test/test.gyp -Iconfig.gypi -Dplatform=osx --depth=. -Goutput_dir=.. --generator-output=./build -f xcode +xtest: build/test/test.xcodeproj open ./build/test/test.xcodeproj ##### Makefile builds ########################################################## # Builds the linux app with make. -linux: config.gypi linux/mapboxgl-app.gyp - deps/run_gyp linux/mapboxgl-app.gyp -Iconfig.gypi -Dplatform=linux --depth=. -Goutput_dir=.. --generator-output=./build/linux -f make +linux: build/linux/Makefile $(MAKE) -C build/linux BUILDTYPE=$(BUILDTYPE) V=$(V) linuxapp # Executes the Linux binary run-linux: linux (cd build/$(BUILDTYPE) && ./mapbox-gl) - - # Builds the OS X app with make. -osx: config.gypi macosx/mapboxgl-app.gyp - deps/run_gyp macosx/mapboxgl-app.gyp -Iconfig.gypi -Dplatform=osx --depth=. -Goutput_dir=.. --generator-output=./build/macosx -f make +osx: build/macosx/Makefile $(MAKE) -C build/macosx BUILDTYPE=$(BUILDTYPE) V=$(V) osxapp # Executes the OS X binary @@ -87,23 +114,14 @@ clear_xcode_cache: find ~/Library/Developer/Xcode/DerivedData/mapboxgl-app-* -mtime +1 | xargs rm -rf; \ fi -# build Mac OS X project for Xcode -xproj-cli: config.gypi macosx/mapboxgl-app.gyp clear_xcode_cache - deps/run_gyp macosx/mapboxgl-app.gyp -Iconfig.gypi -Dplatform=osx --depth=. --generator-output=./build -f xcode - -xproj: xproj-cli +xproj: build/macosx/mapboxgl-app.xcodeproj open ./build/macosx/mapboxgl-app.xcodeproj -# build iOS project for Xcode -iproj-cli: config-ios.gypi ios/mapbox-gl-cocoa/app/mapboxgl-app.gyp clear_xcode_cache - deps/run_gyp ios/mapbox-gl-cocoa/app/mapboxgl-app.gyp -Iconfig-ios.gypi -Dplatform=ios --depth=. --generator-output=./build -f xcode - -iproj: iproj-cli +iproj: build/ios/mapbox-gl-cocoa/app/mapboxgl-app.xcodeproj open ./build/ios/mapbox-gl-cocoa/app/mapboxgl-app.xcodeproj # build Linux project for Xcode (Runs on Mac OS X too, but without platform-specific code) -lproj: config.gypi linux/mapboxgl-app.gyp clear_xcode_cache - deps/run_gyp linux/mapboxgl-app.gyp -Iconfig.gypi -Dplatform=linux --depth=. --generator-output=./build -f xcode +lproj: build/linux/mapboxgl-app.xcodeproj open ./build/linux/mapboxgl-app.xcodeproj @@ -117,6 +135,3 @@ clean: clear_xcode_cache distclean: clean -rm -rf ./mason_packages - -.PHONY: mbgl-core install test linux clear_xcode_cache build/test/Makefile clean distclean -# DO NOT DELETE From 995bbda1f7b4cb4a6c55ff75c7180d23cde2a453 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20Ka=CC=88fer?= Date: Thu, 30 Oct 2014 11:36:41 -0400 Subject: [PATCH 2/4] use the correct makefile names for building the project --- ios/mapbox-gl-cocoa | 2 +- scripts/travis_script.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ios/mapbox-gl-cocoa b/ios/mapbox-gl-cocoa index 80fd792b9..f395112c3 160000 --- a/ios/mapbox-gl-cocoa +++ b/ios/mapbox-gl-cocoa @@ -1 +1 @@ -Subproject commit 80fd792b9922868ad27510657f8eb0aad7d4d2ea +Subproject commit f395112c34ecc754812d4325102ee273fa8ced01 diff --git a/scripts/travis_script.sh b/scripts/travis_script.sh index 8e2f92163..8f112cdb8 100755 --- a/scripts/travis_script.sh +++ b/scripts/travis_script.sh @@ -31,7 +31,7 @@ elif [[ ${TRAVIS_OS_NAME} == "osx" ]]; then # build OS X # mapbox_time "create_osx_project" \ - make xproj-cli + make build/macosx/mapboxgl-app.xcodeproj mapbox_time "build_osx" \ xcodebuild -project ./build/macosx/mapboxgl-app.xcodeproj -jobs 4 @@ -45,7 +45,7 @@ elif [[ ${TRAVIS_OS_NAME} == "osx" ]]; then git submodule update mapbox_time "create_ios_project" \ - make iproj-cli + make build/ios/mapbox-gl-cocoa/app/mapboxgl-app.xcodeproj mapbox_time "build_ios" \ xcodebuild -project ./build/ios/mapbox-gl-cocoa/app/mapboxgl-app.xcodeproj -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO -jobs 4 From 7bdef5349071ede1c7c0bbb21133dcc713da143b Mon Sep 17 00:00:00 2001 From: Mike Morris Date: Thu, 30 Oct 2014 11:51:50 -0400 Subject: [PATCH 3/4] fix standalone_product_dir path --- gyp/common.gypi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gyp/common.gypi b/gyp/common.gypi index c25bb7777..16025eb5a 100644 --- a/gyp/common.gypi +++ b/gyp/common.gypi @@ -1,7 +1,7 @@ { 'variables': { 'install_prefix%': '', - 'standalone_product_dir':' Date: Thu, 30 Oct 2014 11:52:38 -0400 Subject: [PATCH 4/4] fix #522 --- deps/gtest/gtest.gyp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/deps/gtest/gtest.gyp b/deps/gtest/gtest.gyp index 8b638bb13..c62b6be3f 100644 --- a/deps/gtest/gtest.gyp +++ b/deps/gtest/gtest.gyp @@ -1,7 +1,11 @@ { - 'includes': [ - '../../gyp/common.gypi', - ], + 'target_defaults': { + 'default_configuration': 'Release', + 'configurations': { + 'Debug': {}, + 'Release': {} + }, + }, 'targets': [{ 'target_name': 'gtest', 'type': 'static_library',