GitLab will be down for maintenance this Sunday 13th June, from approx 7-11am UTC. This is for a PostgreSQL migration. See the tracker issue for more informations.

Commit 03d2e91d authored by Emil Velikov's avatar Emil Velikov
Browse files

android: introduce Android.common.mk to reduce boilerplate



... across the makefiles. Currently this isn't much but that will change
shortly.

As an added bonus this fixes all present and future cases where we've
forgotten to strip out the headers from LOCAL_SRC_FILES.

In a couple of cases (the tests) we start setting
LOCAL_EXPORT_C_INCLUDE_DIRS, which shouldn't be an issue.

Cc: Chih-Wei Huang <cwhuang@android-x86.org>
Cc: Rob Herring <robh@kernel.org>
Signed-off-by: Emil Velikov's avatarEmil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Rob Herring's avatarRob Herring <robh@kernel.org>
parent de5b41ef
LOCAL_CFLAGS += \
-DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1
# Quiet down the build system and remove any .h files from the sources
LOCAL_SRC_FILES := $(patsubst %.h, , $(LOCAL_SRC_FILES))
LOCAL_EXPORT_C_INCLUDE_DIRS += $(LOCAL_PATH)
......@@ -21,6 +21,8 @@
# IN THE SOFTWARE.
#
LIBDRM_COMMON_MK := $(call my-dir)/Android.common.mk
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
......@@ -31,7 +33,7 @@ include $(LOCAL_PATH)/Makefile.sources
include $(CLEAR_VARS)
LOCAL_MODULE := libdrm
LOCAL_SRC_FILES := $(patsubst %.h, , $(LIBDRM_FILES))
LOCAL_SRC_FILES := $(LIBDRM_FILES)
LOCAL_EXPORT_C_INCLUDE_DIRS := \
$(LOCAL_PATH) \
$(LOCAL_PATH)/include/drm
......@@ -40,25 +42,26 @@ LOCAL_C_INCLUDES := \
$(LOCAL_PATH)/include/drm
LOCAL_CFLAGS := \
-DHAVE_VISIBILITY=1 \
-DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1
-DHAVE_VISIBILITY=1
include $(LIBDRM_COMMON_MK)
include $(BUILD_STATIC_LIBRARY)
# Shared library for the device
include $(CLEAR_VARS)
LOCAL_MODULE := libdrm
LOCAL_SRC_FILES := $(patsubst %.h, , $(LIBDRM_FILES))
LOCAL_SRC_FILES := $(LIBDRM_FILES)
LOCAL_EXPORT_C_INCLUDE_DIRS := \
$(LOCAL_PATH) \
$(LOCAL_PATH)/include/drm
LOCAL_C_INCLUDES := \
$(LOCAL_PATH)/include/drm
LOCAL_CFLAGS := \
-DHAVE_VISIBILITY=1 \
-DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1
-DHAVE_VISIBILITY=1
include $(LIBDRM_COMMON_MK)
include $(BUILD_SHARED_LIBRARY)
include $(call all-makefiles-under,$(LOCAL_PATH))
......@@ -8,10 +8,7 @@ LOCAL_MODULE := libdrm_amdgpu
LOCAL_SHARED_LIBRARIES := libdrm
LOCAL_SRC_FILES := $(patsubst %.h, , $(LIBDRM_AMDGPU_FILES))
LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
LOCAL_CFLAGS := \
-DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1
LOCAL_SRC_FILES := $(LIBDRM_AMDGPU_FILES)
include $(LIBDRM_COMMON_MK)
include $(BUILD_SHARED_LIBRARY)
......@@ -8,10 +8,7 @@ LOCAL_MODULE := libdrm_etnaviv
LOCAL_SHARED_LIBRARIES := libdrm
LOCAL_SRC_FILES := $(patsubst %.h, , $(LIBDRM_ETNAVIV_FILES))
LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
LOCAL_CFLAGS := \
-DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1
LOCAL_SRC_FILES := $(LIBDRM_ETNAVIV_FILES)
include $(LIBDRM_COMMON_MK)
include $(BUILD_SHARED_LIBRARY)
......@@ -8,10 +8,7 @@ LOCAL_MODULE := libdrm_freedreno
LOCAL_SHARED_LIBRARIES := libdrm
LOCAL_SRC_FILES := $(patsubst %.h, , $(LIBDRM_FREEDRENO_FILES))
LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
LOCAL_CFLAGS := \
-DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1
LOCAL_SRC_FILES := $(LIBDRM_FREEDRENO_FILES)
include $(LIBDRM_COMMON_MK)
include $(BUILD_SHARED_LIBRARY)
......@@ -29,14 +29,11 @@ include $(LOCAL_PATH)/Makefile.sources
LOCAL_MODULE := libdrm_intel
LOCAL_SRC_FILES := $(patsubst %.h, , $(LIBDRM_INTEL_FILES))
LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
LOCAL_CFLAGS := \
-DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1
LOCAL_SRC_FILES := $(LIBDRM_INTEL_FILES)
LOCAL_SHARED_LIBRARIES := \
libdrm \
libpciaccess
include $(LIBDRM_COMMON_MK)
include $(BUILD_SHARED_LIBRARY)
......@@ -26,7 +26,7 @@ LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
include $(LOCAL_PATH)/Makefile.sources
LOCAL_SRC_FILES := $(patsubst %.h, , $(LIBKMS_FILES))
LOCAL_SRC_FILES := $(LIBKMS_FILES)
ifneq ($(filter $(vmwgfx_drivers), $(DRM_GPU_DRIVERS)),)
LOCAL_SRC_FILES += $(LIBKMS_VMWGFX_FILES)
......@@ -47,6 +47,5 @@ endif
LOCAL_MODULE := libkms
LOCAL_SHARED_LIBRARIES := libdrm
LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
include $(LIBDRM_COMMON_MK)
include $(BUILD_SHARED_LIBRARY)
......@@ -8,10 +8,7 @@ LOCAL_MODULE := libdrm_nouveau
LOCAL_SHARED_LIBRARIES := libdrm
LOCAL_SRC_FILES := $(patsubst %.h, , $(LIBDRM_NOUVEAU_FILES))
LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
LOCAL_CFLAGS := \
-DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1
LOCAL_SRC_FILES := $(LIBDRM_NOUVEAU_FILES)
include $(LIBDRM_COMMON_MK)
include $(BUILD_SHARED_LIBRARY)
......@@ -8,10 +8,7 @@ LOCAL_MODULE := libdrm_radeon
LOCAL_SHARED_LIBRARIES := libdrm
LOCAL_SRC_FILES := $(patsubst %.h, , $(LIBDRM_RADEON_FILES))
LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
LOCAL_CFLAGS := \
-DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1
LOCAL_SRC_FILES := $(LIBDRM_RADEON_FILES)
include $(LIBDRM_COMMON_MK)
include $(BUILD_SHARED_LIBRARY)
......@@ -3,11 +3,12 @@ LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
include $(LOCAL_PATH)/Makefile.sources
LOCAL_SRC_FILES := $(patsubst %.h, , $(MODETEST_FILES))
LOCAL_SRC_FILES := $(MODETEST_FILES)
LOCAL_MODULE := modetest
LOCAL_SHARED_LIBRARIES := libdrm
LOCAL_STATIC_LIBRARIES := libdrm_util
include $(LIBDRM_COMMON_MK)
include $(BUILD_EXECUTABLE)
......@@ -3,11 +3,12 @@ LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
include $(LOCAL_PATH)/Makefile.sources
LOCAL_SRC_FILES := $(patsubst %.h, , $(PROPTEST_FILES))
LOCAL_SRC_FILES := $(PROPTEST_FILES)
LOCAL_MODULE := proptest
LOCAL_SHARED_LIBRARIES := libdrm
LOCAL_STATIC_LIBRARIES := libdrm_util
include $(LIBDRM_COMMON_MK)
include $(BUILD_EXECUTABLE)
......@@ -30,9 +30,7 @@ LOCAL_MODULE := libdrm_util
LOCAL_SHARED_LIBRARIES := libdrm
LOCAL_SRC_FILES := $(patsubst %.h, , $(UTIL_FILES))
# avoid name clashes by requiring users to include util/*.h
LOCAL_EXPORT_C_INCLUDE_DIRS := $(dir $(LOCAL_PATH))
LOCAL_SRC_FILES := $(UTIL_FILES)
include $(LIBDRM_COMMON_MK)
include $(BUILD_STATIC_LIBRARY)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment