From patchwork Sun Jan 22 18:34:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Velikov X-Patchwork-Id: 9531427 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6CF2B601D4 for ; Sun, 22 Jan 2017 18:37:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5EE9D27CF9 for ; Sun, 22 Jan 2017 18:37:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 53D0027F9F; Sun, 22 Jan 2017 18:37:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D094A27CF9 for ; Sun, 22 Jan 2017 18:37:15 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AACF56E347; Sun, 22 Jan 2017 18:37:12 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm0-x241.google.com (mail-wm0-x241.google.com [IPv6:2a00:1450:400c:c09::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id EB6F56E004 for ; Sun, 22 Jan 2017 18:37:04 +0000 (UTC) Received: by mail-wm0-x241.google.com with SMTP id r144so20874852wme.0 for ; Sun, 22 Jan 2017 10:37:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=9zZtUkAMo3jqy4vZzIKBx3s1MjnvP5IyVozHehA2Fj0=; b=qX/sKDqQJQOberIIjMLCkWUzv261/kzbbb9TxTLCK7FrnVWcAG+0TdVJY89dDyt3VG 4Li8gVASTyvnWWNfUTbLGdIG56ER9CBw5NBIXFf998vcrED1UEG0AKrntOy2NFgIHHL1 gA321QE05803e3k8jrCItv+2plJsAZF0TRXU3QWbtmfTIRO33mrPBlzmKFFX/1eqH8CK EmTMJnvyapVpEbaW5XdfvRIkRYD2rRnmumR51UTdRv5bY1lrdHrXJqkuItg/YJbI92K1 /YALItG6w2qrKaPd/jef8Vs9pohL7mv1IOJSgo/nNiSdWsTBjz6N6R6swcnw3jvAugyI Y+sQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=9zZtUkAMo3jqy4vZzIKBx3s1MjnvP5IyVozHehA2Fj0=; b=sHk0QYJAeaQD6iPrX/ben5++H8Zm0rvxcY1IW/tATEVCTr7FsSOA/wLgYhY4Q+0O43 ViW6x/B/jm9E3T2Viz3Rm1dI984cR5lfTywynSyqxhUlngT8NdypsWJLpiyYqFvFELd5 ez/6fiSj8XUphsQadAXV3Av7mUQKyi672yskhJcPc8RyqzUqgauU8ndIPUXSikzD49z6 sW1BCkRcEBCMarA+NeuSGD3EAS66Jcaqln1WMb38bujm2D44DjT5h1jBlzTc+VQQIXt3 zXlOsmAdD2joJh2VgMfuS3RL3k2E5/+WvUMIjQiUFjlJ5l82XzScP1mm4raRCn1bQLP2 8G6Q== X-Gm-Message-State: AIkVDXKixY6m1/ah5YAwSzdlmNgdUIJKu34BEFvp9XOwn9NRrfHUftFlGVWbakPL/o6ctA== X-Received: by 10.223.176.210 with SMTP id j18mr24067294wra.8.1485110223185; Sun, 22 Jan 2017 10:37:03 -0800 (PST) Received: from localhost.localdomain (cpc91186-cmbg18-2-0-cust67.5-4.cable.virginm.net. [80.1.50.68]) by smtp.gmail.com with ESMTPSA id c202sm17099824wmd.10.2017.01.22.10.37.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 22 Jan 2017 10:37:02 -0800 (PST) From: Emil Velikov To: dri-devel@lists.freedesktop.org Subject: [PATCH libdrm 2/5] android: introduce Android.common.mk to reduce boilerplate Date: Sun, 22 Jan 2017 18:34:40 +0000 Message-Id: <20170122183443.11963-2-emil.l.velikov@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170122183443.11963-1-emil.l.velikov@gmail.com> References: <20170122183443.11963-1-emil.l.velikov@gmail.com> Cc: emil.l.velikov@gmail.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP ... 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 Cc: Rob Herring Signed-off-by: Emil Velikov --- Android.common.mk | 6 ++++++ Android.mk | 17 ++++++++++------- amdgpu/Android.mk | 7 ++----- etnaviv/Android.mk | 7 ++----- freedreno/Android.mk | 7 ++----- intel/Android.mk | 7 ++----- libkms/Android.mk | 5 ++--- nouveau/Android.mk | 7 ++----- radeon/Android.mk | 7 ++----- tests/modetest/Android.mk | 3 ++- tests/proptest/Android.mk | 3 ++- tests/util/Android.mk | 6 ++---- 12 files changed, 36 insertions(+), 46 deletions(-) create mode 100644 Android.common.mk diff --git a/Android.common.mk b/Android.common.mk new file mode 100644 index 00000000..c6ab8f50 --- /dev/null +++ b/Android.common.mk @@ -0,0 +1,6 @@ +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) diff --git a/Android.mk b/Android.mk index 6ecc4e1c..ec6d5322 100644 --- a/Android.mk +++ b/Android.mk @@ -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)) diff --git a/amdgpu/Android.mk b/amdgpu/Android.mk index 332d9570..bf0611ba 100644 --- a/amdgpu/Android.mk +++ b/amdgpu/Android.mk @@ -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) diff --git a/etnaviv/Android.mk b/etnaviv/Android.mk index a70eeac0..390f9a98 100644 --- a/etnaviv/Android.mk +++ b/etnaviv/Android.mk @@ -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) diff --git a/freedreno/Android.mk b/freedreno/Android.mk index d7e80e12..2b582aed 100644 --- a/freedreno/Android.mk +++ b/freedreno/Android.mk @@ -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) diff --git a/intel/Android.mk b/intel/Android.mk index e7ec5a57..5407ff3e 100644 --- a/intel/Android.mk +++ b/intel/Android.mk @@ -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) diff --git a/libkms/Android.mk b/libkms/Android.mk index 0259ffbb..0be72054 100644 --- a/libkms/Android.mk +++ b/libkms/Android.mk @@ -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) diff --git a/nouveau/Android.mk b/nouveau/Android.mk index 451f9a73..b430af4f 100644 --- a/nouveau/Android.mk +++ b/nouveau/Android.mk @@ -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) diff --git a/radeon/Android.mk b/radeon/Android.mk index 57cbc92a..71040dab 100644 --- a/radeon/Android.mk +++ b/radeon/Android.mk @@ -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) diff --git a/tests/modetest/Android.mk b/tests/modetest/Android.mk index 6a7f4069..c1a71fd9 100644 --- a/tests/modetest/Android.mk +++ b/tests/modetest/Android.mk @@ -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) diff --git a/tests/proptest/Android.mk b/tests/proptest/Android.mk index badeb588..91a590fc 100644 --- a/tests/proptest/Android.mk +++ b/tests/proptest/Android.mk @@ -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) diff --git a/tests/util/Android.mk b/tests/util/Android.mk index c9d087e3..7656c4c2 100644 --- a/tests/util/Android.mk +++ b/tests/util/Android.mk @@ -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)