1# Copyright 2012 Intel Corporation
2#
3# Permission is hereby granted, free of charge, to any person obtaining a
4# copy of this software and associated documentation files (the "Software"),
5# to deal in the Software without restriction, including without limitation
6# the rights to use, copy, modify, merge, publish, distribute, sublicense,
7# and/or sell copies of the Software, and to permit persons to whom the
8# Software is furnished to do so, subject to the following conditions:
9#
10# The above copyright notice and this permission notice shall be included
11# in all copies or substantial portions of the Software.
12#
13# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
16# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
19# DEALINGS IN THE SOFTWARE.
20
21LOCAL_PATH := $(call my-dir)
22
23# ----------------------------------------------------------------------
24# libmesa_program.a
25# ----------------------------------------------------------------------
26
27# Import the following variables:
28#     PROGRAM_FILES
29include $(MESA_TOP)/src/mesa/Makefile.sources
30
31include $(CLEAR_VARS)
32
33LOCAL_MODULE := libmesa_program
34LOCAL_LICENSE_KINDS := SPDX-license-identifier-MIT
35LOCAL_LICENSE_CONDITIONS := notice
36LOCAL_NOTICE_FILE := $(LOCAL_PATH)/../../../LICENSE
37LOCAL_MODULE_CLASS := STATIC_LIBRARIES
38LOCAL_STATIC_LIBRARIES := libmesa_nir \
39	libmesa_glsl
40
41intermediates := $(call local-generated-sources-dir)
42
43# TODO(chadv): In Makefile.sources, move these vars to a different list so we can
44# remove this kludge.
45generated_sources_basenames := \
46	lex.yy.c \
47	program_parse.tab.c \
48	program_parse.tab.h
49
50LOCAL_SRC_FILES := \
51	$(filter-out $(generated_sources_basenames),$(subst program/,,$(PROGRAM_FILES))) \
52	$(subst program/,,$(PROGRAM_NIR_FILES)) \
53	program_lexer.l
54
55LOCAL_GENERATED_SOURCES := \
56	$(intermediates)/program/program_parse.tab.c \
57	$(intermediates)/program/program_parse.tab.h
58
59$(intermediates)/program/program_parse.tab.c: .KATI_IMPLICIT_OUTPUTS := $(intermediates)/program/program_parse.tab.h
60$(intermediates)/program/program_parse.tab.c: PRIVATE_YACCFLAGS := -p "_mesa_program_"
61$(intermediates)/program/program_parse.tab.c: $(LOCAL_PATH)/program_parse.y $(BISON) $(BISON_DATA) $(M4)
62	$(transform-y-to-c-or-cpp)
63
64LOCAL_C_INCLUDES := \
65	$(MESA_TOP)/src/mapi \
66	$(MESA_TOP)/src/mesa \
67	$(MESA_TOP)/src/compiler/nir \
68	$(MESA_TOP)/src/gallium/auxiliary \
69	$(MESA_TOP)/src/gallium/include
70
71LOCAL_EXPORT_C_INCLUDE_DIRS := $(intermediates)
72
73LOCAL_GENERATED_SOURCES += $(MESA_GEN_NIR_H) \
74	$(MESA_GEN_GLSL_H)
75
76include $(MESA_COMMON_MK)
77include $(BUILD_STATIC_LIBRARY)
78