1#
2# CHRE API Version Makefile
3#
4# Defines the default version of CHRE to target.
5
6# Default CHRE API Version #####################################################
7
8PRINT_CURRENT_CHRE_API_VERSION_SRCS = $(CHRE_PREFIX)/build/print_current_chre_api_version.c
9PRINT_CURRENT_CHRE_API_VERSION_BIN = $(OUT)/print_current_chre_api_version
10CURRENT_CHRE_API_VERSION_MK = $(OUT)/current_chre_api_version.mk
11
12$(PRINT_CURRENT_CHRE_API_VERSION_BIN): $(PRINT_CURRENT_CHRE_API_VERSION_SRCS)
13	mkdir -p $(OUT)
14	$(CHRE_HOST_CC) -I$(CHRE_PREFIX)/chre_api/include/chre_api $^ -o $@
15
16$(CURRENT_CHRE_API_VERSION_MK): $(PRINT_CURRENT_CHRE_API_VERSION_BIN)
17	./$< > $@
18
19# Only include default version if this is not a clean operation.
20ifeq ($(filter clean, $(MAKECMDGOALS)),)
21include $(CURRENT_CHRE_API_VERSION_MK)
22endif
23
24# Target CHRE API Version ######################################################
25
26ifeq ($(CHRE_API_VERSION_MAJOR),)
27TARGET_CHRE_API_VERSION_MAJOR = $(DEFAULT_CHRE_API_VERSION_MAJOR)
28endif
29
30ifeq ($(CHRE_API_VERSION_MINOR),)
31TARGET_CHRE_API_VERSION_MINOR = $(DEFAULT_CHRE_API_VERSION_MINOR)
32endif
33