xref: /libpciaccess/Android.mk (revision 59d0176a)
1#
2# Copyright © 2011 Intel Corporation
3#
4# Permission is hereby granted, free of charge, to any person obtaining a
5# copy of this software and associated documentation files (the "Software"),
6# to deal in the Software without restriction, including without limitation
7# on the rights to use, copy, modify, merge, publish, distribute, sub
8# license, and/or sell copies of the Software, and to permit persons to whom
9# the Software is furnished to do so, subject to the following conditions:
10#
11# The above copyright notice and this permission notice (including the next
12# paragraph) shall be included in all copies or substantial portions of the
13# Software.
14#
15# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.  IN NO EVENT SHALL
18# IBM AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21# DEALINGS IN THE SOFTWARE.
22#
23
24LIBPCIACCESS_VALID_GPU_DRIVERS := i915 i965
25
26# Skip the makefile if we're not building for a known GPU.
27ifneq ($(filter $(BOARD_GPU_DRIVERS), $(LIBPCIACCESS_VALID_GPU_DRIVERS)),)
28
29# Validate needed variables.
30ifndef BOARD_LIBPCIACCESS_HWDATA
31    $(error BOARD_LIBPCIACCESS_HWDATA is undefined)
32endif
33
34LOCAL_PATH := $(call my-dir)
35include $(CLEAR_VARS)
36
37LOCAL_MODULE := libpciaccess
38LOCAL_MODULE_TAGS := optional
39
40LOCAL_C_FLAGS := \
41    -DHAVE_INTTYPES_H \
42    -DHAVE_MTRR \
43    -DHAVE_STDINT_H \
44    -DHAVE_STRINGS_H \
45    -DHAVE_STRING_H \
46    -DPCIIDS_PATH=$(BOARD_LIBPCIACCESS_HWDATA)
47
48LOCAL_C_INCLUDES := \
49	$(LOCAL_PATH)/include
50
51LOCAL_SRC_FILES := \
52	src/common_bridge.c \
53	src/common_capability.c \
54	src/common_device_name.c \
55	src/common_init.c \
56	src/common_interface.c \
57	src/common_io.c \
58	src/common_iterator.c \
59	src/common_map.c \
60	src/common_vgaarb.c \
61	src/linux_devmem.c \
62	src/linux_sysfs.c
63
64include $(BUILD_SHARED_LIBRARY)
65
66endif # BOARD_GPU_DRIVERS
67