make: Make it possible to build only particular images.

Instead of building all images all the time, let the caller specify which
images they want. That can help trim dependencies to make it easier to build
depthcharge for particular uses cases.

Change-Id: I766cc78dbd4c6744478abf10b8be7cd527db4140
diff --git a/src/image/Makefile.inc b/src/image/Makefile.inc
index f651023..9fb9d52 100644
--- a/src/image/Makefile.inc
+++ b/src/image/Makefile.inc
@@ -61,7 +61,10 @@
 .PHONY: images
 all: images
 
-image-handler=$(eval images: $(image_obj)/$2)
+ALL_IMAGES = $(strip $(IMAGES) $(IMAGES.$(CONFIG_BOARD)))
+
+filter_image = $(if $(ALL_IMAGES),$(filter $(ALL_IMAGES),$1),$1)
+image-handler=$(eval images: $(addprefix $(image_obj)/,$(call filter_image,$2)))
 
 $(call add-special-class,image)
 
@@ -180,12 +183,6 @@
 image-y += uefi_dev.efi uefi_dev.rwa.bin uefi_dev.rwb.bin
 image-y += uefi_net.efi
 
-modules: $$(module_obj)/uefi_rw.bin
-modules: $$(module_obj)/uefi_dev_rw.bin
-
-.PHONY: modules
-$(addprefix $(image_obj)/,$(image-y)): modules
-
 $(addprefix $(image_obj)/,$(image-y)): $(build_image)
 
 # We'll add the layout and layout options manually, since we'll want to use
@@ -206,11 +203,11 @@
 	$(Q)$(BUILD_IMAGE) uefi_ro $(BUILD_IMAGE_UEFI_RO_COMMON_OPTS) --dev
 
 
-$(image_obj)/uefi.rwa.bin:
+$(image_obj)/uefi.rwa.bin: $$(module_obj)/uefi_rw.bin
 	@printf "    BUILD_IMAGE $(subst $(obj)/,,$@)\n"
 	$(Q)$(BUILD_IMAGE) uefi_rw $(BUILD_IMAGE_UEFI_COMMON_OPTS)
 
-$(image_obj)/uefi_dev.rwa.bin:
+$(image_obj)/uefi_dev.rwa.bin: $$(module_obj)/uefi_dev_rw.bin
 	@printf "    BUILD_IMAGE $(subst $(obj)/,,$@)\n"
 	$(Q)$(BUILD_IMAGE) uefi_rw $(BUILD_IMAGE_UEFI_COMMON_OPTS) --dev