Chia-I Wu | ee40f18 | 2011-08-17 11:31:36 +0800 | [diff] [blame] | 1 | # Mesa 3-D graphics library |
| 2 | # |
| 3 | # Copyright (C) 2010-2011 Chia-I Wu <olvaffe@gmail.com> |
| 4 | # Copyright (C) 2010-2011 LunarG Inc. |
| 5 | # |
| 6 | # Permission is hereby granted, free of charge, to any person obtaining a |
| 7 | # copy of this software and associated documentation files (the "Software"), |
| 8 | # to deal in the Software without restriction, including without limitation |
| 9 | # the rights to use, copy, modify, merge, publish, distribute, sublicense, |
| 10 | # and/or sell copies of the Software, and to permit persons to whom the |
| 11 | # Software is furnished to do so, subject to the following conditions: |
| 12 | # |
| 13 | # The above copyright notice and this permission notice shall be included |
| 14 | # in all copies or substantial portions of the Software. |
| 15 | # |
| 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 17 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 18 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
| 19 | # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 20 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
| 21 | # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
| 22 | # DEALINGS IN THE SOFTWARE. |
| 23 | |
| 24 | # included by core mesa Android.mk for source generation |
| 25 | |
| 26 | ifeq ($(LOCAL_MODULE_CLASS),) |
| 27 | LOCAL_MODULE_CLASS := STATIC_LIBRARIES |
| 28 | endif |
| 29 | |
Chih-Wei Huang | b0e33c2 | 2015-04-04 05:01:22 +0800 | [diff] [blame] | 30 | intermediates := $(call local-generated-sources-dir) |
Casey Dahlin | cbdafed | 2017-04-26 10:39:46 -0700 | [diff] [blame] | 31 | prebuilt_intermediates := $(MESA_TOP)/prebuilt-intermediates |
Chia-I Wu | ee40f18 | 2011-08-17 11:31:36 +0800 | [diff] [blame] | 32 | |
Daniel Charles | 948c8f5 | 2012-07-26 14:18:15 -0700 | [diff] [blame] | 33 | # This is the list of auto-generated files: sources and headers |
Chia-I Wu | ee40f18 | 2011-08-17 11:31:36 +0800 | [diff] [blame] | 34 | sources := \ |
Daniel Charles | 948c8f5 | 2012-07-26 14:18:15 -0700 | [diff] [blame] | 35 | main/enums.c \ |
Tapani Pälli | 0fda2e9 | 2012-11-29 09:48:00 +0200 | [diff] [blame] | 36 | main/api_exec.c \ |
Daniel Charles | 948c8f5 | 2012-07-26 14:18:15 -0700 | [diff] [blame] | 37 | main/dispatch.h \ |
Mauro Rossi | 5f7081e | 2015-03-27 18:20:53 +0000 | [diff] [blame] | 38 | main/format_pack.c \ |
| 39 | main/format_unpack.c \ |
| 40 | main/format_info.h \ |
Imre Deak | 98f880e | 2012-09-10 08:46:13 +0300 | [diff] [blame] | 41 | main/remap_helper.h \ |
| 42 | main/get_hash.h |
Chia-I Wu | ee40f18 | 2011-08-17 11:31:36 +0800 | [diff] [blame] | 43 | |
| 44 | LOCAL_SRC_FILES := $(filter-out $(sources), $(LOCAL_SRC_FILES)) |
| 45 | |
| 46 | LOCAL_C_INCLUDES += $(intermediates)/main |
| 47 | |
| 48 | ifeq ($(strip $(MESA_ENABLE_ASM)),true) |
| 49 | ifeq ($(TARGET_ARCH),x86) |
| 50 | sources += x86/matypes.h |
| 51 | LOCAL_C_INCLUDES += $(intermediates)/x86 |
| 52 | endif |
| 53 | endif |
| 54 | |
| 55 | sources += main/git_sha1.h |
| 56 | |
| 57 | sources := $(addprefix $(intermediates)/, $(sources)) |
Tapani Pälli | d5c1801 | 2012-06-07 14:11:31 +0300 | [diff] [blame] | 58 | |
Chia-I Wu | ee40f18 | 2011-08-17 11:31:36 +0800 | [diff] [blame] | 59 | LOCAL_GENERATED_SOURCES += $(sources) |
| 60 | |
| 61 | glapi := $(MESA_TOP)/src/mapi/glapi/gen |
| 62 | |
Paul Berry | a8ab7e3 | 2012-10-23 13:24:17 -0700 | [diff] [blame] | 63 | dispatch_deps := \ |
Chia-I Wu | ee40f18 | 2011-08-17 11:31:36 +0800 | [diff] [blame] | 64 | $(wildcard $(glapi)/*.py) \ |
| 65 | $(wildcard $(glapi)/*.xml) |
| 66 | |
| 67 | define es-gen |
| 68 | @mkdir -p $(dir $@) |
| 69 | @echo "Gen ES: $(PRIVATE_MODULE) <= $(notdir $(@))" |
| 70 | $(hide) $(PRIVATE_SCRIPT) $(1) $(PRIVATE_XML) > $@ |
| 71 | endef |
| 72 | |
Chia-I Wu | ee40f18 | 2011-08-17 11:31:36 +0800 | [diff] [blame] | 73 | $(intermediates)/main/git_sha1.h: |
| 74 | @mkdir -p $(dir $@) |
| 75 | @echo "GIT-SHA1: $(PRIVATE_MODULE) <= git" |
| 76 | $(hide) touch $@ |
| 77 | $(hide) if which git > /dev/null; then \ |
| 78 | git --git-dir $(PRIVATE_PATH)/../../.git log -n 1 --oneline | \ |
| 79 | sed 's/^\([^ ]*\) .*/#define MESA_GIT_SHA1 "git-\1"/' \ |
| 80 | > $@; \ |
| 81 | fi |
| 82 | |
| 83 | matypes_deps := \ |
| 84 | $(BUILD_OUT_EXECUTABLES)/mesa_gen_matypes$(BUILD_EXECUTABLE_SUFFIX) \ |
| 85 | $(LOCAL_PATH)/main/mtypes.h \ |
| 86 | $(LOCAL_PATH)/tnl/t_context.h |
| 87 | |
| 88 | $(intermediates)/x86/matypes.h: $(matypes_deps) |
| 89 | @mkdir -p $(dir $@) |
| 90 | @echo "MATYPES: $(PRIVATE_MODULE) <= $(notdir $@)" |
| 91 | $(hide) $< > $@ |
Daniel Charles | 948c8f5 | 2012-07-26 14:18:15 -0700 | [diff] [blame] | 92 | |
Casey Dahlin | cbdafed | 2017-04-26 10:39:46 -0700 | [diff] [blame] | 93 | $(intermediates)/main/dispatch.h: $(prebuilt_intermediates)/main/dispatch.h |
| 94 | cp -a $< $@ |
Daniel Charles | 948c8f5 | 2012-07-26 14:18:15 -0700 | [diff] [blame] | 95 | |
Casey Dahlin | cbdafed | 2017-04-26 10:39:46 -0700 | [diff] [blame] | 96 | $(intermediates)/main/remap_helper.h: $(prebuilt_intermediates)/main/remap_helper.h |
| 97 | cp -a $< $@ |
Daniel Charles | 948c8f5 | 2012-07-26 14:18:15 -0700 | [diff] [blame] | 98 | |
Casey Dahlin | cbdafed | 2017-04-26 10:39:46 -0700 | [diff] [blame] | 99 | $(intermediates)/main/enums.c: $(prebuilt_intermediates)/main/enums.c |
| 100 | cp -a $< $@ |
Daniel Charles | 948c8f5 | 2012-07-26 14:18:15 -0700 | [diff] [blame] | 101 | |
Casey Dahlin | cbdafed | 2017-04-26 10:39:46 -0700 | [diff] [blame] | 102 | $(intermediates)/main/api_exec.c: $(prebuilt_intermediates)/main/api_exec.c |
| 103 | cp -a $< $@ |
Daniel Charles | 948c8f5 | 2012-07-26 14:18:15 -0700 | [diff] [blame] | 104 | |
Casey Dahlin | cbdafed | 2017-04-26 10:39:46 -0700 | [diff] [blame] | 105 | $(intermediates)/main/get_hash.h: $(prebuilt_intermediates)/main/get_hash.h |
| 106 | cp -a $< $@ |
Daniel Charles | 948c8f5 | 2012-07-26 14:18:15 -0700 | [diff] [blame] | 107 | |
Casey Dahlin | cbdafed | 2017-04-26 10:39:46 -0700 | [diff] [blame] | 108 | $(intermediates)/main/format_info.h: $(prebuilt_intermediates)/main/format_info.h |
| 109 | cp -a $< $@ |
Imre Deak | 98f880e | 2012-09-10 08:46:13 +0300 | [diff] [blame] | 110 | |
Casey Dahlin | cbdafed | 2017-04-26 10:39:46 -0700 | [diff] [blame] | 111 | $(intermediates)/main/format_pack.c: $(prebuilt_intermediates)/main/format_pack.c |
| 112 | cp -a $< $@ |
Paul Berry | 98874ec | 2012-10-31 10:42:08 -0700 | [diff] [blame] | 113 | |
Casey Dahlin | cbdafed | 2017-04-26 10:39:46 -0700 | [diff] [blame] | 114 | $(intermediates)/main/format_unpack.c: $(prebuilt_intermediates)/main/format_unpack.c |
| 115 | cp -a $< $@ |