Chia-I Wu | c9b21d9 | 2011-08-17 11:07:01 +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 | # BOARD_GPU_DRIVERS should be defined. The valid values are |
| 25 | # |
Chia-I Wu | 6449298 | 2011-08-31 12:31:02 +0800 | [diff] [blame] | 26 | # classic drivers: i915 i965 |
Robert Foss | f140467 | 2019-10-22 19:31:52 +0200 | [diff] [blame] | 27 | # gallium drivers: swrast freedreno i915g nouveau kmsro r300g r600g radeonsi vc4 virgl vmwgfx etnaviv iris lima panfrost |
Chia-I Wu | c9b21d9 | 2011-08-17 11:07:01 +0800 | [diff] [blame] | 28 | # |
Chia-I Wu | 099faee | 2011-08-19 17:11:34 +0800 | [diff] [blame] | 29 | # The main target is libGLES_mesa. For each classic driver enabled, a DRI |
| 30 | # module will also be built. DRI modules will be loaded by libGLES_mesa. |
Chia-I Wu | c9b21d9 | 2011-08-17 11:07:01 +0800 | [diff] [blame] | 31 | |
| 32 | MESA_TOP := $(call my-dir) |
Chad Versace | 56c6cdc | 2012-12-20 14:14:51 -0800 | [diff] [blame] | 33 | |
| 34 | MESA_ANDROID_MAJOR_VERSION := $(word 1, $(subst ., , $(PLATFORM_VERSION))) |
Rob Herring | d5a9365 | 2017-05-23 14:41:22 -0500 | [diff] [blame] | 35 | ifneq ($(filter 2 4, $(MESA_ANDROID_MAJOR_VERSION)),) |
| 36 | $(error "Android 4.4 and earlier not supported") |
| 37 | endif |
Chad Versace | 56c6cdc | 2012-12-20 14:14:51 -0800 | [diff] [blame] | 38 | |
Rob Herring | 8949edf | 2016-02-24 12:56:28 -0600 | [diff] [blame] | 39 | MESA_DRI_MODULE_REL_PATH := dri |
| 40 | MESA_DRI_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/$(MESA_DRI_MODULE_REL_PATH) |
| 41 | MESA_DRI_MODULE_UNSTRIPPED_PATH := $(TARGET_OUT_SHARED_LIBRARIES_UNSTRIPPED)/$(MESA_DRI_MODULE_REL_PATH) |
Jordan Justen | ccb7005 | 2017-10-18 15:04:37 -0700 | [diff] [blame] | 42 | MESA_DRI_LDFLAGS := -Wl,--build-id=sha1 |
Rob Herring | 8949edf | 2016-02-24 12:56:28 -0600 | [diff] [blame] | 43 | |
Chia-I Wu | c9b21d9 | 2011-08-17 11:07:01 +0800 | [diff] [blame] | 44 | MESA_COMMON_MK := $(MESA_TOP)/Android.common.mk |
| 45 | MESA_PYTHON2 := python |
Martin Fuzzey | cad400a | 2020-02-06 19:08:10 +0100 | [diff] [blame] | 46 | MESA_PYTHON3 := python3 |
Chia-I Wu | c9b21d9 | 2011-08-17 11:07:01 +0800 | [diff] [blame] | 47 | |
Rob Herring | 3f09739 | 2017-05-03 14:35:20 -0500 | [diff] [blame] | 48 | # Lists to convert driver names to boolean variables |
| 49 | # in form of <driver name>.<boolean make variable> |
| 50 | classic_drivers := i915.HAVE_I915_DRI i965.HAVE_I965_DRI |
| 51 | gallium_drivers := \ |
| 52 | swrast.HAVE_GALLIUM_SOFTPIPE \ |
| 53 | freedreno.HAVE_GALLIUM_FREEDRENO \ |
| 54 | i915g.HAVE_GALLIUM_I915 \ |
| 55 | nouveau.HAVE_GALLIUM_NOUVEAU \ |
Eric Anholt | ed65aee | 2018-10-23 12:33:09 -0700 | [diff] [blame] | 56 | kmsro.HAVE_GALLIUM_KMSRO \ |
Rob Herring | 3f09739 | 2017-05-03 14:35:20 -0500 | [diff] [blame] | 57 | r300g.HAVE_GALLIUM_R300 \ |
| 58 | r600g.HAVE_GALLIUM_R600 \ |
| 59 | radeonsi.HAVE_GALLIUM_RADEONSI \ |
| 60 | vmwgfx.HAVE_GALLIUM_VMWGFX \ |
| 61 | vc4.HAVE_GALLIUM_VC4 \ |
Rob Herring | 77c4467 | 2017-07-04 13:28:38 +0200 | [diff] [blame] | 62 | virgl.HAVE_GALLIUM_VIRGL \ |
Tapani Pälli | 96bb328 | 2018-12-03 14:15:13 +0200 | [diff] [blame] | 63 | etnaviv.HAVE_GALLIUM_ETNAVIV \ |
Icenowy Zheng | 3e91c7d | 2019-04-15 12:32:43 +0800 | [diff] [blame] | 64 | iris.HAVE_GALLIUM_IRIS \ |
Robert Foss | f140467 | 2019-10-22 19:31:52 +0200 | [diff] [blame] | 65 | lima.HAVE_GALLIUM_LIMA \ |
| 66 | panfrost.HAVE_GALLIUM_PANFROST |
Chia-I Wu | c9b21d9 | 2011-08-17 11:07:01 +0800 | [diff] [blame] | 67 | |
Rob Herring | 4c0c371 | 2017-05-03 14:35:21 -0500 | [diff] [blame] | 68 | ifeq ($(BOARD_GPU_DRIVERS),all) |
| 69 | MESA_BUILD_CLASSIC := $(filter HAVE_%, $(subst ., , $(classic_drivers))) |
| 70 | MESA_BUILD_GALLIUM := $(filter HAVE_%, $(subst ., , $(gallium_drivers))) |
| 71 | else |
Rob Herring | 3f09739 | 2017-05-03 14:35:20 -0500 | [diff] [blame] | 72 | # Warn if we have any invalid driver names |
| 73 | $(foreach d, $(BOARD_GPU_DRIVERS), \ |
| 74 | $(if $(findstring $(d).,$(classic_drivers) $(gallium_drivers)), \ |
| 75 | , \ |
| 76 | $(warning invalid GPU driver: $(d)) \ |
| 77 | ) \ |
| 78 | ) |
| 79 | MESA_BUILD_CLASSIC := $(strip $(foreach d, $(BOARD_GPU_DRIVERS), $(patsubst $(d).%,%, $(filter $(d).%, $(classic_drivers))))) |
| 80 | MESA_BUILD_GALLIUM := $(strip $(foreach d, $(BOARD_GPU_DRIVERS), $(patsubst $(d).%,%, $(filter $(d).%, $(gallium_drivers))))) |
Rob Herring | 4c0c371 | 2017-05-03 14:35:21 -0500 | [diff] [blame] | 81 | endif |
Rob Herring | 137b32b | 2017-10-11 17:46:10 -0500 | [diff] [blame] | 82 | ifeq ($(filter x86%,$(TARGET_ARCH)),) |
| 83 | MESA_BUILD_CLASSIC := |
| 84 | endif |
| 85 | |
Rob Herring | 3f09739 | 2017-05-03 14:35:20 -0500 | [diff] [blame] | 86 | $(foreach d, $(MESA_BUILD_CLASSIC) $(MESA_BUILD_GALLIUM), $(eval $(d) := true)) |
Chia-I Wu | c9b21d9 | 2011-08-17 11:07:01 +0800 | [diff] [blame] | 87 | |
Rob Herring | 3f09739 | 2017-05-03 14:35:20 -0500 | [diff] [blame] | 88 | ifneq ($(filter true, $(HAVE_GALLIUM_RADEONSI)),) |
| 89 | MESA_ENABLE_LLVM := true |
Chia-I Wu | c9b21d9 | 2011-08-17 11:07:01 +0800 | [diff] [blame] | 90 | endif |
| 91 | |
Rob Herring | 26aee6f | 2017-05-03 14:35:24 -0500 | [diff] [blame] | 92 | define mesa-build-with-llvm |
Adam Jackson | 96b5926 | 2019-09-06 09:50:32 +0200 | [diff] [blame] | 93 | $(if $(filter $(MESA_ANDROID_MAJOR_VERSION), 4 5 6 7), \ |
Rob Herring | 26aee6f | 2017-05-03 14:35:24 -0500 | [diff] [blame] | 94 | $(warning Unsupported LLVM version in Android $(MESA_ANDROID_MAJOR_VERSION)),) \ |
John Stultz | 3976c86 | 2019-09-12 20:02:18 +0000 | [diff] [blame] | 95 | $(eval LOCAL_CFLAGS += -DLLVM_AVAILABLE -DMESA_LLVM_VERSION_STRING=\"3.9\") \ |
Rob Herring | 4734bfc | 2017-08-15 16:37:41 -0500 | [diff] [blame] | 96 | $(eval LOCAL_SHARED_LIBRARIES += libLLVM) |
Rob Herring | 26aee6f | 2017-05-03 14:35:24 -0500 | [diff] [blame] | 97 | endef |
| 98 | |
Chia-I Wu | 4d3d6f7 | 2011-11-26 11:06:02 +0800 | [diff] [blame] | 99 | # add subdirectories |
Chia-I Wu | 2a77dc0 | 2011-08-17 11:24:11 +0800 | [diff] [blame] | 100 | SUBDIRS := \ |
Martin Fuzzey | d1925fe | 2020-01-17 17:37:03 +0100 | [diff] [blame] | 101 | src/etnaviv \ |
Amit Pundir | 8810537 | 2019-04-30 13:06:19 +0530 | [diff] [blame] | 102 | src/freedreno \ |
Rob Herring | bdfa635 | 2016-05-03 21:02:42 -0500 | [diff] [blame] | 103 | src/gbm \ |
Emil Velikov | 8c2e7fd | 2014-01-10 23:36:16 +0000 | [diff] [blame] | 104 | src/loader \ |
Chia-I Wu | ee41fc8 | 2011-08-17 12:10:12 +0800 | [diff] [blame] | 105 | src/mapi \ |
Emil Velikov | 1a882fd | 2016-01-18 10:47:13 +0200 | [diff] [blame] | 106 | src/compiler \ |
Chia-I Wu | ee40f18 | 2011-08-17 11:31:36 +0800 | [diff] [blame] | 107 | src/mesa \ |
Tomasz Figa | d703abf | 2014-09-27 16:19:59 +0200 | [diff] [blame] | 108 | src/util \ |
Emil Velikov | 1040a86 | 2015-07-14 00:28:10 +0100 | [diff] [blame] | 109 | src/egl \ |
Mauro Rossi | 6b9d7e6 | 2016-09-13 01:15:16 +0200 | [diff] [blame] | 110 | src/amd \ |
Eric Anholt | 7f80a9f | 2016-10-26 10:14:37 -0700 | [diff] [blame] | 111 | src/broadcom \ |
Mauro Rossi | cd18bbe | 2016-08-27 17:19:34 +0200 | [diff] [blame] | 112 | src/intel \ |
Mauro Rossi | 3f2cb69 | 2017-02-28 01:24:41 +0100 | [diff] [blame] | 113 | src/mesa/drivers/dri \ |
Roman Stratiienko | 26a01a6 | 2019-08-06 10:14:50 +0300 | [diff] [blame] | 114 | src/vulkan \ |
| 115 | src/panfrost \ |
Chia-I Wu | 099faee | 2011-08-19 17:11:34 +0800 | [diff] [blame] | 116 | |
Rob Herring | dbbf7a8 | 2016-04-28 14:02:01 -0500 | [diff] [blame] | 117 | INC_DIRS := $(call all-named-subdir-makefiles,$(SUBDIRS)) |
Rob Herring | dbbf7a8 | 2016-04-28 14:02:01 -0500 | [diff] [blame] | 118 | INC_DIRS += $(call all-named-subdir-makefiles,src/gallium) |
Rob Herring | dbbf7a8 | 2016-04-28 14:02:01 -0500 | [diff] [blame] | 119 | include $(INC_DIRS) |