Skip to content

Commit

Permalink
[device][x86][sand] Add product check on makefile
Browse files Browse the repository at this point in the history
Add product check on makefile.
If TARGET_PRODUCT not specified, avaiable products information
will be provided.

Change-Id: I944fd329dd27d4ac7a13212ad0a3fb729fd750af
Signed-off-by: Zhong,Fangjian <[email protected]>
  • Loading branch information
Zhong,Fangjian authored and rogerxfeng8 committed Jun 26, 2018
1 parent caa1e9d commit 77432e0
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions project/sand-x86-64.mk
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,25 @@ WITH_CUSTOMIZED_SYSCALL ?= true

EXTRA_BUILDRULES += app/trusty/user-tasks.mk

ALL_PRODUCTS = $(shell ls $(LOCAL_DIR)/product/)
PRODUCTS = $(foreach t,$(ALL_PRODUCTS),$(basename $(t)))

define PRINT_AVAILABLE_PRODUCTS
$(info )
$(info CAUTION!!!)
$(info Available products: $(PRODUCTS))
$(error Please use 'export TARGET_PRODUCT=xxx' to specify product name)
$(info )
$(info )
endef

ifeq ($(TARGET_PRODUCT),)
$(PRINT_AVAILABLE_PRODUCTS)
else
ifeq ($(findstring $(TARGET_PRODUCT),$(PRODUCTS)),)
$(info product $(TARGET_PRODUCT) not support)
$(PRINT_AVAILABLE_PRODUCTS)
endif
endif

include $(LOCAL_DIR)/product/$(TARGET_PRODUCT).mk

0 comments on commit 77432e0

Please sign in to comment.