aboutsummaryrefslogtreecommitdiff
path: root/Android.mk
blob: 5b013370f238233e0dbef91a5a754478b4ba8370 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)

waffle_top := $(LOCAL_PATH)

#
# !!! The version must be updated in tandem with the CMakeLists !!!
#
waffle_major_version := 1
waffle_minor_version := 7
waffle_patch_version := 90
waffle_api_version := 0x0108

waffle_android_major_version := $(word 1, $(subst ., , $(PLATFORM_VERSION)))
waffle_android_minor_version := $(word 2, $(subst ., , $(PLATFORM_VERSION)))
waffle_android_version := $(waffle_android_major_version).$(waffle_android_minor_version)

$(waffle_top)/include/waffle/waffle_version.h: \
    $(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
LOCAL_MODULE := libwaffle-$(waffle_major_version)

LOCAL_CFLAGS := \
    -DANDROID_STUB \
    -DWAFFLE_API_VERSION=$(waffle_api_version) \
    -DWAFFLE_API_EXPERIMENTAL \
    -DWAFFLE_HAS_ANDROID \
    -DWAFFLE_ANDROID_MAJOR_VERSION=$(waffle_android_major_version) \
    -DWAFFLE_ANDROID_MINOR_VERSION=$(waffle_android_minor_version) \
    -Wno-pointer-arith

ifeq ($(shell echo "$(waffle_android_version) >= 4.4" | bc),1)
LOCAL_CONLYFLAGS := -std=c99
else
LOCAL_CFLAGS += -std=c99
endif

LOCAL_CFLAGS += -fvisibility=hidden

LOCAL_C_INCLUDES := \
    $(LOCAL_PATH)/include \
    $(LOCAL_PATH)/include/waffle \
    $(LOCAL_PATH)/src/ \
    $(LOCAL_PATH)/src/waffle/api/ \
    $(LOCAL_PATH)/src/waffle/core/ \
    $(LOCAL_PATH)/src/waffle/egl/ \
    $(LOCAL_PATH)/src/waffle/linux/ \
    $(LOCAL_PATH)/src/waffle/droid/ \
    $(LOCAL_PATH)/third_party/khronos/ \
    $(LOCAL_PATH)/third_party/threads/

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 \
    src/waffle/core/wcore_attrib_list.c \
    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 \
    src/waffle/egl/wegl_config.c \
    src/waffle/egl/wegl_context.c \
    src/waffle/egl/wegl_display.c \
    src/waffle/egl/wegl_platform.c \
    src/waffle/egl/wegl_util.c \
    src/waffle/egl/wegl_surface.c \
    src/waffle/android/droid_platform.c \
    src/waffle/android/droid_display.c \
    src/waffle/android/droid_window.c \
    src/waffle/android/droid_surfaceflingerlink.cpp \
    third_party/threads/threads_posix.c

LOCAL_SHARED_LIBRARIES := \
    libdl \
    libutils \
    libgui

LOCAL_GENERATED_SOURCES := \
    $(LOCAL_PATH)/include/waffle/waffle_version.h

LOCAL_COPY_HEADERS := \
    include/waffle/waffle.h \
    include/waffle/waffle_gbm.h \
    include/waffle/waffle_glx.h \
    include/waffle/waffle_surfaceless_egl.h \
    include/waffle/waffle_version.h \
    include/waffle/waffle_wayland.h \
    include/waffle/waffle_x11_egl.h

LOCAL_COPY_HEADERS_TO := waffle-$(waffle_major_version)

include $(BUILD_SHARED_LIBRARY)

SUBDIRS := \
    examples \
    src/utils

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