blob: 5f4787198cf5b3742f8ad8c63c8d645d7247cb00 [file] [log] [blame]
Jason Samsd19f10d2009-05-22 14:03:28 -07001# Only build if BUILD_RENDERSCRIPT is defined to true in the environment.
2ifeq ($(BUILD_RENDERSCRIPT),true)
3
Jason Sams94d8e90a2009-06-10 16:09:05 -07004LOCAL_PATH:=$(call my-dir)
Jason Samsd19f10d2009-05-22 14:03:28 -07005
Jason Sams94d8e90a2009-06-10 16:09:05 -07006
7# Build rsg-generator ====================
8include $(CLEAR_VARS)
Jason Samsd19f10d2009-05-22 14:03:28 -07009
10LOCAL_MODULE := rsg-generator
11
12# These symbols are normally defined by BUILD_XXX, but we need to define them
13# here so that local-intermediates-dir works.
14
15LOCAL_IS_HOST_MODULE := true
16LOCAL_MODULE_CLASS := EXECUTABLES
Jason Sams94d8e90a2009-06-10 16:09:05 -070017intermediates := $(local-intermediates-dir)
Jason Samsd19f10d2009-05-22 14:03:28 -070018
19GEN := $(addprefix $(intermediates)/, \
20 lex.yy.c \
21 )
22$(GEN): PRIVATE_CUSTOM_TOOL = flex -o $@ $<
23
24$(intermediates)/lex.yy.c : $(LOCAL_PATH)/spec.lex
25 $(transform-generated-source)
26
27$(LOCAL_PATH)/rsg_generator.c : $(intermediates)/lex.yy.c
28
29LOCAL_SRC_FILES:= \
30 rsg_generator.c
Jason Sams94d8e90a2009-06-10 16:09:05 -070031
Jason Samsd19f10d2009-05-22 14:03:28 -070032include $(BUILD_HOST_EXECUTABLE)
33
Jason Sams94d8e90a2009-06-10 16:09:05 -070034# TODO: This should go into build/core/config.mk
Jason Samsd19f10d2009-05-22 14:03:28 -070035RSG_GENERATOR:=$(LOCAL_BUILT_MODULE)
36
Jason Samsd19f10d2009-05-22 14:03:28 -070037
Jason Sams94d8e90a2009-06-10 16:09:05 -070038
39# Build render script lib ====================
Jason Samsd19f10d2009-05-22 14:03:28 -070040include $(CLEAR_VARS)
41LOCAL_MODULE := libRS
42
43LOCAL_MODULE_CLASS := SHARED_LIBRARIES
44intermediates:= $(local-intermediates-dir)
45
Jason Samsd19f10d2009-05-22 14:03:28 -070046# Generate custom headers
47
48GEN := $(addprefix $(intermediates)/, \
49 rsgApiStructs.h \
50 rsgApiFuncDecl.h \
51 )
52
Jason Sams196ac852009-06-10 18:35:42 -070053$(GEN) : PRIVATE_PATH := $(LOCAL_PATH)
54$(GEN) : PRIVATE_CUSTOM_TOOL = $(RSG_GENERATOR) $< $@ <$(PRIVATE_PATH)/rs.spec
Jason Samsd19f10d2009-05-22 14:03:28 -070055$(GEN) : $(RSG_GENERATOR) $(LOCAL_PATH)/rs.spec
56$(GEN): $(intermediates)/%.h : $(LOCAL_PATH)/%.h.rsg
57 $(transform-generated-source)
Jack Palevicheaff3072009-05-26 17:23:34 -070058
Jason Sams94d8e90a2009-06-10 16:09:05 -070059# used in jni/Android.mk
60rs_generated_source += $(GEN)
Jason Samsd19f10d2009-05-22 14:03:28 -070061LOCAL_GENERATED_SOURCES += $(GEN)
62
63# Generate custom source files
64
65GEN := $(addprefix $(intermediates)/, \
66 rsgApi.cpp \
67 rsgApiReplay.cpp \
68 )
Jack Palevicheaff3072009-05-26 17:23:34 -070069
Jason Sams196ac852009-06-10 18:35:42 -070070$(GEN) : PRIVATE_PATH := $(LOCAL_PATH)
71$(GEN) : PRIVATE_CUSTOM_TOOL = $(RSG_GENERATOR) $< $@ <$(PRIVATE_PATH)/rs.spec
Jason Samsd19f10d2009-05-22 14:03:28 -070072$(GEN) : $(RSG_GENERATOR) $(LOCAL_PATH)/rs.spec
73$(GEN): $(intermediates)/%.cpp : $(LOCAL_PATH)/%.cpp.rsg
74 $(transform-generated-source)
Jack Palevicheaff3072009-05-26 17:23:34 -070075
Jason Sams94d8e90a2009-06-10 16:09:05 -070076# used in jni/Android.mk
77rs_generated_source += $(GEN)
Jason Sams196ac852009-06-10 18:35:42 -070078
Jason Samsd19f10d2009-05-22 14:03:28 -070079LOCAL_GENERATED_SOURCES += $(GEN)
80
81LOCAL_SRC_FILES:= \
82 rsAdapter.cpp \
83 rsAllocation.cpp \
84 rsComponent.cpp \
85 rsContext.cpp \
86 rsDevice.cpp \
87 rsElement.cpp \
Jason Sams7aa4f3a2009-07-10 17:32:40 -070088 rsFileA3D.cpp \
Jason Samsbba134c2009-06-22 15:49:21 -070089 rsLight.cpp \
Jason Samsd19f10d2009-05-22 14:03:28 -070090 rsLocklessFifo.cpp \
91 rsObjectBase.cpp \
92 rsMatrix.cpp \
Jason Sams7aa4f3a2009-07-10 17:32:40 -070093 rsMesh.cpp \
Jason Samsd19f10d2009-05-22 14:03:28 -070094 rsProgram.cpp \
95 rsProgramFragment.cpp \
96 rsProgramFragmentStore.cpp \
97 rsProgramVertex.cpp \
98 rsSampler.cpp \
99 rsScript.cpp \
100 rsScriptC.cpp \
101 rsThreadIO.cpp \
102 rsType.cpp \
103 rsTriangleMesh.cpp
104
Jack Palevichec5a20b2009-05-28 15:53:04 -0700105LOCAL_SHARED_LIBRARIES += libcutils libutils libEGL libGLESv1_CM libui libacc
Jason Samsd19f10d2009-05-22 14:03:28 -0700106LOCAL_LDLIBS := -lpthread -ldl
107LOCAL_MODULE:= libRS
Jack Paleviche1ab43492009-05-29 11:38:46 -0700108LOCAL_PRELINK_MODULE := false
Jason Samsd19f10d2009-05-22 14:03:28 -0700109
Jason Sams94d8e90a2009-06-10 16:09:05 -0700110LOCAL_MODULE_TAGS := optional
Jason Samsd19f10d2009-05-22 14:03:28 -0700111
112include $(BUILD_SHARED_LIBRARY)
113
Jason Sams94d8e90a2009-06-10 16:09:05 -0700114# Include the subdirectories ====================
115include $(addprefix $(LOCAL_PATH)/,$(addsuffix /Android.mk,\
116 jni \
117 java \
118 ))
Jason Samsd19f10d2009-05-22 14:03:28 -0700119
Jack Palevich60aa3ea2009-05-26 13:45:08 -0700120endif # BUILD_RENDERSCRIPT