Merge pull request #1312 from mapbox/1312-merge-targets

Merge build targets
This commit is contained in:
Konstantin Käfer
2015-04-24 15:16:36 +02:00
7 changed files with 65 additions and 79 deletions

119
Makefile
View File

@@ -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
#### 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
#### 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
mbgl: Makefile/mbgl
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: 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 ####################################################

19
gyp/project.gyp Normal file
View File

@@ -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',
]
}],
],
}

View File

@@ -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'
},
}

View File

@@ -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} \

View File

@@ -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)' ],
}