Oscar Mateo | 76c78c0 | 2013-11-12 11:50:45 +0000 | [diff] [blame] | 1 | include $(LOCAL_PATH)/tools/Makefile.sources |
| 2 | include $(LOCAL_PATH)/lib/Makefile.sources |
| 3 | |
| 4 | LIBPCIACCESS_PATH := $(firstword $(wildcard \ |
| 5 | $(TOP)/external/PRIVATE/libpciaccess \ |
| 6 | $(TOP)/hardware/intel/libpciaccess \ |
| 7 | $(TOP)/external/libpciaccess)) |
| 8 | ifeq ($(LIBPCIACCESS_PATH),) |
| 9 | $(error "Unable to find libpciaccess!") |
| 10 | endif |
| 11 | |
| 12 | LIBDRM_PATH := $(firstword $(wildcard \ |
| 13 | $(TOP)/external/PRIVATE/drm \ |
| 14 | $(TOP)/external/drm)) |
| 15 | ifeq ($(LIBDRM_PATH),) |
| 16 | $(error "Unable to find libdrm!") |
| 17 | endif |
| 18 | |
| 19 | skip_lib_list := \ |
| 20 | igt_kms.c \ |
| 21 | igt_kms.h |
| 22 | |
| 23 | lib_list := $(filter-out $(skip_lib_list),$(libintel_tools_la_SOURCES)) |
| 24 | LIB_SOURCES := $(addprefix lib/,$(lib_list)) |
| 25 | |
| 26 | #================# |
| 27 | |
| 28 | define add_tool |
| 29 | include $(CLEAR_VARS) |
| 30 | |
| 31 | LOCAL_SRC_FILES := \ |
| 32 | tools/$1.c \ |
| 33 | $(LIB_SOURCES) |
| 34 | |
| 35 | LOCAL_C_INCLUDES += \ |
| 36 | $(LOCAL_PATH)/lib \ |
| 37 | $(LIBDRM_PATH)/include/drm \ |
| 38 | $(LIBDRM_PATH)/intel \ |
| 39 | $(LIBPCIACCESS_PATH)/include |
| 40 | |
| 41 | LOCAL_CFLAGS += -DHAVE_TERMIOS_H |
| 42 | LOCAL_CFLAGS += -DHAVE_STRUCT_SYSINFO_TOTALRAM |
Devon Davies | 67c80f8 | 2014-01-08 16:07:06 +0000 | [diff] [blame] | 43 | LOCAL_CFLAGS += -DANDROID -UNDEBUG |
Oscar Mateo | 76c78c0 | 2013-11-12 11:50:45 +0000 | [diff] [blame] | 44 | LOCAL_CFLAGS += -std=c99 |
| 45 | # FIXME: drop once Bionic correctly annotates "noreturn" on pthread_exit |
| 46 | LOCAL_CFLAGS += -Wno-error=return-type |
| 47 | # Excessive complaining for established cases. Rely on the Linux version warnings. |
| 48 | LOCAL_CFLAGS += -Wno-sign-compare |
| 49 | |
| 50 | LOCAL_MODULE := $1 |
| 51 | LOCAL_MODULE_TAGS := optional |
| 52 | |
| 53 | LOCAL_SHARED_LIBRARIES := libpciaccess \ |
| 54 | libdrm \ |
| 55 | libdrm_intel |
| 56 | |
| 57 | include $(BUILD_EXECUTABLE) |
| 58 | endef |
| 59 | |
| 60 | #================# |
| 61 | |
| 62 | skip_tools_list := \ |
| 63 | intel_framebuffer_dump \ |
| 64 | intel_reg_dumper \ |
| 65 | intel_vga_read \ |
| 66 | intel_vga_write |
| 67 | |
Tvrtko Ursulin | 4a9b70c | 2014-01-22 10:41:05 +0000 | [diff] [blame^] | 68 | tools_list := $(filter-out $(skip_tools_list),$(bin_PROGRAMS)) |
Oscar Mateo | 76c78c0 | 2013-11-12 11:50:45 +0000 | [diff] [blame] | 69 | |
| 70 | $(foreach item,$(tools_list),$(eval $(call add_tool,$(item)))) |