Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame^] | 1 | # Only build if BUILD_RENDERSCRIPT is defined to true in the environment. |
| 2 | ifeq ($(BUILD_RENDERSCRIPT),true) |
| 3 | |
| 4 | TOP_LOCAL_PATH:=$(call my-dir) |
| 5 | LOCAL_PATH:= $(TOP_LOCAL_PATH) |
| 6 | |
| 7 | |
| 8 | # Build rsg-generator |
| 9 | |
| 10 | LOCAL_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 | |
| 15 | LOCAL_IS_HOST_MODULE := true |
| 16 | LOCAL_MODULE_CLASS := EXECUTABLES |
| 17 | intermediates:= $(local-intermediates-dir) |
| 18 | |
| 19 | GEN := $(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 | |
| 29 | LOCAL_SRC_FILES:= \ |
| 30 | rsg_generator.c |
| 31 | |
| 32 | include $(BUILD_HOST_EXECUTABLE) |
| 33 | |
| 34 | RSG_GENERATOR:=$(LOCAL_BUILT_MODULE) |
| 35 | |
| 36 | # Build render script lib |
| 37 | |
| 38 | include $(CLEAR_VARS) |
| 39 | LOCAL_MODULE := libRS |
| 40 | |
| 41 | LOCAL_MODULE_CLASS := SHARED_LIBRARIES |
| 42 | intermediates:= $(local-intermediates-dir) |
| 43 | |
| 44 | RS_GENERATED_INCLUDE_DIR:=$(intermediates) |
| 45 | |
| 46 | # Generate custom headers |
| 47 | |
| 48 | GEN := $(addprefix $(intermediates)/, \ |
| 49 | rsgApiStructs.h \ |
| 50 | rsgApiFuncDecl.h \ |
| 51 | ) |
| 52 | |
| 53 | $(GEN) : PRIVATE_CUSTOM_TOOL = $(RSG_GENERATOR) $< $@ <$(LOCAL_PATH)/rs.spec |
| 54 | $(GEN) : $(RSG_GENERATOR) $(LOCAL_PATH)/rs.spec |
| 55 | $(GEN): $(intermediates)/%.h : $(LOCAL_PATH)/%.h.rsg |
| 56 | $(transform-generated-source) |
| 57 | LOCAL_GENERATED_SOURCES += $(GEN) |
| 58 | |
| 59 | # Generate custom source files |
| 60 | |
| 61 | GEN := $(addprefix $(intermediates)/, \ |
| 62 | rsgApi.cpp \ |
| 63 | rsgApiReplay.cpp \ |
| 64 | ) |
| 65 | |
| 66 | $(GEN) : PRIVATE_CUSTOM_TOOL = $(RSG_GENERATOR) $< $@ <$(LOCAL_PATH)/rs.spec |
| 67 | $(GEN) : $(RSG_GENERATOR) $(LOCAL_PATH)/rs.spec |
| 68 | $(GEN): $(intermediates)/%.cpp : $(LOCAL_PATH)/%.cpp.rsg |
| 69 | $(transform-generated-source) |
| 70 | LOCAL_GENERATED_SOURCES += $(GEN) |
| 71 | |
| 72 | LOCAL_SRC_FILES:= \ |
| 73 | rsAdapter.cpp \ |
| 74 | rsAllocation.cpp \ |
| 75 | rsComponent.cpp \ |
| 76 | rsContext.cpp \ |
| 77 | rsDevice.cpp \ |
| 78 | rsElement.cpp \ |
| 79 | rsLocklessFifo.cpp \ |
| 80 | rsObjectBase.cpp \ |
| 81 | rsMatrix.cpp \ |
| 82 | rsProgram.cpp \ |
| 83 | rsProgramFragment.cpp \ |
| 84 | rsProgramFragmentStore.cpp \ |
| 85 | rsProgramVertex.cpp \ |
| 86 | rsSampler.cpp \ |
| 87 | rsScript.cpp \ |
| 88 | rsScriptC.cpp \ |
| 89 | rsThreadIO.cpp \ |
| 90 | rsType.cpp \ |
| 91 | rsTriangleMesh.cpp |
| 92 | |
| 93 | LOCAL_SHARED_LIBRARIES += libcutils libutils libEGL libGLESv1_CM libui |
| 94 | LOCAL_LDLIBS := -lpthread -ldl |
| 95 | LOCAL_MODULE:= libRS |
| 96 | |
| 97 | #LOCAL_MODULE_TAGS := tests |
| 98 | |
| 99 | include $(BUILD_SHARED_LIBRARY) |
| 100 | |
| 101 | # Build JNI library |
| 102 | |
| 103 | LOCAL_PATH:= $(TOP_LOCAL_PATH)/jni |
| 104 | include $(CLEAR_VARS) |
| 105 | |
| 106 | LOCAL_SRC_FILES:= \ |
| 107 | RenderScript_jni.cpp |
| 108 | |
| 109 | LOCAL_SHARED_LIBRARIES := \ |
| 110 | libandroid_runtime \ |
| 111 | libnativehelper \ |
| 112 | libRS \ |
| 113 | libcutils \ |
| 114 | libutils \ |
| 115 | libui |
| 116 | |
| 117 | LOCAL_STATIC_LIBRARIES := |
| 118 | |
| 119 | LOCAL_C_INCLUDES += \ |
| 120 | $(JNI_H_INCLUDE) \ |
| 121 | $(RS_GENERATED_INCLUDE_DIR) \ |
| 122 | $(call include-path-for, corecg graphics) |
| 123 | |
| 124 | LOCAL_CFLAGS += |
| 125 | |
| 126 | LOCAL_LDLIBS := -lpthread |
| 127 | |
| 128 | LOCAL_MODULE:= libRS_jni |
| 129 | |
| 130 | include $(BUILD_SHARED_LIBRARY) |
| 131 | |
| 132 | endif # BUILD_RENDERSCRIPT |