1
2LOCAL_PATH:=$(call my-dir)
3
4
5# Build rsg-generator ====================
6include $(CLEAR_VARS)
7
8LOCAL_MODULE := rsg-generator
9
10# These symbols are normally defined by BUILD_XXX, but we need to define them
11# here so that local-intermediates-dir works.
12
13LOCAL_IS_HOST_MODULE := true
14LOCAL_MODULE_CLASS := EXECUTABLES
15intermediates := $(local-intermediates-dir)
16
17LOCAL_SRC_FILES:= \
18    spec.l \
19    rsg_generator.c
20
21include $(BUILD_HOST_EXECUTABLE)
22
23# TODO: This should go into build/core/config.mk
24RSG_GENERATOR:=$(LOCAL_BUILT_MODULE)
25
26
27
28# Build render script lib ====================
29
30include $(CLEAR_VARS)
31LOCAL_MODULE := libRS
32
33LOCAL_MODULE_CLASS := SHARED_LIBRARIES
34intermediates:= $(local-intermediates-dir)
35
36# Generate custom headers
37
38GEN := $(addprefix $(intermediates)/, \
39            rsgApiStructs.h \
40            rsgApiFuncDecl.h \
41        )
42
43$(GEN) : PRIVATE_PATH := $(LOCAL_PATH)
44$(GEN) : PRIVATE_CUSTOM_TOOL = $(RSG_GENERATOR) $< $@ <$(PRIVATE_PATH)/rs.spec
45$(GEN) : $(RSG_GENERATOR) $(LOCAL_PATH)/rs.spec
46$(GEN): $(intermediates)/%.h : $(LOCAL_PATH)/%.h.rsg
47	$(transform-generated-source)
48
49# used in jni/Android.mk
50rs_generated_source += $(GEN)
51LOCAL_GENERATED_SOURCES += $(GEN)
52
53# Generate custom source files
54
55GEN := $(addprefix $(intermediates)/, \
56            rsgApi.cpp \
57            rsgApiReplay.cpp \
58        )
59
60$(GEN) : PRIVATE_PATH := $(LOCAL_PATH)
61$(GEN) : PRIVATE_CUSTOM_TOOL = $(RSG_GENERATOR) $< $@ <$(PRIVATE_PATH)/rs.spec
62$(GEN) : $(RSG_GENERATOR) $(LOCAL_PATH)/rs.spec
63$(GEN): $(intermediates)/%.cpp : $(LOCAL_PATH)/%.cpp.rsg
64	$(transform-generated-source)
65
66# used in jni/Android.mk
67rs_generated_source += $(GEN)
68
69LOCAL_GENERATED_SOURCES += $(GEN)
70
71# libRS needs libacc, which isn't 64-bit clean, and so can't be built
72# for the simulator on gHardy, and therefore libRS needs to be excluded
73# from the simulator as well.
74ifneq ($(TARGET_SIMULATOR),true)
75
76LOCAL_SRC_FILES:= \
77	rsAdapter.cpp \
78	rsAllocation.cpp \
79	rsComponent.cpp \
80	rsContext.cpp \
81	rsDevice.cpp \
82	rsElement.cpp \
83        rsFileA3D.cpp \
84	rsLight.cpp \
85	rsLocklessFifo.cpp \
86	rsObjectBase.cpp \
87	rsMatrix.cpp \
88        rsMesh.cpp \
89	rsNoise.cpp \
90	rsProgram.cpp \
91	rsProgramFragment.cpp \
92	rsProgramFragmentStore.cpp \
93	rsProgramRaster.cpp \
94	rsProgramVertex.cpp \
95	rsSampler.cpp \
96	rsScript.cpp \
97	rsScriptC.cpp \
98	rsScriptC_Lib.cpp \
99        rsShaderCache.cpp \
100	rsSimpleMesh.cpp \
101	rsThreadIO.cpp \
102	rsType.cpp \
103	rsVertexArray.cpp
104
105ifeq ($(TARGET_BOARD_PLATFORM), s5pc110)
106	LOCAL_CFLAGS += -DHAS_CONTEXT_PRIORITY
107endif
108
109LOCAL_SHARED_LIBRARIES += libcutils libutils libEGL libGLESv1_CM libGLESv2 libui libacc
110LOCAL_LDLIBS := -lpthread -ldl
111LOCAL_MODULE:= libRS
112LOCAL_MODULE_TAGS := optional
113
114include $(BUILD_SHARED_LIBRARY)
115
116# include the java examples
117include $(addprefix $(LOCAL_PATH)/,$(addsuffix /Android.mk,\
118    java \
119    ))
120
121endif #simulator
122