Jason Sams | 8af858e9 | 2009-07-23 16:10:46 -0700 | [diff] [blame] | 1 | ifeq ($(BUILD_RENDERSCRIPT),true) |
| 2 | |
Jason Sams | 94d8e90a | 2009-06-10 16:09:05 -0700 | [diff] [blame] | 3 | LOCAL_PATH:=$(call my-dir) |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 4 | |
Jason Sams | 94d8e90a | 2009-06-10 16:09:05 -0700 | [diff] [blame] | 5 | |
| 6 | # Build rsg-generator ==================== |
| 7 | include $(CLEAR_VARS) |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 8 | |
| 9 | LOCAL_MODULE := rsg-generator |
| 10 | |
| 11 | # These symbols are normally defined by BUILD_XXX, but we need to define them |
| 12 | # here so that local-intermediates-dir works. |
| 13 | |
| 14 | LOCAL_IS_HOST_MODULE := true |
| 15 | LOCAL_MODULE_CLASS := EXECUTABLES |
Jason Sams | 94d8e90a | 2009-06-10 16:09:05 -0700 | [diff] [blame] | 16 | intermediates := $(local-intermediates-dir) |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 17 | |
| 18 | GEN := $(addprefix $(intermediates)/, \ |
| 19 | lex.yy.c \ |
| 20 | ) |
| 21 | $(GEN): PRIVATE_CUSTOM_TOOL = flex -o $@ $< |
| 22 | |
| 23 | $(intermediates)/lex.yy.c : $(LOCAL_PATH)/spec.lex |
| 24 | $(transform-generated-source) |
| 25 | |
| 26 | $(LOCAL_PATH)/rsg_generator.c : $(intermediates)/lex.yy.c |
| 27 | |
| 28 | LOCAL_SRC_FILES:= \ |
| 29 | rsg_generator.c |
Jason Sams | 94d8e90a | 2009-06-10 16:09:05 -0700 | [diff] [blame] | 30 | |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 31 | include $(BUILD_HOST_EXECUTABLE) |
| 32 | |
Jason Sams | 94d8e90a | 2009-06-10 16:09:05 -0700 | [diff] [blame] | 33 | # TODO: This should go into build/core/config.mk |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 34 | RSG_GENERATOR:=$(LOCAL_BUILT_MODULE) |
| 35 | |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 36 | |
Jason Sams | 94d8e90a | 2009-06-10 16:09:05 -0700 | [diff] [blame] | 37 | |
| 38 | # Build render script lib ==================== |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 39 | include $(CLEAR_VARS) |
| 40 | LOCAL_MODULE := libRS |
| 41 | |
| 42 | LOCAL_MODULE_CLASS := SHARED_LIBRARIES |
| 43 | intermediates:= $(local-intermediates-dir) |
| 44 | |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 45 | # Generate custom headers |
| 46 | |
| 47 | GEN := $(addprefix $(intermediates)/, \ |
| 48 | rsgApiStructs.h \ |
| 49 | rsgApiFuncDecl.h \ |
| 50 | ) |
| 51 | |
Jason Sams | 196ac85 | 2009-06-10 18:35:42 -0700 | [diff] [blame] | 52 | $(GEN) : PRIVATE_PATH := $(LOCAL_PATH) |
| 53 | $(GEN) : PRIVATE_CUSTOM_TOOL = $(RSG_GENERATOR) $< $@ <$(PRIVATE_PATH)/rs.spec |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 54 | $(GEN) : $(RSG_GENERATOR) $(LOCAL_PATH)/rs.spec |
| 55 | $(GEN): $(intermediates)/%.h : $(LOCAL_PATH)/%.h.rsg |
| 56 | $(transform-generated-source) |
Jack Palevich | eaff307 | 2009-05-26 17:23:34 -0700 | [diff] [blame] | 57 | |
Jason Sams | 94d8e90a | 2009-06-10 16:09:05 -0700 | [diff] [blame] | 58 | # used in jni/Android.mk |
| 59 | rs_generated_source += $(GEN) |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 60 | LOCAL_GENERATED_SOURCES += $(GEN) |
| 61 | |
| 62 | # Generate custom source files |
| 63 | |
| 64 | GEN := $(addprefix $(intermediates)/, \ |
| 65 | rsgApi.cpp \ |
| 66 | rsgApiReplay.cpp \ |
| 67 | ) |
Jack Palevich | eaff307 | 2009-05-26 17:23:34 -0700 | [diff] [blame] | 68 | |
Jason Sams | 196ac85 | 2009-06-10 18:35:42 -0700 | [diff] [blame] | 69 | $(GEN) : PRIVATE_PATH := $(LOCAL_PATH) |
| 70 | $(GEN) : PRIVATE_CUSTOM_TOOL = $(RSG_GENERATOR) $< $@ <$(PRIVATE_PATH)/rs.spec |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 71 | $(GEN) : $(RSG_GENERATOR) $(LOCAL_PATH)/rs.spec |
| 72 | $(GEN): $(intermediates)/%.cpp : $(LOCAL_PATH)/%.cpp.rsg |
| 73 | $(transform-generated-source) |
Jack Palevich | eaff307 | 2009-05-26 17:23:34 -0700 | [diff] [blame] | 74 | |
Jason Sams | 94d8e90a | 2009-06-10 16:09:05 -0700 | [diff] [blame] | 75 | # used in jni/Android.mk |
| 76 | rs_generated_source += $(GEN) |
Jason Sams | 196ac85 | 2009-06-10 18:35:42 -0700 | [diff] [blame] | 77 | |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 78 | LOCAL_GENERATED_SOURCES += $(GEN) |
| 79 | |
| 80 | LOCAL_SRC_FILES:= \ |
| 81 | rsAdapter.cpp \ |
| 82 | rsAllocation.cpp \ |
| 83 | rsComponent.cpp \ |
| 84 | rsContext.cpp \ |
| 85 | rsDevice.cpp \ |
| 86 | rsElement.cpp \ |
Jason Sams | 7aa4f3a | 2009-07-10 17:32:40 -0700 | [diff] [blame] | 87 | rsFileA3D.cpp \ |
Jason Sams | bba134c | 2009-06-22 15:49:21 -0700 | [diff] [blame] | 88 | rsLight.cpp \ |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 89 | rsLocklessFifo.cpp \ |
| 90 | rsObjectBase.cpp \ |
| 91 | rsMatrix.cpp \ |
Jason Sams | 7aa4f3a | 2009-07-10 17:32:40 -0700 | [diff] [blame] | 92 | rsMesh.cpp \ |
Romain Guy | ecc7ca0 | 2009-08-03 21:12:51 -0700 | [diff] [blame^] | 93 | rsNoise.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 \ |
Jason Sams | c97bb88 | 2009-07-20 14:31:06 -0700 | [diff] [blame] | 101 | rsScriptC_Lib.cpp \ |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 102 | rsThreadIO.cpp \ |
| 103 | rsType.cpp \ |
| 104 | rsTriangleMesh.cpp |
| 105 | |
Jack Palevich | ec5a20b | 2009-05-28 15:53:04 -0700 | [diff] [blame] | 106 | LOCAL_SHARED_LIBRARIES += libcutils libutils libEGL libGLESv1_CM libui libacc |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 107 | LOCAL_LDLIBS := -lpthread -ldl |
| 108 | LOCAL_MODULE:= libRS |
Jason Sams | 94d8e90a | 2009-06-10 16:09:05 -0700 | [diff] [blame] | 109 | LOCAL_MODULE_TAGS := optional |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 110 | |
| 111 | include $(BUILD_SHARED_LIBRARY) |
| 112 | |
Jason Sams | 94d8e90a | 2009-06-10 16:09:05 -0700 | [diff] [blame] | 113 | # Include the subdirectories ==================== |
| 114 | include $(addprefix $(LOCAL_PATH)/,$(addsuffix /Android.mk,\ |
Jason Sams | 94d8e90a | 2009-06-10 16:09:05 -0700 | [diff] [blame] | 115 | java \ |
| 116 | )) |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 117 | |
Jason Sams | e29d471 | 2009-07-23 15:19:03 -0700 | [diff] [blame] | 118 | endif |