summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2015-04-21 11:57:08 +0200
committerKonstantin Käfer <mail@kkaefer.com>2015-04-24 11:50:50 +0200
commit0d5568f7248d489c6081c217f2c21e56fb12e5f1 (patch)
tree1ff2bfd0152d4633cb2eaa69f2b101ec825742d2
parent8d766135974110a8c52a43956ff4f3313cb0e310 (diff)
downloadqtlocation-mapboxgl-0d5568f7248d489c6081c217f2c21e56fb12e5f1.tar.gz
merge build targets so we only have one build file per platform
previously, we used multiple different projects for various targets (app, test, render) that overwrote each other, so it was impossible to have one project to build them all, one project to compile them, one project to run them all and in the darkness bind them
-rw-r--r--Makefile119
-rw-r--r--bin/render.gypi (renamed from bin/render.gyp)0
-rw-r--r--gyp/project.gyp19
-rw-r--r--linux/mapboxgl-app.gypi (renamed from linux/mapboxgl-app.gyp)0
-rw-r--r--macosx/mapboxgl-app.gypi (renamed from macosx/mapboxgl-app.gyp)2
-rwxr-xr-xscripts/package_ios.sh2
-rw-r--r--test/test.gypi (renamed from test/test.gyp)2
7 files changed, 65 insertions, 79 deletions
diff --git a/Makefile b/Makefile
index d0cf4407cd..11eb5e530f 100644
--- a/Makefile
+++ b/Makefile
@@ -4,11 +4,16 @@ PREFIX ?= /usr/local
ANDROID_ABI ?= arm-v7
ifeq ($(shell uname -s), Darwin)
-HOST ?= osx
-HEADLESS ?= cgl
+HOST = osx
+HEADLESS = cgl
JOBS ?= $(shell sysctl -n hw.ncpu)
endif
-HOST ?= linux
+
+ifeq ($(shell uname -s), Linux)
+HOST = linux
+JOBS ?= $(shell sysctl -n hw.ncpu)
+endif
+
JOBS ?= 1
all: mbgl
@@ -32,49 +37,42 @@ SMCalloutView:
KIF:
git submodule update --init test/ios/KIF
-#### Library builds ############################################################
-.PRECIOUS: Makefile/mbgl
-Makefile/mbgl: config/$(HOST).gypi styles/styles SMCalloutView
- deps/run_gyp mbgl.gyp $(CONFIG_$(HOST)) $(LIBS_$(HOST)) --generator-output=./build/$(HOST) -f make
+#### Build files ###############################################################
+
+.PRECIOUS: Makefile/project
+Makefile/project: config/$(HOST).gypi styles/styles SMCalloutView
+ deps/run_gyp gyp/project.gyp $(CONFIG_$(HOST)) $(LIBS_$(HOST)) --generator-output=./build/$(HOST) -f make
+
+.PRECIOUS: Xcode/project
+Xcode/project: config/$(HOST).gypi styles/styles SMCalloutView
+ deps/run_gyp gyp/project.gyp $(CONFIG_$(HOST)) $(LIBS_$(HOST)) --generator-output=./build/$(HOST) -f xcode
-mbgl: Makefile/mbgl
+
+#### Library builds ############################################################
+
+mbgl: Makefile/project
$(MAKE) -C build/$(HOST) BUILDTYPE=$(BUILDTYPE) everything
-standalone: Makefile/mbgl
+standalone: Makefile/project
LINK=`pwd`/gyp/link.py $(MAKE) -C build/$(HOST) BUILDTYPE=$(BUILDTYPE) standalone
-install: Makefile/mbgl
+install: Makefile/project
LINK=`pwd`/gyp/link.py $(MAKE) -C build/$(HOST) BUILDTYPE=$(BUILDTYPE) install
-.PRECIOUS: Xcode/mbgl
-Xcode/mbgl: config/$(HOST).gypi styles/styles SMCalloutView
- deps/run_gyp mbgl.gyp $(CONFIG_$(HOST)) $(LIBS_$(HOST)) --generator-output=./build/$(HOST) -f xcode
##### Test builds ##############################################################
-.PRECIOUS: Makefile/test
-Makefile/test: test/test.gyp config/$(HOST).gypi styles/styles SMCalloutView
- deps/run_gyp test/test.gyp $(CONFIG_$(HOST)) $(LIBS_$(HOST)) --generator-output=./build/$(HOST) -f make
-
.PHONY: test
-test: Makefile/test
+test: Makefile/project
$(MAKE) -C build/$(HOST) BUILDTYPE=$(BUILDTYPE) test
test-%: test
./scripts/run_tests.sh "build/$(HOST)/$(BUILDTYPE)/test" --gtest_filter=$*
-
-.PRECIOUS: Xcode/test
-Xcode/test: test/test.gyp config/osx.gypi styles/styles SMCalloutView
- deps/run_gyp test/test.gyp $(CONFIG_osx) $(LIBS_osx) --generator-output=./build/osx -f xcode
-
-.PHONY: lproj lbuild run-xlinux
-xtest-proj: Xcode/test
- open ./build/osx/test/test.xcodeproj
-
-xtest: Xcode/test
- xcodebuild -project ./build/osx/test/test.xcodeproj -configuration $(BUILDTYPE) -target test -jobs $(JOBS)
+.PHONY: xtest
+xtest: Xcode/project
+ xcodebuild -project ./build/osx/gyp/project.xcodeproj -configuration $(BUILDTYPE) -target test -jobs $(JOBS)
xtest-%: xtest
./scripts/run_tests.sh "build/osx/Build/Products/$(BUILDTYPE)/test" --gtest_filter=$*
@@ -82,31 +80,22 @@ xtest-%: xtest
#### Mac OS X application builds ###############################################
-.PRECIOUS: Makefile/osx
-Makefile/osx: macosx/mapboxgl-app.gyp config/osx.gypi styles/styles
- deps/run_gyp macosx/mapboxgl-app.gyp $(CONFIG_osx) $(LIBS_osx) --generator-output=./build/osx -f make
-
.PHONY: osx run-osx
-osx: Makefile/osx
+osx: Makefile/project
$(MAKE) -C build/osx BUILDTYPE=$(BUILDTYPE) osxapp
run-osx: osx
"build/osx/$(BUILDTYPE)/Mapbox GL.app/Contents/MacOS/Mapbox GL"
-
-.PRECIOUS: Xcode/osx
-Xcode/osx: macosx/mapboxgl-app.gyp config/osx.gypi styles/styles
- deps/run_gyp macosx/mapboxgl-app.gyp $(CONFIG_osx) $(LIBS_osx) --generator-output=./build/osx -f xcode
-
.PHONY: xosx-proj xosx run-xosx
-xosx-proj: Xcode/osx
- open ./build/osx/macosx/mapboxgl-app.xcodeproj
+xosx-proj: Xcode/project
+ open ./build/osx/gyp/project.xcodeproj
-xosx: Xcode/osx
- xcodebuild -project ./build/osx/macosx/mapboxgl-app.xcodeproj -configuration $(BUILDTYPE) -target osxapp -jobs $(JOBS)
+xosx: Xcode/project
+ xcodebuild -project ./build/osx/gyp/project.xcodeproj -configuration $(BUILDTYPE) -target osxapp -jobs $(JOBS)
run-xosx: xosx
- "build/osx/Build/Products/$(BUILDTYPE)/Mapbox GL.app/Contents/MacOS/Mapbox GL"
+ "gyp/build/$(BUILDTYPE)/Mapbox GL.app/Contents/MacOS/Mapbox GL"
# Legacy name
xproj: xosx-proj
@@ -141,34 +130,19 @@ iproj: ios-proj
#### Linux application builds ##################################################
-.PRECIOUS: Makefile/linux
-Makefile/linux: linux/mapboxgl-app.gyp config/$(HOST).gypi styles/styles
- deps/run_gyp linux/mapboxgl-app.gyp $(CONFIG_$(HOST)) $(LIBS_linux) --generator-output=./build/$(HOST) -f make
-
.PHONY: linux run-linux
-linux: Makefile/linux
+linux: Makefile/project
$(MAKE) -C build/$(HOST) BUILDTYPE=$(BUILDTYPE) linuxapp
run-linux: linux
(cd build/$(HOST)/$(BUILDTYPE) && ./mapbox-gl)
-
-.PRECIOUS: Xcode/linux
-Xcode/linux: linux/mapboxgl-app.gyp config/osx.gypi styles/styles
- deps/run_gyp linux/mapboxgl-app.gyp $(CONFIG_osx) $(LIBS_linux) --generator-output=./build/osx -f xcode
-
-.PHONY: lproj lbuild run-xlinux
-xlinux-proj: Xcode/linux
- open ./build/osx/linux/mapboxgl-app.xcodeproj
-
-xlinux: Xcode/linux
- xcodebuild -project ./build/osx/linux/mapboxgl-app.xcodeproj -configuration $(BUILDTYPE) -target linuxapp
+.PHONY: xlinux run-xlinux
+xlinux: Xcode/project
+ xcodebuild -project ./build/osx/gyp/project.xcodeproj -configuration $(BUILDTYPE) -target linuxapp -jobs $(JOBS)
run-xlinux: xlinux
- "build/osx/Build/Products/$(BUILDTYPE)/mapbox-gl"
-
-# Legacy name
-lproj: xlinux-proj
+ "gyp/build/$(BUILDTYPE)/mapbox-gl"
#### Android libaries #########################################################
@@ -200,22 +174,15 @@ android-deploy: $(ANDROID_ABIS)
android-project: android-lib
-##### Render builds ############################################################
-.PRECIOUS: Makefile/render
-Makefile/render: bin/render.gyp config/$(HOST).gypi
- deps/run_gyp bin/render.gyp $(CONFIG_$(HOST)) $(LIBS_$(HOST)) --generator-output=./build/$(HOST) -f make
+##### Render builds ############################################################
-render: Makefile/render
+render: Makefile/project
$(MAKE) -C build/$(HOST) BUILDTYPE=$(BUILDTYPE) mbgl-render
-.PRECIOUS: Xcode/render
-Xcode/render: bin/render.gyp config/osx.gypi styles/styles
- deps/run_gyp bin/render.gyp $(CONFIG_osx) $(LIBS_osx) --generator-output=./build/osx -f xcode
-
-.PHONY: xrender-proj
-xrender-proj: Xcode/render
- open ./build/osx/bin/render.xcodeproj
+.PHONY: xrender run-xrender
+xrender: Xcode/project
+ xcodebuild -project ./build/osx/gyp/project.xcodeproj -configuration $(BUILDTYPE) -target mbgl-render -jobs $(JOBS)
##### Maintenace operations ####################################################
diff --git a/bin/render.gyp b/bin/render.gypi
index b205e7a959..b205e7a959 100644
--- a/bin/render.gyp
+++ b/bin/render.gypi
diff --git a/gyp/project.gyp b/gyp/project.gyp
new file mode 100644
index 0000000000..9f53eef510
--- /dev/null
+++ b/gyp/project.gyp
@@ -0,0 +1,19 @@
+{
+ 'conditions': [
+ ['host == "osx"', {
+ 'includes': [
+ '../macosx/mapboxgl-app.gypi',
+ '../linux/mapboxgl-app.gypi',
+ '../test/test.gypi',
+ '../bin/render.gypi',
+ ]
+ }],
+ ['host == "linux"', {
+ 'includes': [
+ '../linux/mapboxgl-app.gypi',
+ '../test/test.gypi',
+ '../bin/render.gypi',
+ ]
+ }],
+ ],
+}
diff --git a/linux/mapboxgl-app.gyp b/linux/mapboxgl-app.gypi
index 433a061e43..433a061e43 100644
--- a/linux/mapboxgl-app.gyp
+++ b/linux/mapboxgl-app.gypi
diff --git a/macosx/mapboxgl-app.gyp b/macosx/mapboxgl-app.gypi
index 9817f9d97c..3817954042 100644
--- a/macosx/mapboxgl-app.gyp
+++ b/macosx/mapboxgl-app.gypi
@@ -53,7 +53,7 @@
'OTHER_CPLUSPLUSFLAGS': [ '<@(cflags_cc)' ],
'OTHER_LDFLAGS': [ '<@(ldflags)' ],
'SDKROOT': 'macosx',
- 'INFOPLIST_FILE': 'Info.plist',
+ 'INFOPLIST_FILE': '../macosx/Info.plist',
'CLANG_ENABLE_OBJC_ARC': 'YES'
},
}
diff --git a/scripts/package_ios.sh b/scripts/package_ios.sh
index a651d27342..07e568faa1 100755
--- a/scripts/package_ios.sh
+++ b/scripts/package_ios.sh
@@ -31,7 +31,7 @@ step "Creating build files..."
export MASON_PLATFORM=ios
export BUILDTYPE=${BUILDTYPE:-Release}
export HOST=ios
-make Xcode/mbgl
+make Xcode/ios
step "Building iOS device targets..."
xcodebuild -sdk iphoneos${IOS_SDK_VERSION} \
diff --git a/test/test.gyp b/test/test.gypi
index 2e89db58b0..40cd3d506d 100644
--- a/test/test.gyp
+++ b/test/test.gypi
@@ -9,7 +9,7 @@
'actions': [
{
'action_name': 'Symlink Fixture Directory',
- 'inputs': ['<!@(pwd)'],
+ 'inputs': ['<!@(pwd)/../test'],
'outputs': ['<(PRODUCT_DIR)/TEST_DATA'], # symlinks the test dir into TEST_DATA
'action': ['ln', '-s', '-f', '-n', '<@(_inputs)', '<@(_outputs)' ],
}