Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Commit e46b580

Browse files
committed
[build] unify naming of Makefile targets
`make foo` just builds `make run-foo` builds and runs
1 parent 2b59061 commit e46b580

File tree

6 files changed

+37
-23
lines changed

6 files changed

+37
-23
lines changed

ARCHITECTURE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ The mapbox-gl-native build system uses a variety of tools.
1818

1919
## Make
2020

21-
GNU Make and a master `Makefile` serves as the coordinating tool for all other build system tools. Most of your interaction with the build system will be via `make` commands. We aim to have a consistent pattern for make targets across platforms: for a given platform, e.g. `ios`, `make ios` builds a reasonable set of end products (though perhaps not all permutations of build options, which can be prohibitively expensive), and `make test-ios` runs a complete test suite for the platform.
21+
GNU Make and a master `Makefile` serves as the coordinating tool for all other build system tools. Most of your interaction with the build system will be via `make` commands. We aim to have a consistent pattern for make targets across platforms: for a given platform, e.g. `ios`, `make ios` builds a reasonable set of end products (though perhaps not all permutations of build options, which can be prohibitively expensive), and `make ios-test` runs a complete test suite for the platform.
2222

2323
## Git submodules
2424

Makefile

+29-20
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ else
3939
endif
4040

4141
.PHONY: default
42-
default: test-$(BUILD_PLATFORM)
42+
default: test
4343

4444
ifneq (,$(wildcard .git/.))
4545
.mason/mason:
@@ -109,16 +109,24 @@ macos: $(MACOS_PROJ_PATH)
109109
xproj: $(MACOS_PROJ_PATH)
110110
open $(MACOS_WORK_PATH)
111111

112-
.PHONY: test-macos
113-
test-macos: $(MACOS_PROJ_PATH)
112+
.PHONY: test
113+
test: $(MACOS_PROJ_PATH)
114114
set -o pipefail && $(MACOS_XCODEBUILD) -scheme 'mbgl-test' build $(XCPRETTY)
115-
ulimit -c unlimited && ($(MACOS_OUTPUT_PATH)/$(BUILDTYPE)/mbgl-test & pid=$$! && wait $$pid \
115+
116+
.PHONY: run-test
117+
run-test: run-test-*
118+
119+
run-test-%: test
120+
ulimit -c unlimited && ($(MACOS_OUTPUT_PATH)/$(BUILDTYPE)/mbgl-test --gtest_catch_exceptions=0 --gtest_filter=$* & pid=$$! && wait $$pid \
116121
|| (lldb -c /cores/core.$$pid --batch --one-line 'thread backtrace all' --one-line 'quit' && exit 1))
117122
set -o pipefail && $(MACOS_XCODEBUILD) -scheme 'CI' test $(XCPRETTY)
118123

119124
.PHONY: glfw-app
120125
glfw-app: $(MACOS_PROJ_PATH)
121126
set -o pipefail && $(MACOS_XCODEBUILD) -scheme 'mbgl-glfw' build $(XCPRETTY)
127+
128+
.PHONY: run-glfw-app
129+
run-glfw-app: glfw-app
122130
"$(MACOS_OUTPUT_PATH)/$(BUILDTYPE)/mbgl-glfw"
123131

124132
.PHONY: render
@@ -210,8 +218,8 @@ ios: $(IOS_PROJ_PATH)
210218
iproj: $(IOS_PROJ_PATH)
211219
open $(IOS_WORK_PATH)
212220

213-
.PHONY: test-ios
214-
test-ios: $(IOS_PROJ_PATH)
221+
.PHONY: ios-test
222+
ios-test: $(IOS_PROJ_PATH)
215223
set -o pipefail && $(IOS_XCODEBUILD_SIM) -scheme 'CI' test $(XCPRETTY)
216224

217225
.PHONY: ipackage
@@ -264,24 +272,32 @@ $(LINUX_BUILD): $(BUILD_DEPS)
264272
.PHONY: linux
265273
linux: glfw-app render offline
266274

267-
test-linux: run-test-*
275+
.PHONY: test
276+
test: $(LINUX_BUILD)
277+
$(NINJA) -j$(JOBS) -C $(LINUX_OUTPUT_PATH) mbgl-test
278+
279+
ifneq (,$(shell which gdb))
280+
GDB = gdb -batch -return-child-result -ex 'set print thread-events off' -ex 'run' -ex 'thread apply all bt' --args
281+
endif
282+
283+
.PHONY: run-test
284+
run-test: run-test-*
268285

269-
.PHONY: linux-render
286+
run-test-%: test
287+
$(GDB) $(LINUX_OUTPUT_PATH)/mbgl-test --gtest_catch_exceptions=0 --gtest_filter=$*
288+
289+
.PHONY: render
270290
render: $(LINUX_BUILD)
271291
$(NINJA) -j$(JOBS) -C $(LINUX_OUTPUT_PATH) mbgl-render
272292

273-
.PHONY: linux-offline
293+
.PHONY: offline
274294
offline: $(LINUX_BUILD)
275295
$(NINJA) -j$(JOBS) -C $(LINUX_OUTPUT_PATH) mbgl-offline
276296

277297
.PHONY: glfw-app
278298
glfw-app: $(LINUX_BUILD)
279299
$(NINJA) -j$(JOBS) -C $(LINUX_OUTPUT_PATH) mbgl-glfw
280300

281-
.PHONY: test
282-
test: $(LINUX_BUILD)
283-
$(NINJA) -j$(JOBS) -C $(LINUX_OUTPUT_PATH) mbgl-test
284-
285301
.PHONY: run-glfw-app
286302
run-glfw-app: glfw-app
287303
cd $(LINUX_OUTPUT_PATH) && ./mbgl-glfw
@@ -290,13 +306,6 @@ run-glfw-app: glfw-app
290306
node: $(LINUX_BUILD)
291307
$(NINJA) -j$(JOBS) -C $(LINUX_OUTPUT_PATH) mbgl-node
292308

293-
ifneq (,$(shell which gdb))
294-
GDB = gdb -batch -return-child-result -ex 'set print thread-events off' -ex 'run' -ex 'thread apply all bt' --args
295-
endif
296-
297-
run-test-%: test
298-
$(GDB) $(LINUX_OUTPUT_PATH)/mbgl-test --gtest_catch_exceptions=0 --gtest_filter=$*
299-
300309
.PHONY: compdb
301310
compdb: $(LINUX_BUILD)
302311
# Ninja generator already outputs the file at the right location

platform/ios/DEVELOPING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ To add or update text that the user may see in the iOS SDK:
108108

109109
## Testing
110110

111-
`make test-ios` builds and runs unit tests of cross-platform code as well as the SDK.
111+
`make ios-test` builds and runs unit tests of cross-platform code as well as the SDK.
112112

113113
Before you can run unit tests of the cross-platform code on the command line, install ios-sim version 3.2.0 (not any other version):
114114

platform/ios/bitrise.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ workflows:
3636
gem install jazzy --no-rdoc --no-ri
3737
export BUILDTYPE=Debug
3838
make ios
39-
make test-ios
39+
make ios-test
4040
- is_debug: 'yes'
4141
- slack:
4242
title: Post to Slack

platform/qt/README.md

+4
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ For macOS desktop, you can install Qt 5 via [Homebrew](http://brew.sh):
5353

5454
brew install qt5
5555

56+
Since Homebrew doesn't add Qt to the path, you'll have to do that manually before running any Make target:
57+
58+
export PATH=/usr/local/opt/qt5:$PATH
59+
5660
We provide the following build targets for our Qt SDK:
5761

5862
### Build instructions

test/api/render_missing.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ TEST(API, TEST_REQUIRES_SERVER(RenderMissingTile)) {
4040
std::string message;
4141

4242
// This host does not respond (== connection error).
43+
// Are you seeing this test fail? Make sure you don't have a server running on port 3001!
4344
map.setStyleJSON(style);
4445
map.renderStill([&](std::exception_ptr err, PremultipliedImage&&) {
4546
ASSERT_TRUE(err.operator bool());

0 commit comments

Comments
 (0)