blob: 5bda48970149093444c13882052ae6a502441f6c [file] [log] [blame]
Oscar Mateo76c78c02013-11-12 11:50:45 +00001include $(LOCAL_PATH)/tools/Makefile.sources
2include $(LOCAL_PATH)/lib/Makefile.sources
3
4LIBPCIACCESS_PATH := $(firstword $(wildcard \
5 $(TOP)/external/PRIVATE/libpciaccess \
6 $(TOP)/hardware/intel/libpciaccess \
7 $(TOP)/external/libpciaccess))
8ifeq ($(LIBPCIACCESS_PATH),)
9 $(error "Unable to find libpciaccess!")
10endif
11
12LIBDRM_PATH := $(firstword $(wildcard \
13 $(TOP)/external/PRIVATE/drm \
14 $(TOP)/external/drm))
15ifeq ($(LIBDRM_PATH),)
16 $(error "Unable to find libdrm!")
17endif
18
19skip_lib_list := \
20 igt_kms.c \
21 igt_kms.h
22
23lib_list := $(filter-out $(skip_lib_list),$(libintel_tools_la_SOURCES))
24LIB_SOURCES := $(addprefix lib/,$(lib_list))
25
26#================#
27
28define 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 Davies67c80f82014-01-08 16:07:06 +000043 LOCAL_CFLAGS += -DANDROID -UNDEBUG
Oscar Mateo76c78c02013-11-12 11:50:45 +000044 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)
58endef
59
60#================#
61
62skip_tools_list := \
63 intel_framebuffer_dump \
64 intel_reg_dumper \
65 intel_vga_read \
66 intel_vga_write
67
68tools_list := $(filter-out $(skip_tools_list),$(bin_PROGRAMS) $(noinst_PROGRAMS))
69
70$(foreach item,$(tools_list),$(eval $(call add_tool,$(item))))