blob: c6e966fa288b04b8ce9bf61b4f946c8ba688fea4 [file] [log] [blame]
Rafael Barbalho09bcb0a2014-01-31 14:57:40 +00001LOCAL_PATH := $(call my-dir)
Oscar Mateo76c78c02013-11-12 11:50:45 +00002
Rafael Barbalho09bcb0a2014-01-31 14:57:40 +00003include $(LOCAL_PATH)/Makefile.sources
Oscar Mateo62e1cbc2013-12-13 20:48:24 +00004
Oscar Mateo76c78c02013-11-12 11:50:45 +00005#================#
Tim Gore41cbe362014-05-12 13:39:00 +01006# each igt test is a separate executable. define a function to build one of these tests
Oscar Mateo76c78c02013-11-12 11:50:45 +00007define add_test
8 include $(CLEAR_VARS)
9
Tim Gore41cbe362014-05-12 13:39:00 +010010 # specific to this test
Rafael Barbalho09bcb0a2014-01-31 14:57:40 +000011 LOCAL_SRC_FILES := $1.c
Oscar Mateo76c78c02013-11-12 11:50:45 +000012 LOCAL_MODULE := $1
Tim Gore41cbe362014-05-12 13:39:00 +010013
14 # common to all tests
15 LOCAL_CFLAGS += ${IGT_LOCAL_CFLAGS}
16 LOCAL_C_INCLUDES = ${IGT_LOCAL_C_INCLUDES}
17 LOCAL_STATIC_LIBRARIES := ${IGT_LOCAL_STATIC_LIBRARIES}
18 LOCAL_SHARED_LIBRARIES := ${IGT_LOCAL_SHARED_LIBRARIES}
19
Oscar Mateo76c78c02013-11-12 11:50:45 +000020 LOCAL_MODULE_TAGS := optional
Tim Gore0be29da2014-05-13 09:34:42 +010021 # ask linker to define a specific symbol; we use this to identify IGT tests
Arkadiusz Hiler53e7f532017-04-12 09:42:47 +020022 LOCAL_LDFLAGS := -Wl,--defsym=$2=0 -lkmod
Derek Mortond524a962015-08-13 11:27:35 +010023 LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/intel/validation/core/igt
Oscar Mateo76c78c02013-11-12 11:50:45 +000024
Oscar Mateo76c78c02013-11-12 11:50:45 +000025 include $(BUILD_EXECUTABLE)
26endef
27
Oscar Mateo76c78c02013-11-12 11:50:45 +000028
Tim Gore41cbe362014-05-12 13:39:00 +010029# some tests still do not build under android
30skip_tests_list :=
Tim Gore41cbe362014-05-12 13:39:00 +010031skip_tests_list += testdisplay # needs glib.h
Daniel Vetter1c9a5b12014-05-16 10:33:28 +020032skip_tests_list += pm_rpm
Tim Gore41cbe362014-05-12 13:39:00 +010033
34# set local compilation flags for IGT tests
35IGT_LOCAL_CFLAGS += -DHAVE_STRUCT_SYSINFO_TOTALRAM -DANDROID -UNDEBUG
Tim Gorea11117e2014-12-12 12:14:33 +000036IGT_LOCAL_CFLAGS += -include "check-ndebug.h" -std=gnu99
Tim Gore41cbe362014-05-12 13:39:00 +010037# FIXME: drop once Bionic correctly annotates "noreturn" on pthread_exit
38IGT_LOCAL_CFLAGS += -Wno-error=return-type
39# Excessive complaining for established cases. Rely on the Linux version warnings.
40IGT_LOCAL_CFLAGS += -Wno-sign-compare
41
42# set local includes
Arkadiusz Hiler6047b012017-04-14 15:10:20 +020043IGT_LOCAL_C_INCLUDES = $(LOCAL_PATH)/../lib \
44 $(LOCAL_PATH)/../lib/stubs/drm/
Tim Gore41cbe362014-05-12 13:39:00 +010045
46# set local libraries
47IGT_LOCAL_STATIC_LIBRARIES := libintel_gpu_tools
Arkadiusz Hiler53e7f532017-04-12 09:42:47 +020048IGT_LOCAL_SHARED_LIBRARIES := libpciaccess libkmod libdrm libdrm_intel
Tim Gore41cbe362014-05-12 13:39:00 +010049
50# handle cairo requirements if it is enabled
51ifeq ("${ANDROID_HAS_CAIRO}", "1")
52 IGT_LOCAL_C_INCLUDES += ${ANDROID_BUILD_TOP}/external/cairo-1.12.16/src
53 IGT_LOCAL_SHARED_LIBRARIES += libcairo
54 IGT_LOCAL_CFLAGS += -DANDROID_HAS_CAIRO=1
55else
56# the following tests depend on cairo, so skip them
57 skip_tests_list += \
Oscar Mateo62e1cbc2013-12-13 20:48:24 +000058 gem_render_copy \
Derek Morton2da624e2016-05-24 15:32:35 +010059 pm_lpsp \
60 drm_read \
61 gem_exec_blt \
Arkadiusz Hiler4fe47f42017-04-12 12:35:54 +020062 perf \
Derek Morton2da624e2016-05-24 15:32:35 +010063 prime_mmap_kms
Derek Mortond819b7e2015-05-15 11:24:55 +010064
65# All kms tests depend on cairo
66 tmp_list := $(foreach test_name, $(TESTS_progs),\
67 $(if $(findstring kms_,$(test_name)),$(test_name)))
68 skip_tests_list += $(tmp_list)
69
70 tmp_list := $(foreach test_name, $(TESTS_progs_M),\
71 $(if $(findstring kms_,$(test_name)),$(test_name)))
72 skip_tests_list += $(tmp_list)
73
Tim Gore41cbe362014-05-12 13:39:00 +010074 IGT_LOCAL_CFLAGS += -DANDROID_HAS_CAIRO=0
75endif
Oscar Mateo76c78c02013-11-12 11:50:45 +000076
Tim Gore0be29da2014-05-13 09:34:42 +010077# create two test lists, one for simple single tests, one for tests that have subtests
78tests_list := $(filter-out $(skip_tests_list),$(TESTS_progs) $(HANG) $(TESTS_testsuite))
79tests_list_M := $(filter-out $(skip_tests_list),$(TESTS_progs_M))
Oscar Mateo76c78c02013-11-12 11:50:45 +000080
Tim Gore0be29da2014-05-13 09:34:42 +010081$(foreach item,$(tests_list),$(eval $(call add_test,$(item),"IGT_SINGLE_TEST")))
82$(foreach item,$(tests_list_M),$(eval $(call add_test,$(item),"IGT_MULTI_TEST")))
Oscar Mateo76c78c02013-11-12 11:50:45 +000083