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 | 94d8e90a | 2009-06-10 16:09:05 -0700 | [diff] [blame^] | 53 | $(GEN) : PRIVATE_CUSTOM_TOOL = $(RSG_GENERATOR) $< $@ <$(LOCAL_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 | 94d8e90a | 2009-06-10 16:09:05 -0700 | [diff] [blame^] | 69 | $(GEN) : PRIVATE_CUSTOM_TOOL = $(RSG_GENERATOR) $< $@ <$(LOCAL_PATH)/rs.spec |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 70 | $(GEN) : $(RSG_GENERATOR) $(LOCAL_PATH)/rs.spec |
| 71 | $(GEN): $(intermediates)/%.cpp : $(LOCAL_PATH)/%.cpp.rsg |
| 72 | $(transform-generated-source) |
Jack Palevich | eaff307 | 2009-05-26 17:23:34 -0700 | [diff] [blame] | 73 | |
Jason Sams | 94d8e90a | 2009-06-10 16:09:05 -0700 | [diff] [blame^] | 74 | # used in jni/Android.mk |
| 75 | rs_generated_source += $(GEN) |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 76 | LOCAL_GENERATED_SOURCES += $(GEN) |
| 77 | |
| 78 | LOCAL_SRC_FILES:= \ |
| 79 | rsAdapter.cpp \ |
| 80 | rsAllocation.cpp \ |
| 81 | rsComponent.cpp \ |
| 82 | rsContext.cpp \ |
| 83 | rsDevice.cpp \ |
| 84 | rsElement.cpp \ |
| 85 | rsLocklessFifo.cpp \ |
| 86 | rsObjectBase.cpp \ |
| 87 | rsMatrix.cpp \ |
| 88 | rsProgram.cpp \ |
| 89 | rsProgramFragment.cpp \ |
| 90 | rsProgramFragmentStore.cpp \ |
| 91 | rsProgramVertex.cpp \ |
| 92 | rsSampler.cpp \ |
| 93 | rsScript.cpp \ |
| 94 | rsScriptC.cpp \ |
| 95 | rsThreadIO.cpp \ |
| 96 | rsType.cpp \ |
| 97 | rsTriangleMesh.cpp |
| 98 | |
Jack Palevich | ec5a20b | 2009-05-28 15:53:04 -0700 | [diff] [blame] | 99 | LOCAL_SHARED_LIBRARIES += libcutils libutils libEGL libGLESv1_CM libui libacc |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 100 | LOCAL_LDLIBS := -lpthread -ldl |
| 101 | LOCAL_MODULE:= libRS |
Jack Palevich | e1ab4349 | 2009-05-29 11:38:46 -0700 | [diff] [blame] | 102 | LOCAL_PRELINK_MODULE := false |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 103 | |
Jason Sams | 94d8e90a | 2009-06-10 16:09:05 -0700 | [diff] [blame^] | 104 | LOCAL_MODULE_TAGS := optional |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 105 | |
| 106 | include $(BUILD_SHARED_LIBRARY) |
| 107 | |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 108 | |
Jason Sams | 94d8e90a | 2009-06-10 16:09:05 -0700 | [diff] [blame^] | 109 | # Include the subdirectories ==================== |
| 110 | include $(addprefix $(LOCAL_PATH)/,$(addsuffix /Android.mk,\ |
| 111 | jni \ |
| 112 | java \ |
| 113 | )) |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 114 | |
Jack Palevich | 60aa3ea | 2009-05-26 13:45:08 -0700 | [diff] [blame] | 115 | endif # BUILD_RENDERSCRIPT |