Android.mk 3.62 KB
Newer Older
1 2 3 4 5
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)

waffle_top := $(LOCAL_PATH)

6 7 8
#
# !!! The version must be updated in tandem with the CMakeLists !!!
#
9
waffle_major_version := 1
10
waffle_minor_version := 5
11
waffle_patch_version := 90
12
waffle_api_version := 0x0106
13

14 15
waffle_android_major_version := $(word 1, $(subst ., , $(PLATFORM_VERSION)))
waffle_android_minor_version := $(word 2, $(subst ., , $(PLATFORM_VERSION)))
16
waffle_android_version := $(waffle_android_major_version).$(waffle_android_minor_version)
17

Arthur She's avatar
Arthur She committed
18
$(waffle_top)/include/waffle/waffle_version.h: \
19 20 21 22 23 24 25 26 27 28
    $(waffle_top)/Android.mk \
    $(waffle_top)/include/waffle/waffle_version.h.in
	@echo "target  Gen: libwaffle <= $(waffle_top)/include/waffle/waffle_version.h"
	@sed -e 's/@waffle_major_version@/$(waffle_major_version)/' \
	     -e 's/@waffle_minor_version@/$(waffle_minor_version)/' \
	     -e 's/@waffle_patch_version@/$(waffle_patch_version)/' \
	     $(waffle_top)/include/waffle/waffle_version.h.in \
	     > $(waffle_top)/include/waffle/waffle_version.h

LOCAL_MODULE_TAGS := eng
29
LOCAL_MODULE := libwaffle-$(waffle_major_version)
30 31 32

LOCAL_CFLAGS := \
    -DANDROID_STUB \
33
    -DWAFFLE_API_VERSION=$(waffle_api_version) \
34
    -DWAFFLE_API_EXPERIMENTAL \
35
    -DWAFFLE_HAS_ANDROID \
36 37
    -DWAFFLE_ANDROID_MAJOR_VERSION=$(waffle_android_major_version) \
    -DWAFFLE_ANDROID_MINOR_VERSION=$(waffle_android_minor_version) \
38
    -Wno-pointer-arith
39

40 41 42 43 44 45 46
ifeq ($(shell echo "$(waffle_android_version) >= 4.4" | bc),1)
LOCAL_CONLYFLAGS := -std=c99
else
LOCAL_CFLAGS += -std=c99
endif

LOCAL_CFLAGS += -fvisibility=hidden
47

48
LOCAL_C_INCLUDES := \
Emil Velikov's avatar
Emil Velikov committed
49
    $(LOCAL_PATH)/include \
50 51
    $(LOCAL_PATH)/include/waffle \
    $(LOCAL_PATH)/src/ \
52
    $(LOCAL_PATH)/src/waffle/api/ \
53
    $(LOCAL_PATH)/src/waffle/core/ \
54 55 56
    $(LOCAL_PATH)/src/waffle/egl/ \
    $(LOCAL_PATH)/src/waffle/linux/ \
    $(LOCAL_PATH)/src/waffle/droid/ \
57
    $(LOCAL_PATH)/third_party/khronos/ \
Emil Velikov's avatar
Emil Velikov committed
58
    $(LOCAL_PATH)/third_party/threads/
59 60 61 62 63 64 65

LOCAL_SRC_FILES := \
    src/waffle/core/wcore_tinfo.c \
    src/waffle/core/wcore_config_attrs.c \
    src/waffle/core/wcore_error.c \
    src/waffle/core/wcore_util.c \
    src/waffle/core/wcore_display.c \
66
    src/waffle/core/wcore_attrib_list.c \
67 68 69 70 71 72 73 74 75 76 77 78 79
    src/waffle/api/api_priv.c \
    src/waffle/api/waffle_attrib_list.c \
    src/waffle/api/waffle_config.c \
    src/waffle/api/waffle_context.c \
    src/waffle/api/waffle_display.c \
    src/waffle/api/waffle_enum.c \
    src/waffle/api/waffle_error.c \
    src/waffle/api/waffle_gl_misc.c \
    src/waffle/api/waffle_init.c \
    src/waffle/api/waffle_window.c \
    src/waffle/api/waffle_dl.c \
    src/waffle/linux/linux_dl.c \
    src/waffle/linux/linux_platform.c \
80 81 82
    src/waffle/egl/wegl_config.c \
    src/waffle/egl/wegl_context.c \
    src/waffle/egl/wegl_display.c \
83
    src/waffle/egl/wegl_platform.c \
84
    src/waffle/egl/wegl_util.c \
85
    src/waffle/egl/wegl_surface.c \
86 87 88 89
    src/waffle/android/droid_platform.c \
    src/waffle/android/droid_display.c \
    src/waffle/android/droid_window.c \
    src/waffle/android/droid_surfaceflingerlink.cpp \
Emil Velikov's avatar
Emil Velikov committed
90
    third_party/threads/threads_posix.c
91 92 93 94

LOCAL_SHARED_LIBRARIES := \
    libdl \
    libutils \
Emil Velikov's avatar
Emil Velikov committed
95
    libgui
96 97

LOCAL_GENERATED_SOURCES := \
Arthur She's avatar
Arthur She committed
98
    $(LOCAL_PATH)/include/waffle/waffle_version.h
99

Chad Versace's avatar
Chad Versace committed
100
LOCAL_COPY_HEADERS := \
101
    include/waffle/waffle.h \
Chad Versace's avatar
Chad Versace committed
102 103 104 105
    include/waffle/waffle_gbm.h \
    include/waffle/waffle_glx.h \
    include/waffle/waffle_version.h \
    include/waffle/waffle_wayland.h \
Emil Velikov's avatar
Emil Velikov committed
106
    include/waffle/waffle_x11_egl.h
Chad Versace's avatar
Chad Versace committed
107 108 109

LOCAL_COPY_HEADERS_TO := waffle-$(waffle_major_version)

110
include $(BUILD_SHARED_LIBRARY)
111 112 113 114 115 116 117

SUBDIRS := \
    examples \
    src/utils

mkfiles := $(patsubst %,$(waffle_top)/%/Android.mk,$(SUBDIRS))
include $(mkfiles)