Skip to content

Commit 8a5d597

Browse files
committed
Remove the PRODUCT-* goal
I've switched all the build server configs to using TARGET_PRODUCT / TARGET_BUILD_VARIANT and explicit goals instead. Remove tools/check_builds.sh which relied on this, but hasn't been touched in a long time. Test: m PRODUCT-test Test: treehugger Change-Id: If5f8c714567b33aeb38223c176ca24ea649eb57d
1 parent 6f8e3da commit 8a5d597

File tree

6 files changed

+12
-163
lines changed

6 files changed

+12
-163
lines changed

Diff for: Usage.txt

-6
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,6 @@ Ways to specify what to build:
2626
If no targets are specified, the build system will build the images
2727
for the configured product and variant.
2828

29-
An alternative to setting $TARGET_PRODUCT and $TARGET_BUILD_VARIANT,
30-
which you may see in build servers, is to execute:
31-
32-
m PRODUCT-<product>-<variant>
33-
34-
3529
A target may be a file path. For example, out/host/linux-x86/bin/adb .
3630
Note that when giving a relative file path as a target, that path is
3731
interpreted relative to the root of the source tree (rather than relative

Diff for: core/envsetup.mk

+7-2
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,6 @@ CORRECT_BUILD_ENV_SEQUENCE_NUMBER := 13
8282

8383
# ---------------------------------------------------------------
8484
# The product defaults to generic on hardware
85-
# NOTE: This will be overridden in product_config.mk if make
86-
# was invoked with a PRODUCT-xxx-yyy goal.
8785
ifeq ($(TARGET_PRODUCT),)
8886
TARGET_PRODUCT := aosp_arm
8987
endif
@@ -94,6 +92,13 @@ ifeq ($(strip $(TARGET_BUILD_VARIANT)),)
9492
TARGET_BUILD_VARIANT := eng
9593
endif
9694

95+
TARGET_BUILD_APPS ?=
96+
97+
.KATI_READONLY := \
98+
TARGET_PRODUCT \
99+
TARGET_BUILD_VARIANT \
100+
TARGET_BUILD_APPS
101+
97102
# ---------------------------------------------------------------
98103
# Set up configuration for host machine. We don't do cross-
99104
# compiles except for arm/mips, so the HOST is whatever we are

Diff for: core/main.mk

+2
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,8 @@ $(info ***************************************************************)
194194
$(error stopping)
195195
endif
196196

197+
# These are the valid values of TARGET_BUILD_VARIANT.
198+
INTERNAL_VALID_VARIANTS := user userdebug eng
197199
ifneq ($(filter-out $(INTERNAL_VALID_VARIANTS),$(TARGET_BUILD_VARIANT)),)
198200
$(info ***************************************************************)
199201
$(info ***************************************************************)

Diff for: core/ninja_config.mk

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ endif
77
KATI_OUTPUT_PATTERNS := $(OUT_DIR)/build%.ninja $(OUT_DIR)/ninja%.sh
88

99
# Modifier goals we don't need to pass to Ninja.
10-
NINJA_EXCLUDE_GOALS := all PRODUCT-%
10+
NINJA_EXCLUDE_GOALS := all
1111

1212
# A list of goals which affect parsing of makefiles and we need to pass to Kati.
1313
PARSE_TIME_MAKE_GOALS := \

Diff for: core/product_config.mk

+2-62
Original file line numberDiff line numberDiff line change
@@ -78,78 +78,18 @@ $(sort $(shell find $(2) -name "$(1)" -type f | $(SED_EXTENDED) "s:($(2)/?(.*)):
7878
endef
7979

8080
# ---------------------------------------------------------------
81-
82-
# These are the valid values of TARGET_BUILD_VARIANT. Also, if anything else is passed
83-
# as the variant in the PRODUCT-$TARGET_BUILD_PRODUCT-$TARGET_BUILD_VARIANT form,
84-
# it will be treated as a goal, and the eng variant will be used.
85-
INTERNAL_VALID_VARIANTS := user userdebug eng
86-
87-
# ---------------------------------------------------------------
88-
# Provide "PRODUCT-<prodname>-<goal>" targets, which lets you build
89-
# a particular configuration without needing to set up the environment.
90-
#
81+
# Check for obsolete PRODUCT- and APP- goals
9182
ifeq ($(CALLED_FROM_SETUP),true)
9283
product_goals := $(strip $(filter PRODUCT-%,$(MAKECMDGOALS)))
9384
ifdef product_goals
94-
# Scrape the product and build names out of the goal,
95-
# which should be of the form PRODUCT-<productname>-<buildname>.
96-
#
97-
ifneq ($(words $(product_goals)),1)
98-
$(error Only one PRODUCT-* goal may be specified; saw "$(product_goals)")
99-
endif
100-
goal_name := $(product_goals)
101-
product_goals := $(patsubst PRODUCT-%,%,$(product_goals))
102-
product_goals := $(subst -, ,$(product_goals))
103-
ifneq ($(words $(product_goals)),2)
104-
$(error Bad PRODUCT-* goal "$(goal_name)")
105-
endif
106-
107-
# The product they want
108-
TARGET_PRODUCT := $(word 1,$(product_goals))
109-
110-
# The variant they want
111-
TARGET_BUILD_VARIANT := $(word 2,$(product_goals))
112-
113-
ifeq ($(TARGET_BUILD_VARIANT),tests)
114-
$(error "tests" has been deprecated as a build variant. Use it as a build goal instead.)
115-
endif
116-
117-
# The build server wants to do make PRODUCT-dream-sdk
118-
# which really means TARGET_PRODUCT=dream make sdk.
119-
ifneq ($(filter-out $(INTERNAL_VALID_VARIANTS),$(TARGET_BUILD_VARIANT)),)
120-
override MAKECMDGOALS := $(MAKECMDGOALS) $(TARGET_BUILD_VARIANT)
121-
TARGET_BUILD_VARIANT := userdebug
122-
default_goal_substitution :=
123-
else
124-
default_goal_substitution := droid
125-
endif
126-
127-
# Replace the PRODUCT-* goal with the build goal that it refers to.
128-
# Note that this will ensure that it appears in the same relative
129-
# position, in case it matters.
130-
override MAKECMDGOALS := $(patsubst $(goal_name),$(default_goal_substitution),$(MAKECMDGOALS))
85+
$(error The PRODUCT-* goal is no longer supported. Use `TARGET_PRODUCT=<product> m droid` instead)
13186
endif
132-
endif # CALLED_FROM_SETUP
133-
# else: Use the value set in the environment or buildspec.mk.
134-
135-
# ---------------------------------------------------------------
136-
# Provide "APP-<appname>" targets, which lets you build
137-
# an unbundled app.
138-
#
139-
ifeq ($(CALLED_FROM_SETUP),true)
14087
unbundled_goals := $(strip $(filter APP-%,$(MAKECMDGOALS)))
14188
ifdef unbundled_goals
14289
$(error The APP-* goal is no longer supported. Use `TARGET_BUILD_APPS="<app>" m droid` instead)
14390
endif # unbundled_goals
14491
endif
14592

146-
# Now that we've parsed APP-* and PRODUCT-*, mark these as readonly
147-
TARGET_BUILD_APPS ?=
148-
.KATI_READONLY := \
149-
TARGET_PRODUCT \
150-
TARGET_BUILD_VARIANT \
151-
TARGET_BUILD_APPS
152-
15393
# Default to building dalvikvm on hosts that support it...
15494
ifeq ($(HOST_OS),linux)
15595
# ... or if the if the option is already set

Diff for: tools/check_builds.sh

-92
This file was deleted.

0 commit comments

Comments
 (0)