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 | |
Jason Sams | 94d8e90a | 2009-06-10 16:09:05 -0700 | [diff] [blame] | 4 | LOCAL_PATH:=$(call my-dir) |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 5 | |
Jason Sams | 94d8e90a | 2009-06-10 16:09:05 -0700 | [diff] [blame] | 6 | |
| 7 | # Build rsg-generator ==================== |
| 8 | include $(CLEAR_VARS) |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 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 |
Jason Sams | 94d8e90a | 2009-06-10 16:09:05 -0700 | [diff] [blame] | 17 | intermediates := $(local-intermediates-dir) |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 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 |
Jason Sams | 94d8e90a | 2009-06-10 16:09:05 -0700 | [diff] [blame] | 31 | |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 32 | include $(BUILD_HOST_EXECUTABLE) |
| 33 | |
Jason Sams | 94d8e90a | 2009-06-10 16:09:05 -0700 | [diff] [blame] | 34 | # TODO: This should go into build/core/config.mk |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 35 | RSG_GENERATOR:=$(LOCAL_BUILT_MODULE) |
| 36 | |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 37 | |
Jason Sams | 94d8e90a | 2009-06-10 16:09:05 -0700 | [diff] [blame] | 38 | |
| 39 | # Build render script lib ==================== |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 40 | include $(CLEAR_VARS) |
| 41 | LOCAL_MODULE := libRS |
| 42 | |
| 43 | LOCAL_MODULE_CLASS := SHARED_LIBRARIES |
| 44 | intermediates:= $(local-intermediates-dir) |
| 45 | |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 46 | # Generate custom headers |
| 47 | |
| 48 | GEN := $(addprefix $(intermediates)/, \ |
| 49 | rsgApiStructs.h \ |
| 50 | rsgApiFuncDecl.h \ |
| 51 | ) |
| 52 | |
Jason Sams | 196ac85 | 2009-06-10 18:35:42 -0700 | [diff] [blame] | 53 | $(GEN) : PRIVATE_PATH := $(LOCAL_PATH) |
| 54 | $(GEN) : PRIVATE_CUSTOM_TOOL = $(RSG_GENERATOR) $< $@ <$(PRIVATE_PATH)/rs.spec |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 55 | $(GEN) : $(RSG_GENERATOR) $(LOCAL_PATH)/rs.spec |
| 56 | $(GEN): $(intermediates)/%.h : $(LOCAL_PATH)/%.h.rsg |
| 57 | $(transform-generated-source) |
Jack Palevich | eaff307 | 2009-05-26 17:23:34 -0700 | [diff] [blame] | 58 | |
Jason Sams | 94d8e90a | 2009-06-10 16:09:05 -0700 | [diff] [blame] | 59 | # used in jni/Android.mk |
| 60 | rs_generated_source += $(GEN) |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 61 | LOCAL_GENERATED_SOURCES += $(GEN) |
| 62 | |
| 63 | # Generate custom source files |
| 64 | |
| 65 | GEN := $(addprefix $(intermediates)/, \ |
| 66 | rsgApi.cpp \ |
| 67 | rsgApiReplay.cpp \ |
| 68 | ) |
Jack Palevich | eaff307 | 2009-05-26 17:23:34 -0700 | [diff] [blame] | 69 | |
Jason Sams | 196ac85 | 2009-06-10 18:35:42 -0700 | [diff] [blame] | 70 | $(GEN) : PRIVATE_PATH := $(LOCAL_PATH) |
| 71 | $(GEN) : PRIVATE_CUSTOM_TOOL = $(RSG_GENERATOR) $< $@ <$(PRIVATE_PATH)/rs.spec |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 72 | $(GEN) : $(RSG_GENERATOR) $(LOCAL_PATH)/rs.spec |
| 73 | $(GEN): $(intermediates)/%.cpp : $(LOCAL_PATH)/%.cpp.rsg |
| 74 | $(transform-generated-source) |
Jack Palevich | eaff307 | 2009-05-26 17:23:34 -0700 | [diff] [blame] | 75 | |
Jason Sams | 94d8e90a | 2009-06-10 16:09:05 -0700 | [diff] [blame] | 76 | # used in jni/Android.mk |
| 77 | rs_generated_source += $(GEN) |
Jason Sams | 196ac85 | 2009-06-10 18:35:42 -0700 | [diff] [blame] | 78 | |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 79 | LOCAL_GENERATED_SOURCES += $(GEN) |
| 80 | |
| 81 | LOCAL_SRC_FILES:= \ |
| 82 | rsAdapter.cpp \ |
| 83 | rsAllocation.cpp \ |
| 84 | rsComponent.cpp \ |
| 85 | rsContext.cpp \ |
| 86 | rsDevice.cpp \ |
| 87 | rsElement.cpp \ |
Jason Sams | 7aa4f3a | 2009-07-10 17:32:40 -0700 | [diff] [blame] | 88 | rsFileA3D.cpp \ |
Jason Sams | bba134c | 2009-06-22 15:49:21 -0700 | [diff] [blame] | 89 | rsLight.cpp \ |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 90 | rsLocklessFifo.cpp \ |
| 91 | rsObjectBase.cpp \ |
| 92 | rsMatrix.cpp \ |
Jason Sams | 7aa4f3a | 2009-07-10 17:32:40 -0700 | [diff] [blame] | 93 | rsMesh.cpp \ |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 94 | 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 Palevich | ec5a20b | 2009-05-28 15:53:04 -0700 | [diff] [blame] | 105 | LOCAL_SHARED_LIBRARIES += libcutils libutils libEGL libGLESv1_CM libui libacc |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 106 | LOCAL_LDLIBS := -lpthread -ldl |
| 107 | LOCAL_MODULE:= libRS |
Jack Palevich | e1ab4349 | 2009-05-29 11:38:46 -0700 | [diff] [blame] | 108 | LOCAL_PRELINK_MODULE := false |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 109 | |
Jason Sams | 94d8e90a | 2009-06-10 16:09:05 -0700 | [diff] [blame] | 110 | LOCAL_MODULE_TAGS := optional |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 111 | |
| 112 | include $(BUILD_SHARED_LIBRARY) |
| 113 | |
Jason Sams | 94d8e90a | 2009-06-10 16:09:05 -0700 | [diff] [blame] | 114 | # Include the subdirectories ==================== |
| 115 | include $(addprefix $(LOCAL_PATH)/,$(addsuffix /Android.mk,\ |
| 116 | jni \ |
| 117 | java \ |
| 118 | )) |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 119 | |
Jack Palevich | 60aa3ea | 2009-05-26 13:45:08 -0700 | [diff] [blame] | 120 | endif # BUILD_RENDERSCRIPT |