1# Determine if the emugen build needs to be builts from
2# sources.
3EMUGL_BUILD_EMUGEN :=
4ifeq (true,$(BUILD_STANDALONE_EMULATOR))
5  # The emulator's standalone build system can build host Linux
6  # binaries even when it targets Windows by setting
7  # LOCAL_HOST_BUILD to true, so rebuild from sources.
8  EMUGL_BUILD_EMUGEN := true
9else
10  ifneq ($(HOST_OS),windows)
11    # The platform build can only build emugen when targetting
12    # the same host sytem.
13    EMUGL_BUILD_EMUGEN := true
14  endif
15endif
16
17LOCAL_PATH:=$(call my-dir)
18
19ifeq (true,$(EMUGL_BUILD_EMUGEN))
20
21$(call emugl-begin-host-executable,emugen)
22
23LOCAL_SRC_FILES := \
24    ApiGen.cpp \
25    EntryPoint.cpp \
26    main.cpp \
27    strUtils.cpp \
28    TypeFactory.cpp \
29
30ifeq (true,$(BUILD_STANDALONE_EMULATOR))
31LOCAL_HOST_BUILD := true
32endif
33
34$(call emugl-end-module)
35
36# The location of the emugen host tool that is used to generate wire
37# protocol encoders/ decoders. This variable is used by other emugl modules.
38EMUGL_EMUGEN := $(LOCAL_BUILT_MODULE)
39
40else # windows platform build
41
42# on windows use the build host emugen executable
43# (that will be the linux exeutable when using mingw build)
44EMUGL_EMUGEN := $(BUILD_OUT_EXECUTABLES)/emugen
45
46endif
47