Jason Sams | 5e172b0 | 2009-07-23 16:10:46 -0700 | [diff] [blame^] | 1 | ifeq ($(BUILD_RENDERSCRIPT),true) |
| 2 | |
Jason Sams | c7f6ce4 | 2009-06-10 16:09:05 -0700 | [diff] [blame] | 3 | LOCAL_PATH:=$(call my-dir) |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 4 | |
Jason Sams | c7f6ce4 | 2009-06-10 16:09:05 -0700 | [diff] [blame] | 5 | |
| 6 | # Build rsg-generator ==================== |
| 7 | include $(CLEAR_VARS) |
Jason Sams | 326e0dd | 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 | c7f6ce4 | 2009-06-10 16:09:05 -0700 | [diff] [blame] | 16 | intermediates := $(local-intermediates-dir) |
Jason Sams | 326e0dd | 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 | c7f6ce4 | 2009-06-10 16:09:05 -0700 | [diff] [blame] | 30 | |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 31 | include $(BUILD_HOST_EXECUTABLE) |
| 32 | |
Jason Sams | c7f6ce4 | 2009-06-10 16:09:05 -0700 | [diff] [blame] | 33 | # TODO: This should go into build/core/config.mk |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 34 | RSG_GENERATOR:=$(LOCAL_BUILT_MODULE) |
| 35 | |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 36 | |
Jason Sams | c7f6ce4 | 2009-06-10 16:09:05 -0700 | [diff] [blame] | 37 | |
| 38 | # Build render script lib ==================== |
Jason Sams | 326e0dd | 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 | 326e0dd | 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 | 81e48fa | 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 | 326e0dd | 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 | a5e094b | 2009-05-26 17:23:34 -0700 | [diff] [blame] | 57 | |
Jason Sams | c7f6ce4 | 2009-06-10 16:09:05 -0700 | [diff] [blame] | 58 | # used in jni/Android.mk |
| 59 | rs_generated_source += $(GEN) |
Jason Sams | 326e0dd | 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 | a5e094b | 2009-05-26 17:23:34 -0700 | [diff] [blame] | 68 | |
Jason Sams | 81e48fa | 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 | 326e0dd | 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 | a5e094b | 2009-05-26 17:23:34 -0700 | [diff] [blame] | 74 | |
Jason Sams | c7f6ce4 | 2009-06-10 16:09:05 -0700 | [diff] [blame] | 75 | # used in jni/Android.mk |
| 76 | rs_generated_source += $(GEN) |
Jason Sams | 81e48fa | 2009-06-10 18:35:42 -0700 | [diff] [blame] | 77 | |
Jason Sams | 326e0dd | 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 | b80dfa7 | 2009-07-10 17:32:40 -0700 | [diff] [blame] | 87 | rsFileA3D.cpp \ |
Jason Sams | 62bc1db | 2009-06-22 15:49:21 -0700 | [diff] [blame] | 88 | rsLight.cpp \ |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 89 | rsLocklessFifo.cpp \ |
| 90 | rsObjectBase.cpp \ |
| 91 | rsMatrix.cpp \ |
Jason Sams | b80dfa7 | 2009-07-10 17:32:40 -0700 | [diff] [blame] | 92 | rsMesh.cpp \ |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 93 | rsProgram.cpp \ |
| 94 | rsProgramFragment.cpp \ |
| 95 | rsProgramFragmentStore.cpp \ |
| 96 | rsProgramVertex.cpp \ |
| 97 | rsSampler.cpp \ |
| 98 | rsScript.cpp \ |
| 99 | rsScriptC.cpp \ |
Jason Sams | e45ac6e | 2009-07-20 14:31:06 -0700 | [diff] [blame] | 100 | rsScriptC_Lib.cpp \ |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 101 | rsThreadIO.cpp \ |
| 102 | rsType.cpp \ |
| 103 | rsTriangleMesh.cpp |
| 104 | |
Jack Palevich | 1ef8b80 | 2009-05-28 15:53:04 -0700 | [diff] [blame] | 105 | LOCAL_SHARED_LIBRARIES += libcutils libutils libEGL libGLESv1_CM libui libacc |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 106 | LOCAL_LDLIBS := -lpthread -ldl |
| 107 | LOCAL_MODULE:= libRS |
Jason Sams | c7f6ce4 | 2009-06-10 16:09:05 -0700 | [diff] [blame] | 108 | LOCAL_MODULE_TAGS := optional |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 109 | |
| 110 | include $(BUILD_SHARED_LIBRARY) |
| 111 | |
Jason Sams | c7f6ce4 | 2009-06-10 16:09:05 -0700 | [diff] [blame] | 112 | # Include the subdirectories ==================== |
| 113 | include $(addprefix $(LOCAL_PATH)/,$(addsuffix /Android.mk,\ |
Jason Sams | c7f6ce4 | 2009-06-10 16:09:05 -0700 | [diff] [blame] | 114 | java \ |
| 115 | )) |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 116 | |
Jason Sams | 0e5224f | 2009-07-23 15:19:03 -0700 | [diff] [blame] | 117 | endif |