1#
2# Google Reference CHRE Implementation for Linux on x86
3#
4
5include $(CHRE_PREFIX)/build/clean_build_template_args.mk
6
7TARGET_NAME = google_x86_linux
8TARGET_CFLAGS = -DCHRE_MESSAGE_TO_HOST_MAX_SIZE=2048
9TARGET_VARIANT_SRCS = $(GOOGLE_X86_LINUX_SRCS)
10TARGET_BIN_LDFLAGS = $(GOOGLE_X86_LINUX_BIN_LDFLAGS)
11TARGET_SO_EARLY_LIBS = $(GOOGLE_X86_LINUX_EARLY_LIBS)
12TARGET_SO_LATE_LIBS = $(GOOGLE_X86_LINUX_LATE_LIBS)
13TARGET_PLATFORM_ID = 0x476f6f676c000001
14TARGET_CFLAGS += -DCHRE_FIRST_SUPPORTED_API_VERSION=CHRE_API_VERSION_1_1
15
16TARGET_CFLAGS += $(SIM_CFLAGS)
17TARGET_VARIANT_SRCS += $(SIM_SRCS)
18
19# Enable conversion warnings for the simulator. Since this is a platform 100%
20# within our control we expect that there will be no conversion issues. It would
21# be nice to enable this globally in the tools_config.mk but some vendor header
22# files do not compile cleanly with it.
23TARGET_CFLAGS += -Wconversion
24
25# Add the target CFLAGS after the -Wconversion warning to allow targets to
26# disable it.
27TARGET_CFLAGS += $(GOOGLE_X86_LINUX_CFLAGS)
28
29ifneq ($(filter $(TARGET_NAME)% all, $(MAKECMDGOALS)),)
30ifneq ($(IS_NANOAPP_BUILD),)
31include $(CHRE_PREFIX)/build/nanoapp/google_linux.mk
32else
33# Instruct the build to link a final executable.
34TARGET_BUILD_BIN = true
35
36# Add CFLAGS for the simulator.
37TARGET_CFLAGS += $(shell pkg-config --cflags tclap)
38TARGET_CFLAGS += $(shell pkg-config --cflags sndfile)
39
40# Link in libraries for the final executable and export symbols to dynamically
41# loaded objects.
42TARGET_BIN_LDFLAGS += -lpthread -lrt -ldl -Wl,--export-dynamic
43TARGET_BIN_LDFLAGS += $(shell pkg-config --libs sndfile)
44endif
45
46include $(CHRE_PREFIX)/build/arch/x86.mk
47include $(CHRE_PREFIX)/build/build_template.mk
48endif
49