Skip to content

Commit

Permalink
Remove the PRODUCT-* goal
Browse files Browse the repository at this point in the history
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
  • Loading branch information
danw committed Jul 29, 2019
1 parent 6f8e3da commit 8a5d597
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 163 deletions.
6 changes: 0 additions & 6 deletions Usage.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,6 @@ Ways to specify what to build:
If no targets are specified, the build system will build the images
for the configured product and variant.

An alternative to setting $TARGET_PRODUCT and $TARGET_BUILD_VARIANT,
which you may see in build servers, is to execute:

m PRODUCT-<product>-<variant>


A target may be a file path. For example, out/host/linux-x86/bin/adb .
Note that when giving a relative file path as a target, that path is
interpreted relative to the root of the source tree (rather than relative
Expand Down
9 changes: 7 additions & 2 deletions core/envsetup.mk
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,6 @@ CORRECT_BUILD_ENV_SEQUENCE_NUMBER := 13

# ---------------------------------------------------------------
# The product defaults to generic on hardware
# NOTE: This will be overridden in product_config.mk if make
# was invoked with a PRODUCT-xxx-yyy goal.
ifeq ($(TARGET_PRODUCT),)
TARGET_PRODUCT := aosp_arm
endif
Expand All @@ -94,6 +92,13 @@ ifeq ($(strip $(TARGET_BUILD_VARIANT)),)
TARGET_BUILD_VARIANT := eng
endif

TARGET_BUILD_APPS ?=

.KATI_READONLY := \
TARGET_PRODUCT \
TARGET_BUILD_VARIANT \
TARGET_BUILD_APPS

# ---------------------------------------------------------------
# Set up configuration for host machine. We don't do cross-
# compiles except for arm/mips, so the HOST is whatever we are
Expand Down
2 changes: 2 additions & 0 deletions core/main.mk
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,8 @@ $(info ***************************************************************)
$(error stopping)
endif

# These are the valid values of TARGET_BUILD_VARIANT.
INTERNAL_VALID_VARIANTS := user userdebug eng
ifneq ($(filter-out $(INTERNAL_VALID_VARIANTS),$(TARGET_BUILD_VARIANT)),)
$(info ***************************************************************)
$(info ***************************************************************)
Expand Down
2 changes: 1 addition & 1 deletion core/ninja_config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ endif
KATI_OUTPUT_PATTERNS := $(OUT_DIR)/build%.ninja $(OUT_DIR)/ninja%.sh

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

# A list of goals which affect parsing of makefiles and we need to pass to Kati.
PARSE_TIME_MAKE_GOALS := \
Expand Down
64 changes: 2 additions & 62 deletions core/product_config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -78,78 +78,18 @@ $(sort $(shell find $(2) -name "$(1)" -type f | $(SED_EXTENDED) "s:($(2)/?(.*)):
endef

# ---------------------------------------------------------------

# These are the valid values of TARGET_BUILD_VARIANT. Also, if anything else is passed
# as the variant in the PRODUCT-$TARGET_BUILD_PRODUCT-$TARGET_BUILD_VARIANT form,
# it will be treated as a goal, and the eng variant will be used.
INTERNAL_VALID_VARIANTS := user userdebug eng

# ---------------------------------------------------------------
# Provide "PRODUCT-<prodname>-<goal>" targets, which lets you build
# a particular configuration without needing to set up the environment.
#
# Check for obsolete PRODUCT- and APP- goals
ifeq ($(CALLED_FROM_SETUP),true)
product_goals := $(strip $(filter PRODUCT-%,$(MAKECMDGOALS)))
ifdef product_goals
# Scrape the product and build names out of the goal,
# which should be of the form PRODUCT-<productname>-<buildname>.
#
ifneq ($(words $(product_goals)),1)
$(error Only one PRODUCT-* goal may be specified; saw "$(product_goals)")
endif
goal_name := $(product_goals)
product_goals := $(patsubst PRODUCT-%,%,$(product_goals))
product_goals := $(subst -, ,$(product_goals))
ifneq ($(words $(product_goals)),2)
$(error Bad PRODUCT-* goal "$(goal_name)")
endif

# The product they want
TARGET_PRODUCT := $(word 1,$(product_goals))

# The variant they want
TARGET_BUILD_VARIANT := $(word 2,$(product_goals))

ifeq ($(TARGET_BUILD_VARIANT),tests)
$(error "tests" has been deprecated as a build variant. Use it as a build goal instead.)
endif

# The build server wants to do make PRODUCT-dream-sdk
# which really means TARGET_PRODUCT=dream make sdk.
ifneq ($(filter-out $(INTERNAL_VALID_VARIANTS),$(TARGET_BUILD_VARIANT)),)
override MAKECMDGOALS := $(MAKECMDGOALS) $(TARGET_BUILD_VARIANT)
TARGET_BUILD_VARIANT := userdebug
default_goal_substitution :=
else
default_goal_substitution := droid
endif

# Replace the PRODUCT-* goal with the build goal that it refers to.
# Note that this will ensure that it appears in the same relative
# position, in case it matters.
override MAKECMDGOALS := $(patsubst $(goal_name),$(default_goal_substitution),$(MAKECMDGOALS))
$(error The PRODUCT-* goal is no longer supported. Use `TARGET_PRODUCT=<product> m droid` instead)
endif
endif # CALLED_FROM_SETUP
# else: Use the value set in the environment or buildspec.mk.

# ---------------------------------------------------------------
# Provide "APP-<appname>" targets, which lets you build
# an unbundled app.
#
ifeq ($(CALLED_FROM_SETUP),true)
unbundled_goals := $(strip $(filter APP-%,$(MAKECMDGOALS)))
ifdef unbundled_goals
$(error The APP-* goal is no longer supported. Use `TARGET_BUILD_APPS="<app>" m droid` instead)
endif # unbundled_goals
endif

# Now that we've parsed APP-* and PRODUCT-*, mark these as readonly
TARGET_BUILD_APPS ?=
.KATI_READONLY := \
TARGET_PRODUCT \
TARGET_BUILD_VARIANT \
TARGET_BUILD_APPS

# Default to building dalvikvm on hosts that support it...
ifeq ($(HOST_OS),linux)
# ... or if the if the option is already set
Expand Down
92 changes: 0 additions & 92 deletions tools/check_builds.sh

This file was deleted.

0 comments on commit 8a5d597

Please sign in to comment.