Skip to content

Commit db5fb45

Browse files
author
Mitchell Hentges
committedJan 29, 2021
Bug 1683797: Removes unnecessary lines from client.mk r=sheehan,firefox-build-system-reviewers,glandium
CWD and BUILDSTATUS are never used, and core-detection happens within `mach`. Differential Revision: https://phabricator.services.mozilla.com/D102661
1 parent 8aa7867 commit db5fb45

File tree

1 file changed

+7
-42
lines changed

1 file changed

+7
-42
lines changed
 

‎client.mk

+7-42
Original file line numberDiff line numberDiff line change
@@ -14,42 +14,16 @@
1414
# MOZ_MAKE_FLAGS - Flags to pass to $(MAKE)
1515
#
1616
#######################################################################
17-
# Defines
1817

19-
ifdef MACH
20-
ifndef NO_BUILDSTATUS_MESSAGES
21-
define BUILDSTATUS
22-
@echo 'BUILDSTATUS $1'
23-
24-
endef
25-
endif
26-
endif
27-
28-
29-
CWD := $(CURDIR)
30-
31-
ifeq "$(CWD)" "/"
32-
CWD := /.
18+
ifndef MACH
19+
$(error client.mk must be used via `mach`. Try running \
20+
`./mach $(firstword $(MAKECMDGOALS) $(.DEFAULT_GOAL))`)
3321
endif
3422

35-
PYTHON3 ?= python3
36-
37-
####################################
38-
# Load mozconfig Options
39-
23+
### Load mozconfig options
4024
include $(OBJDIR)/.mozconfig-client-mk
4125

42-
ifdef MOZ_PARALLEL_BUILD
43-
MOZ_MAKE_FLAGS := $(filter-out -j%,$(MOZ_MAKE_FLAGS))
44-
MOZ_MAKE_FLAGS += -j$(MOZ_PARALLEL_BUILD)
45-
endif
46-
47-
# Automatically add -jN to make flags if not defined. N defaults to number of cores.
48-
ifeq (,$(findstring -j,$(MOZ_MAKE_FLAGS)))
49-
cores=$(shell $(PYTHON3) -c 'import multiprocessing; print(multiprocessing.cpu_count())')
50-
MOZ_MAKE_FLAGS += -j$(cores)
51-
endif
52-
26+
### Set up make flags
5327
ifdef MOZ_AUTOMATION
5428
ifeq (4.0,$(firstword $(sort 4.0 $(MAKE_VERSION))))
5529
MOZ_MAKE_FLAGS += --output-sync=line
@@ -58,17 +32,10 @@ endif
5832

5933
MOZ_MAKE = $(MAKE) $(MOZ_MAKE_FLAGS) -C $(OBJDIR)
6034

61-
#######################################################################
62-
# Rules
63-
35+
### Rules
6436
# The default rule is build
6537
build::
6638

67-
ifndef MACH
68-
$(error client.mk must be used via `mach`. Try running \
69-
`./mach $(firstword $(MAKECMDGOALS) $(.DEFAULT_GOAL))`)
70-
endif
71-
7239
# In automation, manage an sccache daemon. The starting of the server
7340
# needs to be in a make file so sccache inherits the jobserver.
7441
ifdef MOZBUILD_MANAGE_SCCACHE_DAEMON
@@ -82,9 +49,7 @@ build::
8249
$(if $(findstring n,$(filter-out --%, $(MAKEFLAGS))),,+)env SCCACHE_LOG=sccache=debug SCCACHE_ERROR_LOG=$(UPLOAD_PATH)/sccache.log $(MOZBUILD_MANAGE_SCCACHE_DAEMON) --start-server
8350
endif
8451

85-
####################################
86-
# Build it
87-
52+
### Build it
8853
build::
8954
+$(MOZ_MAKE)
9055

0 commit comments

Comments
 (0)
Failed to load comments.