1 # Mesa 3-D graphics library
3 # Copyright (C) 2010-2011 Chia-I Wu <olvaffe@gmail.com>
4 # Copyright (C) 2010-2011 LunarG Inc.
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:
13 # The above copyright notice and this permission notice shall be included
14 # in all copies or substantial portions of the Software.
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.
24 # included by core mesa Android.mk for source generation
26 ifeq ($(LOCAL_MODULE_CLASS
),)
27 LOCAL_MODULE_CLASS
:= STATIC_LIBRARIES
30 intermediates
:= $(call local-intermediates-dir
)
32 # This is the list of auto-generated files: sources and headers
40 LOCAL_SRC_FILES
:= $(filter-out $(sources
), $(LOCAL_SRC_FILES
))
42 LOCAL_C_INCLUDES
+= $(intermediates
)/main
44 ifeq ($(strip $(MESA_ENABLE_ASM
)),true
)
45 ifeq ($(TARGET_ARCH
),x86
)
46 sources
+= x86
/matypes.h
47 LOCAL_C_INCLUDES
+= $(intermediates
)/x86
51 sources
+= main
/git_sha1.h
53 sources
:= $(addprefix $(intermediates
)/, $(sources
))
55 LOCAL_GENERATED_SOURCES
+= $(sources
)
57 glapi
:= $(MESA_TOP
)/src
/mapi
/glapi
/gen
60 $(wildcard $(glapi
)/*.py
) \
61 $(wildcard $(glapi
)/*.xml
)
65 @echo
"Gen ES: $(PRIVATE_MODULE) <= $(notdir $(@))"
66 $(hide
) $(PRIVATE_SCRIPT
) $(1) $(PRIVATE_XML
) > $@
69 $(intermediates
)/main
/git_sha1.h
:
71 @echo
"GIT-SHA1: $(PRIVATE_MODULE) <= git"
73 $(hide
) if which git
> /dev
/null
; then \
74 git
--git-dir
$(PRIVATE_PATH
)/..
/..
/.git log
-n
1 --oneline | \
75 sed
's/^\([^ ]*\) .*/#define MESA_GIT_SHA1 "git-\1"/' \
80 $(BUILD_OUT_EXECUTABLES
)/mesa_gen_matypes
$(BUILD_EXECUTABLE_SUFFIX
) \
81 $(LOCAL_PATH
)/main
/mtypes.h \
82 $(LOCAL_PATH
)/tnl
/t_context.h
84 $(intermediates
)/x86
/matypes.h
: $(matypes_deps
)
86 @echo
"MATYPES: $(PRIVATE_MODULE) <= $(notdir $@)"
89 $(intermediates
)/main
/dispatch.h
: PRIVATE_SCRIPT
:= $(MESA_PYTHON2
) $(glapi
)/gl_table.py
90 $(intermediates
)/main
/dispatch.h
: PRIVATE_XML
:= -f
$(glapi
)/gl_and_es_API.xml
92 $(intermediates
)/main
/dispatch.h
: $(dispatch_deps
)
93 $(call es-gen
, $* -m remap_table
)
95 $(intermediates
)/main
/remap_helper.h
: PRIVATE_SCRIPT
:= $(MESA_PYTHON2
) $(glapi
)/remap_helper.py
96 $(intermediates
)/main
/remap_helper.h
: PRIVATE_XML
:= -f
$(glapi
)/gl_and_es_API.xml
98 $(intermediates
)/main
/remap_helper.h
: $(dispatch_deps
)
101 $(intermediates
)/main
/enums.c
: PRIVATE_SCRIPT
:=$(MESA_PYTHON2
) $(glapi
)/gl_enums.py
102 $(intermediates
)/main
/enums.c
: PRIVATE_XML
:= -f
$(glapi
)/gl_and_es_API.xml
104 $(intermediates
)/main
/enums.c
: $(dispatch_deps
)
107 $(intermediates
)/main
/api_exec.c
: PRIVATE_SCRIPT
:= $(MESA_PYTHON2
) $(glapi
)/gl_genexec.py
108 $(intermediates
)/main
/api_exec.c
: PRIVATE_XML
:= -f
$(glapi
)/gl_and_es_API.xml
110 $(intermediates
)/main
/api_exec.c
: $(dispatch_deps
)
113 GET_HASH_GEN
:= $(LOCAL_PATH
)/main
/get_hash_generator.py
115 $(intermediates
)/main
/get_hash.h
: $(glapi
)/gl_and_es_API.xml \
116 $(LOCAL_PATH
)/main
/get_hash_params.py
$(GET_HASH_GEN
)
117 @
$(MESA_PYTHON2
) $(GET_HASH_GEN
) -f
$< > $@