From patchwork Tue Nov 12 11:50:45 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: oscar.mateo@intel.com X-Patchwork-Id: 3171641 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id ABB4DC045B for ; Tue, 12 Nov 2013 10:54:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0B55120216 for ; Tue, 12 Nov 2013 10:54:37 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id D4D642037F for ; Tue, 12 Nov 2013 10:54:31 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4BC1DFA94A; Tue, 12 Nov 2013 02:54:29 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTP id E6B18FA937 for ; Tue, 12 Nov 2013 02:54:21 -0800 (PST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP; 12 Nov 2013 02:54:21 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.93,535,1378882800"; d="scan'208";a="433803034" Received: from omateolo-linux2.isw.intel.com ([10.102.226.43]) by orsmga002.jf.intel.com with ESMTP; 12 Nov 2013 02:54:20 -0800 From: oscar.mateo@intel.com To: intel-gfx@lists.freedesktop.org Date: Tue, 12 Nov 2013 11:50:45 +0000 Message-Id: <1384257045-15524-12-git-send-email-oscar.mateo@intel.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1384257045-15524-1-git-send-email-oscar.mateo@intel.com> References: <1384257045-15524-1-git-send-email-oscar.mateo@intel.com> Subject: [Intel-gfx] [PATCH v2 11/11] build: New Android makefiles X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Oscar Mateo These form the basis of the new Android build system. v2: As suggested by Daniel Vetter, modify compilation flags to not error on return-type and not warn on sign-compare. Signed-off-by: Oscar Mateo --- Android.mk | 530 +----------------------------------------------------- tests/Android.mk | 77 ++++++++ tools/Android.mk | 70 ++++++++ 3 files changed, 149 insertions(+), 528 deletions(-) create mode 100644 tests/Android.mk create mode 100644 tools/Android.mk diff --git a/Android.mk b/Android.mk index 3be3462..7b42d10 100644 --- a/Android.mk +++ b/Android.mk @@ -1,531 +1,5 @@ LOCAL_PATH := $(call my-dir) -include $(CLEAR_VARS) -LOCAL_SRC_FILES := \ - tools/intel_reg_write.c \ - lib/intel_pci.c \ - lib/intel_gpu_tools.h \ - tools/intel_reg.h \ - lib/intel_batchbuffer.h \ - lib/intel_batchbuffer.c \ - lib/intel_reg_map.c \ - lib/intel_mmio.c \ - tools/intel_chipset.h - - -LOCAL_C_INCLUDES += \ - $(LOCAL_PATH)/lib \ - $(TOPDIR)hardware/intel/libdrm/include/drm \ - $(TOPDIR)hardware/intel/libdrm/intel \ - $(LOCAL_PATH)/../libpciaccess/include/ - -LOCAL_CFLAGS += -DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1 -LOCAL_CFLAGS += -DANDROID - -LOCAL_MODULE := intel_reg_write -LOCAL_MODULE_TAGS := optional - -LOCAL_SHARED_LIBRARIES := libpciaccess \ - libdrm \ - libdrm_intel - -include $(BUILD_EXECUTABLE) - -#================ -include $(CLEAR_VARS) - -LOCAL_SRC_FILES := \ - tools/intel_reg_read.c \ - lib/intel_pci.c \ - lib/intel_gpu_tools.h \ - tools/intel_reg.h \ - lib/intel_batchbuffer.h \ - lib/intel_batchbuffer.c \ - lib/intel_reg_map.c \ - lib/intel_mmio.c \ - tools/intel_chipset.h - - -LOCAL_C_INCLUDES += \ - $(LOCAL_PATH)/lib \ - $(TOPDIR)hardware/intel/libdrm/include/drm \ - $(TOPDIR)hardware/intel/libdrm/intel \ - $(LOCAL_PATH)/../libpciaccess/include/ - -LOCAL_CFLAGS += -DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1 -LOCAL_CFLAGS += -DANDROID - - -LOCAL_MODULE := intel_reg_read -LOCAL_MODULE_TAGS := optional - -LOCAL_SHARED_LIBRARIES := libpciaccess \ - libdrm \ - libdrm_intel - -include $(BUILD_EXECUTABLE) - -#================ -include $(CLEAR_VARS) - -LOCAL_SRC_FILES := \ - tools/intel_disable_clock_gating.c \ - lib/intel_pci.c \ - lib/intel_gpu_tools.h \ - tools/intel_reg.h \ - lib/intel_batchbuffer.h \ - lib/intel_batchbuffer.c \ - lib/intel_mmio.c \ - tools/intel_chipset.h - - -LOCAL_C_INCLUDES += \ - $(LOCAL_PATH)/lib \ - $(TOPDIR)hardware/intel/libdrm/include/drm \ - $(TOPDIR)hardware/intel/libdrm/intel \ - $(LOCAL_PATH)/../libpciaccess/include/ - -LOCAL_CFLAGS += -DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1 -LOCAL_CFLAGS += -DANDROID - - -LOCAL_MODULE := intel_disable_clock_gating -LOCAL_MODULE_TAGS := optional - -LOCAL_SHARED_LIBRARIES := libpciaccess \ - libdrm \ - libdrm_intel - -include $(BUILD_EXECUTABLE) - -#================ -include $(CLEAR_VARS) - -LOCAL_SRC_FILES := \ - tools/intel_audio_dump.c \ - lib/intel_pci.c \ - lib/intel_gpu_tools.h \ - tools/intel_reg.h \ - lib/intel_batchbuffer.h \ - lib/intel_batchbuffer.c \ - lib/intel_mmio.c \ - tools/intel_chipset.h - - -LOCAL_C_INCLUDES += \ - $(LOCAL_PATH)/lib \ - $(TOPDIR)hardware/intel/libdrm/include/drm \ - $(TOPDIR)hardware/intel/libdrm/intel \ - $(LOCAL_PATH)/../libpciaccess/include/ - -LOCAL_CFLAGS += -DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1 -LOCAL_CFLAGS += -DANDROID - - -LOCAL_MODULE := intel_audio_dump -LOCAL_MODULE_TAGS := optional - -LOCAL_SHARED_LIBRARIES := libpciaccess \ - libdrm \ - libdrm_intel - -include $(BUILD_EXECUTABLE) - -#================ -include $(CLEAR_VARS) - -LOCAL_SRC_FILES := \ - tools/intel_backlight.c \ - lib/intel_pci.c \ - lib/intel_gpu_tools.h \ - tools/intel_reg.h \ - lib/intel_batchbuffer.h \ - lib/intel_batchbuffer.c \ - lib/intel_mmio.c \ - tools/intel_chipset.h - - -LOCAL_C_INCLUDES += \ - $(LOCAL_PATH)/lib \ - $(TOPDIR)hardware/intel/libdrm/include/drm \ - $(TOPDIR)hardware/intel/libdrm/intel \ - $(LOCAL_PATH)/../libpciaccess/include/ - -LOCAL_CFLAGS += -DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1 -LOCAL_CFLAGS += -DANDROID - - -LOCAL_MODULE := intel_backlight -LOCAL_MODULE_TAGS := optional - -LOCAL_SHARED_LIBRARIES := libpciaccess \ - libdrm \ - libdrm_intel - -include $(BUILD_EXECUTABLE) - -#================ -include $(CLEAR_VARS) - -LOCAL_SRC_FILES := \ - tools/intel_bios_dumper.c \ - lib/intel_pci.c \ - lib/intel_gpu_tools.h \ - tools/intel_reg.h \ - lib/intel_batchbuffer.h \ - lib/intel_batchbuffer.c \ - lib/intel_mmio.c \ - tools/intel_chipset.h - - -LOCAL_C_INCLUDES += \ - $(LOCAL_PATH)/lib \ - $(TOPDIR)hardware/intel/libdrm/include/drm \ - $(TOPDIR)hardware/intel/libdrm/intel \ - $(LOCAL_PATH)/../libpciaccess/include/ - -LOCAL_CFLAGS += -DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1 -LOCAL_CFLAGS += -DANDROID - - -LOCAL_MODULE := intel_bios_dumper -LOCAL_MODULE_TAGS := optional - -LOCAL_SHARED_LIBRARIES := libpciaccess \ - libdrm \ - libdrm_intel - -include $(BUILD_EXECUTABLE) - -#================ -include $(CLEAR_VARS) - -LOCAL_SRC_FILES := \ - tools/intel_bios_reader.c \ - lib/intel_pci.c \ - lib/intel_gpu_tools.h \ - tools/intel_reg.h \ - lib/intel_batchbuffer.h \ - lib/intel_batchbuffer.c \ - lib/intel_mmio.c \ - tools/intel_chipset.h - - -LOCAL_C_INCLUDES += \ - $(LOCAL_PATH)/lib \ - $(TOPDIR)hardware/intel/libdrm/include/drm \ - $(TOPDIR)hardware/intel/libdrm/intel \ - $(LOCAL_PATH)/../libpciaccess/include/ - -LOCAL_CFLAGS += -DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1 -LOCAL_CFLAGS += -DANDROID - - -LOCAL_MODULE := intel_bios_reader -LOCAL_MODULE_TAGS := optional - -LOCAL_SHARED_LIBRARIES := libpciaccess \ - libdrm \ - libdrm_intel - -include $(BUILD_EXECUTABLE) - -#================ -# Disabling intel_error_decode tool, since Android still does not have libdrm2.4.30 -#================ -#include $(CLEAR_VARS) -# -#LOCAL_SRC_FILES := \ -# tools/intel_error_decode.c \ -# lib/intel_pci.c \ -# lib/intel_gpu_tools.h \ -# tools/intel_reg.h \ -# lib/intel_batchbuffer.h \ -# lib/intel_batchbuffer.c \ -# lib/intel_mmio.c \ -# tools/intel_chipset.h \ -# lib/instdone.h \ -# lib/instdone.c \ -# tools/intel_decode.h \ -# lib/intel_drm.c -# -# -#LOCAL_C_INCLUDES += \ -# $(LOCAL_PATH)/lib \ -# $(TOPDIR)hardware/intel/libdrm/include/drm \ -# $(TOPDIR)hardware/intel/libdrm/intel \ -# $(LOCAL_PATH)/../libpciaccess/include/ -# -#LOCAL_CFLAGS += -DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1 -#LOCAL_CFLAGS += -DANDROID -#LOCAL_CFLAGS += -std=c99 -# -# -#LOCAL_MODULE := intel_error_decode -#LOCAL_MODULE_TAGS := optional -# -#LOCAL_SHARED_LIBRARIES := libpciaccess \ -# libdrm \ -# libdrm_intel -# -#include $(BUILD_EXECUTABLE) -# -#================ -include $(CLEAR_VARS) - -LOCAL_SRC_FILES := \ - tools/intel_gpu_top.c \ - lib/intel_pci.c \ - lib/intel_gpu_tools.h \ - tools/intel_reg.h \ - lib/intel_batchbuffer.h \ - lib/intel_batchbuffer.c \ - lib/intel_mmio.c \ - tools/intel_chipset.h \ - lib/instdone.h \ - lib/instdone.c \ - lib/intel_reg_map.c - - -LOCAL_C_INCLUDES += \ - $(LOCAL_PATH)/lib \ - $(TOPDIR)hardware/intel/libdrm/include/drm \ - $(TOPDIR)hardware/intel/libdrm/intel \ - $(LOCAL_PATH)/../libpciaccess/include/ - -LOCAL_CFLAGS += -DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1 -LOCAL_CFLAGS += -DANDROID - - -LOCAL_MODULE := intel_gpu_top -LOCAL_MODULE_TAGS := optional - -LOCAL_SHARED_LIBRARIES := libpciaccess \ - libdrm \ - libdrm_intel - -include $(BUILD_EXECUTABLE) - -#================ -include $(CLEAR_VARS) - -LOCAL_SRC_FILES := \ - tools/intel_gpu_time.c \ - lib/intel_pci.c \ - lib/intel_gpu_tools.h \ - tools/intel_reg.h \ - lib/intel_batchbuffer.h \ - lib/intel_batchbuffer.c \ - lib/intel_mmio.c \ - tools/intel_chipset.h - - -LOCAL_C_INCLUDES += \ - $(LOCAL_PATH)/lib \ - $(TOPDIR)hardware/intel/libdrm/include/drm \ - $(TOPDIR)hardware/intel/libdrm/intel \ - $(LOCAL_PATH)/../libpciaccess/include/ - -LOCAL_CFLAGS += -DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1 -LOCAL_CFLAGS += -DANDROID - - -LOCAL_MODULE := intel_gpu_time -LOCAL_MODULE_TAGS := optional - -LOCAL_SHARED_LIBRARIES := libpciaccess \ - libdrm \ - libdrm_intel - -include $(BUILD_EXECUTABLE) - -#================ -include $(CLEAR_VARS) - -LOCAL_SRC_FILES := \ - tools/intel_gtt.c \ - lib/intel_pci.c \ - lib/intel_gpu_tools.h \ - tools/intel_reg.h \ - lib/intel_batchbuffer.h \ - lib/intel_batchbuffer.c \ - lib/intel_mmio.c \ - tools/intel_chipset.h - - -LOCAL_C_INCLUDES += \ - $(LOCAL_PATH)/lib \ - $(TOPDIR)hardware/intel/libdrm/include/drm \ - $(TOPDIR)hardware/intel/libdrm/intel \ - $(LOCAL_PATH)/../libpciaccess/include/ - -LOCAL_CFLAGS += -DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1 - -LOCAL_MODULE := intel_gtt -LOCAL_MODULE_TAGS := optional - -LOCAL_SHARED_LIBRARIES := libpciaccess \ - libdrm \ - libdrm_intel - -include $(BUILD_EXECUTABLE) - -#================ -include $(CLEAR_VARS) - -LOCAL_SRC_FILES := \ - tools/intel_stepping.c \ - lib/intel_pci.c \ - lib/intel_gpu_tools.h \ - tools/intel_reg.h \ - lib/intel_batchbuffer.h \ - lib/intel_batchbuffer.c \ - lib/intel_mmio.c \ - tools/intel_chipset.h - - -LOCAL_C_INCLUDES += \ - $(LOCAL_PATH)/lib \ - $(TOPDIR)hardware/intel/libdrm/include/drm \ - $(TOPDIR)hardware/intel/libdrm/intel \ - $(LOCAL_PATH)/../libpciaccess/include/ - -LOCAL_CFLAGS += -DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1 -LOCAL_CFLAGS += -DANDROID - - -LOCAL_MODULE := intel_stepping -LOCAL_MODULE_TAGS := optional - -LOCAL_SHARED_LIBRARIES := libpciaccess \ - libdrm \ - libdrm_intel - -include $(BUILD_EXECUTABLE) - -#================ -include $(CLEAR_VARS) - -LOCAL_SRC_FILES := \ - tools/intel_reg_dumper.c \ - lib/intel_pci.c \ - lib/intel_gpu_tools.h \ - tools/intel_reg.h \ - lib/intel_batchbuffer.h \ - lib/intel_batchbuffer.c \ - lib/intel_mmio.c \ - tools/intel_chipset.h - - -LOCAL_C_INCLUDES += \ - $(LOCAL_PATH)/lib \ - $(TOPDIR)hardware/intel/libdrm/include/drm \ - $(TOPDIR)hardware/intel/libdrm/intel \ - $(LOCAL_PATH)/../libpciaccess/include/ - -LOCAL_CFLAGS += -DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1 -LOCAL_CFLAGS += -DANDROID - - -LOCAL_MODULE := intel_reg_dumper -LOCAL_MODULE_TAGS := optional - -LOCAL_SHARED_LIBRARIES := libpciaccess \ - libdrm \ - libdrm_intel - -include $(BUILD_EXECUTABLE) - -#================ -include $(CLEAR_VARS) - -LOCAL_SRC_FILES := \ - tools/intel_reg_snapshot.c \ - lib/intel_pci.c \ - lib/intel_gpu_tools.h \ - tools/intel_reg.h \ - lib/intel_batchbuffer.h \ - lib/intel_batchbuffer.c \ - lib/intel_mmio.c \ - tools/intel_chipset.h - - -LOCAL_C_INCLUDES += \ - $(LOCAL_PATH)/lib \ - $(TOPDIR)hardware/intel/libdrm/include/drm \ - $(TOPDIR)hardware/intel/libdrm/intel \ - $(LOCAL_PATH)/../libpciaccess/include/ - -LOCAL_CFLAGS += -DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1 - -LOCAL_MODULE := intel_reg_snapshot -LOCAL_MODULE_TAGS := optional - -LOCAL_SHARED_LIBRARIES := libpciaccess \ - libdrm \ - libdrm_intel - -include $(BUILD_EXECUTABLE) - -#================ -include $(CLEAR_VARS) - -LOCAL_SRC_FILES := \ - tools/forcewaked.c \ - lib/intel_pci.c \ - lib/intel_gpu_tools.h \ - tools/intel_reg.h \ - lib/intel_batchbuffer.h \ - lib/intel_batchbuffer.c \ - lib/intel_mmio.c \ - tools/intel_chipset.h \ - lib/intel_reg_map.c \ - lib/intel_drm.c - - -LOCAL_C_INCLUDES += \ - $(LOCAL_PATH)/lib \ - $(TOPDIR)hardware/intel/libdrm/include/drm \ - $(TOPDIR)hardware/intel/libdrm/intel \ - $(LOCAL_PATH)/../libpciaccess/include/ - -LOCAL_CFLAGS += -DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1 -LOCAL_CFLAGS += -DANDROID - - -LOCAL_MODULE := forcewaked -LOCAL_MODULE_TAGS := optional - -LOCAL_SHARED_LIBRARIES := libpciaccess \ - libdrm \ - libdrm_intel - -include $(BUILD_EXECUTABLE) - -#================ -include $(CLEAR_VARS) - -LOCAL_SRC_FILES := \ - lib/intel_gpu_tools.h \ - tools/intel_reg_checker.c \ - lib/intel_pci.c \ - lib/intel_mmio.c - - -LOCAL_C_INCLUDES += \ - $(LOCAL_PATH)/lib \ - $(TOPDIR)hardware/intel/libdrm/include/drm \ - $(TOPDIR)hardware/intel/libdrm/intel \ - $(LOCAL_PATH)/../libpciaccess/include/ - -LOCAL_CFLAGS += -DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1 -LOCAL_CFLAGS += -DANDROID - - -LOCAL_MODULE := intel_reg_checker -LOCAL_MODULE_TAGS := optional - -LOCAL_SHARED_LIBRARIES := libpciaccess - -include $(BUILD_EXECUTABLE) +include $(LOCAL_PATH)/tests/Android.mk +include $(LOCAL_PATH)/tools/Android.mk diff --git a/tests/Android.mk b/tests/Android.mk new file mode 100644 index 0000000..1bd3d21 --- /dev/null +++ b/tests/Android.mk @@ -0,0 +1,77 @@ +include $(LOCAL_PATH)/tests/Makefile.sources +include $(LOCAL_PATH)/lib/Makefile.sources + +LIBPCIACCESS_PATH := $(firstword $(wildcard \ + $(TOP)/external/PRIVATE/libpciaccess \ + $(TOP)/hardware/intel/libpciaccess \ + $(TOP)/external/libpciaccess)) +ifeq ($(LIBPCIACCESS_PATH),) + $(error "Unable to find libpciaccess!") +endif + +LIBDRM_PATH := $(firstword $(wildcard \ + $(TOP)/external/PRIVATE/drm \ + $(TOP)/external/drm)) +ifeq ($(LIBDRM_PATH),) + $(error "Unable to find libdrm!") +endif + +skip_lib_list := \ + igt_kms.c \ + igt_kms.h + +lib_list := $(filter-out $(skip_lib_list),$(libintel_tools_la_SOURCES)) +LIB_SOURCES := $(addprefix lib/,$(lib_list)) + +#================# + +define add_test + include $(CLEAR_VARS) + + LOCAL_SRC_FILES := \ + tests/$1.c \ + $(LIB_SOURCES) + + + LOCAL_C_INCLUDES += \ + $(LOCAL_PATH)/lib \ + $(LIBDRM_PATH)/include/drm \ + $(LIBDRM_PATH)/intel \ + $(LIBPCIACCESS_PATH)/include + + LOCAL_CFLAGS += -DHAVE_STRUCT_SYSINFO_TOTALRAM + LOCAL_CFLAGS += -DANDROID + LOCAL_CFLAGS += -std=c99 + # FIXME: drop once Bionic correctly annotates "noreturn" on pthread_exit + LOCAL_CFLAGS += -Wno-error=return-type + # Excessive complaining for established cases. Rely on the Linux version warnings. + LOCAL_CFLAGS += -Wno-sign-compare + + LOCAL_MODULE := $1 + LOCAL_MODULE_TAGS := optional + + LOCAL_SHARED_LIBRARIES := libpciaccess \ + libdrm \ + libdrm_intel + + include $(BUILD_EXECUTABLE) +endef + +#================# + +skip_tests_list := \ + testdisplay \ + kms_addfb \ + kms_cursor_crc \ + kms_flip \ + kms_pipe_crc_basic \ + kms_render \ + kms_setmode \ + pm_pc8 \ + gem_seqno_wrap \ + gem_render_copy + +tests_list := $(filter-out $(skip_tests_list),$(TESTS_progs) $(TESTS_progs_M) $(HANG) $(TESTS_testsuite)) + +$(foreach item,$(tests_list),$(eval $(call add_test,$(item)))) + diff --git a/tools/Android.mk b/tools/Android.mk new file mode 100644 index 0000000..4a19b6c --- /dev/null +++ b/tools/Android.mk @@ -0,0 +1,70 @@ +include $(LOCAL_PATH)/tools/Makefile.sources +include $(LOCAL_PATH)/lib/Makefile.sources + +LIBPCIACCESS_PATH := $(firstword $(wildcard \ + $(TOP)/external/PRIVATE/libpciaccess \ + $(TOP)/hardware/intel/libpciaccess \ + $(TOP)/external/libpciaccess)) +ifeq ($(LIBPCIACCESS_PATH),) + $(error "Unable to find libpciaccess!") +endif + +LIBDRM_PATH := $(firstword $(wildcard \ + $(TOP)/external/PRIVATE/drm \ + $(TOP)/external/drm)) +ifeq ($(LIBDRM_PATH),) + $(error "Unable to find libdrm!") +endif + +skip_lib_list := \ + igt_kms.c \ + igt_kms.h + +lib_list := $(filter-out $(skip_lib_list),$(libintel_tools_la_SOURCES)) +LIB_SOURCES := $(addprefix lib/,$(lib_list)) + +#================# + +define add_tool + include $(CLEAR_VARS) + + LOCAL_SRC_FILES := \ + tools/$1.c \ + $(LIB_SOURCES) + + LOCAL_C_INCLUDES += \ + $(LOCAL_PATH)/lib \ + $(LIBDRM_PATH)/include/drm \ + $(LIBDRM_PATH)/intel \ + $(LIBPCIACCESS_PATH)/include + + LOCAL_CFLAGS += -DHAVE_TERMIOS_H + LOCAL_CFLAGS += -DHAVE_STRUCT_SYSINFO_TOTALRAM + LOCAL_CFLAGS += -DANDROID + LOCAL_CFLAGS += -std=c99 + # FIXME: drop once Bionic correctly annotates "noreturn" on pthread_exit + LOCAL_CFLAGS += -Wno-error=return-type + # Excessive complaining for established cases. Rely on the Linux version warnings. + LOCAL_CFLAGS += -Wno-sign-compare + + LOCAL_MODULE := $1 + LOCAL_MODULE_TAGS := optional + + LOCAL_SHARED_LIBRARIES := libpciaccess \ + libdrm \ + libdrm_intel + + include $(BUILD_EXECUTABLE) +endef + +#================# + +skip_tools_list := \ + intel_framebuffer_dump \ + intel_reg_dumper \ + intel_vga_read \ + intel_vga_write + +tools_list := $(filter-out $(skip_tools_list),$(bin_PROGRAMS) $(noinst_PROGRAMS)) + +$(foreach item,$(tools_list),$(eval $(call add_tool,$(item))))