From f7911bae727f01fb667aee351895699ea714780e Mon Sep 17 00:00:00 2001 From: Romain Goyet Date: Thu, 2 Apr 2020 22:44:22 -0400 Subject: [PATCH] [build] Remove DEFAULT It was redundant with HANDY_TARGETS and HANDY_TARGETS_EXTENSIONS --- Makefile | 3 +-- build/targets.mak | 20 +++++++++++++------- ion/src/simulator/android/Makefile | 2 -- ion/src/simulator/ios/Makefile | 2 -- ion/src/simulator/macos/Makefile | 2 -- 5 files changed, 14 insertions(+), 15 deletions(-) diff --git a/Makefile b/Makefile index b2119d461..c5ed4b53d 100644 --- a/Makefile +++ b/Makefile @@ -99,8 +99,7 @@ all_objs = $(call object_for,$(all_src)) include build/targets.mak # Fill in the default recipe -DEFAULT ?= $(BUILD_DIR)/epsilon.$(EXE) -default: $(DEFAULT) +default: $(firstword $(HANDY_TARGETS)).$(firstword $(HANDY_TARGETS_EXTENSIONS)) # Load standard build rules include build/rules.mk diff --git a/build/targets.mak b/build/targets.mak index cf77a3460..85303eb5d 100644 --- a/build/targets.mak +++ b/build/targets.mak @@ -2,13 +2,8 @@ # Those can be built easily by simply invoking "make target.ext". The named file # will be built in $(BUILD_DIR). -HANDY_TARGETS += -HANDY_TARGETS_EXTENSIONS += $(EXE) - -define handy_target_rule -.PHONY: $(1).$(2) -$(1).$(2): $$(BUILD_DIR)/$(1).$(2) -endef +HANDY_TARGETS ?= +HANDY_TARGETS_EXTENSIONS ?= # Epsilon base target @@ -74,6 +69,17 @@ HANDY_TARGETS += test -include build/targets.$(PLATFORM).mak # Generate handy targets rules +# Define handy targets +# Those can be built easily by simply invoking "make target.ext". The named file +# will be built in $(BUILD_DIR). + +HANDY_TARGETS_EXTENSIONS += $(EXE) + +define handy_target_rule +.PHONY: $(1).$(2) +$(1).$(2): $$(BUILD_DIR)/$(1).$(2) +endef + $(foreach extension,$(HANDY_TARGETS_EXTENSIONS),$(foreach executable,$(HANDY_TARGETS),$(eval $(call handy_target_rule,$(executable),$(extension))))) include build/targets.all.mak diff --git a/ion/src/simulator/android/Makefile b/ion/src/simulator/android/Makefile index c3f31d5f1..9143b3dfe 100644 --- a/ion/src/simulator/android/Makefile +++ b/ion/src/simulator/android/Makefile @@ -63,6 +63,4 @@ $(BUILD_DIR)/%.apk: $(apk_deps) $(Q) ANDROID_HOME=$(ANDROID_HOME) EPSILON_VERSION=$(EPSILON_VERSION) BUILD_DIR=$(BUILD_DIR) EPSILON_VARIANT=$* ion/src/simulator/android/gradlew -b ion/src/simulator/android/build.gradle assembleRelease $(Q) cp $(BUILD_DIR)/app/outputs/apk/release/android-release*.apk $@ -DEFAULT = epsilon.apk - endif diff --git a/ion/src/simulator/ios/Makefile b/ion/src/simulator/ios/Makefile index a8b0c36d6..2d85d1297 100644 --- a/ion/src/simulator/ios/Makefile +++ b/ion/src/simulator/ios/Makefile @@ -89,6 +89,4 @@ simulator_app_deps += $(call simulator_app_resource,launch.storyboardc) include ion/src/simulator/shared/apple/targets.mak -DEFAULT = epsilon.ipa - endif diff --git a/ion/src/simulator/macos/Makefile b/ion/src/simulator/macos/Makefile index 3992f08fa..81b06f3d4 100644 --- a/ion/src/simulator/macos/Makefile +++ b/ion/src/simulator/macos/Makefile @@ -43,6 +43,4 @@ simulator_app_deps += $(call simulator_app_resource,app.icns) include ion/src/simulator/shared/apple/targets.mak -DEFAULT = epsilon.app - endif