From nobody Mon Feb 9 06:00:18 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1591752409; cv=none; d=zohomail.com; s=zohoarc; b=d7tX4Ver3PdS7B5WTx8ZgwlSGLOX6YXZjM9b6YWA//jLLyr89/Oq3qH0E0Fd2U5Qt8ZbBA4ttbKDBH9fXf4jd/1lvv0/R9iAqD8VqPUq73+uY3He5lUbkfkCuti3l+rTE607FIXlxOOHQzGAqlksgNs/uNrFKx2XKozer30ANPc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1591752409; h=Content-Type:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=8Y3iCgnRN71I5G3JY8AHu830vu8FBG2ZgAI729U+pd0=; b=QCecJPGtLmCRGjjfHGNLe8DvCQpBJlBu7x25Y/vIqzk5gUJrTz95qKZ6JmsqCyU54l81MRCabZJdmpmYcBcjb8eRdXwMfSAIsKnfcuxXKEhXP5jYz+v9V13ZslTzCvMMNnuKv2v/40ATvOgu6NXKVVgEYBTGcC4fC8Lw6WfL+8g= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1591752409254286.5667128110091; Tue, 9 Jun 2020 18:26:49 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-28-LWDGPZ5JO_25wLmA05n-TA-1; Tue, 09 Jun 2020 21:26:45 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E37F01854C64; Wed, 10 Jun 2020 01:26:39 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 17BFF7F0BE; Wed, 10 Jun 2020 01:26:37 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 15803B3487; Wed, 10 Jun 2020 01:26:34 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 05A1QWTR027199 for ; Tue, 9 Jun 2020 21:26:32 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2CF0A9D77; Wed, 10 Jun 2020 01:26:32 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast06.extmail.prod.ext.rdu2.redhat.com [10.11.55.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 274368054F for ; Wed, 10 Jun 2020 01:26:29 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7EE8B185A78B for ; Wed, 10 Jun 2020 01:26:29 +0000 (UTC) Received: from mail-m24147.qiye.163.com (mail-m24147.qiye.163.com [220.194.24.147]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-218-aMvpUMxUONiv6xZNOQMAiQ-1; Tue, 09 Jun 2020 21:26:24 -0400 Received: from localhost.localdomain (unknown [58.56.27.130]) by smtp4 (Coremail) with SMTP id JedpCgCnxdh_NeBeVKS4Bw--.7295S5; Wed, 10 Jun 2020 09:21:15 +0800 (CST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1591752407; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:content-type:content-type: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=8Y3iCgnRN71I5G3JY8AHu830vu8FBG2ZgAI729U+pd0=; b=cYe5/s3YS96md02NKXRvLLCK9Szy1NfW1vVWMitjUP11oKDcHfj/fuXkcjThAtkgm0p/fv 9ngt0TmPhekPXT/LEcZVpEUuRqr6oajTRbZDhc/yWtMkIsk+qc016D5iEGssLSRbWoFlPu V0YNbPCm/Ut9GQNwtH0w6Kh0aNOLRsA= X-MC-Unique: LWDGPZ5JO_25wLmA05n-TA-1 X-MC-Unique: aMvpUMxUONiv6xZNOQMAiQ-1 From: Shi Lei To: libvir-list@redhat.com Subject: [RFC 03/21] maint: Call generator automatically when c-head-files change Date: Wed, 10 Jun 2020 09:20:31 +0800 Message-Id: <20200610012049.10774-4-shi_lei@massclouds.com> In-Reply-To: <20200610012049.10774-1-shi_lei@massclouds.com> References: <20200610012049.10774-1-shi_lei@massclouds.com> X-CM-TRANSID: JedpCgCnxdh_NeBeVKS4Bw--.7295S5 X-Coremail-Antispam: 1Uf129KBjvJXoWfGw1kCF1fCr18uryxJrWUArb_yoWkWFWrpw sYkF1rAa1vqrW5Kr1xKayDJF1jq3yjqa45WF1F9w1Utr48ZF98GrWxt3yY9r1agFW7Zr4I 9ry3KFyjgrWkAaDanT9S1TB71UUUUUDqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x0pRH89_UUUUU= X-Originating-IP: [58.56.27.130] X-CM-SenderInfo: pvklsz1hl6ztxvvfz0xxgvhudrp/1tbiSw0-T1dqAXgRbQAAsO X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Mimecast-Spam-Score: 2 X-Mimecast-Originator: redhat.com X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Let makefile call the generator-tool whenever the c header files change. Only check those header files under src/conf and src/util. Signed-off-by: Shi Lei --- src/Makefile.am | 15 +++++++++++++++ src/access/Makefile.inc.am | 2 +- src/conf/Makefile.inc.am | 11 ++++++++++- src/esx/Makefile.inc.am | 2 +- src/interface/Makefile.inc.am | 2 +- src/lxc/Makefile.inc.am | 1 + src/network/Makefile.inc.am | 2 +- src/node_device/Makefile.inc.am | 2 +- src/nwfilter/Makefile.inc.am | 2 +- src/qemu/Makefile.inc.am | 1 + src/remote/Makefile.inc.am | 2 +- src/secret/Makefile.inc.am | 2 +- src/storage/Makefile.inc.am | 2 +- src/test/Makefile.inc.am | 2 +- src/util/Makefile.inc.am | 12 +++++++++--- src/vbox/Makefile.inc.am | 2 +- tests/Makefile.am | 2 ++ tools/Makefile.am | 2 ++ 18 files changed, 51 insertions(+), 15 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 12dd6b8..224d786 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -24,6 +24,7 @@ AM_CPPFLAGS =3D -I$(top_srcdir) \ -I$(top_srcdir)/include \ -I$(srcdir)/util \ -I./util \ + -I./conf \ -DIN_LIBVIRT \ -Dabs_top_builddir=3D"\"$(abs_top_builddir)\"" \ -Dabs_top_srcdir=3D"\"$(abs_top_srcdir)\"" \ @@ -87,6 +88,20 @@ sbin_PROGRAMS =3D bin_PROGRAMS =3D DRIVER_SOURCES =3D =20 +GENERATED_FILES_STAMP =3D .generated_files.stamp +UTIL_HEADS =3D $(wildcard $(top_srcdir)/src/util/*.h) +CONF_HEADS =3D $(wildcard $(top_srcdir)/src/conf/*.h) +GENERATOR_SRC =3D $(wildcard $(top_srcdir)/build-aux/generator/*.py) + +$(GENERATED_FILES_STAMP): $(UTIL_HEADS) $(CONF_HEADS) $(GENERATOR_SRC) + $(AM_V_GEN)topdir=3D$(top_srcdir) builddir=3D$(top_builddir) \ + libclang_path=3D$(LIBCLANG_PATH) \ + $(PYTHON) -B $(top_srcdir)/build-aux/generator/main.py \ + generate -k cpf && touch $@ + +MAINTAINERCLEANFILES +=3D $(GENERATED_FILES_STAMP) +CLEANFILES +=3D $(GENERATED_FILES_STAMP) + COMMON_UNIT_VARS =3D \ -e 's|[@]runstatedir[@]|$(runstatedir)|g' \ -e 's|[@]sbindir[@]|$(sbindir)|g' \ diff --git a/src/access/Makefile.inc.am b/src/access/Makefile.inc.am index 11f87c6..7832558 100644 --- a/src/access/Makefile.inc.am +++ b/src/access/Makefile.inc.am @@ -55,7 +55,7 @@ nodist_libvirt_driver_access_la_SOURCES =3D \ noinst_LTLIBRARIES +=3D libvirt_driver_access.la libvirt_la_BUILT_LIBADD +=3D libvirt_driver_access.la libvirt_driver_access_la_CFLAGS =3D \ - -I$(srcdir)/conf \ + -I$(srcdir)/conf -I./conf \ $(AM_CFLAGS) \ $(NULL) libvirt_driver_access_la_LDFLAGS =3D $(AM_LDFLAGS) diff --git a/src/conf/Makefile.inc.am b/src/conf/Makefile.inc.am index debc6f4..3bd2199 100644 --- a/src/conf/Makefile.inc.am +++ b/src/conf/Makefile.inc.am @@ -160,7 +160,11 @@ DEVICE_CONF_SOURCES =3D \ conf/device_conf.h \ $(NULL) =20 +CONF_GENERATED_SOURCES =3D \ + $(NULL) + CONF_SOURCES =3D \ + $(CONF_GENERATED_SOURCES) \ $(NETDEV_CONF_SOURCES) \ $(DOMAIN_CONF_SOURCES) \ $(OBJECT_EVENT_SOURCES) \ @@ -180,11 +184,16 @@ CONF_SOURCES =3D \ $(DEVICE_CONF_SOURCES) \ $(NULL) =20 +BUILT_SOURCES +=3D $(CONF_GENERATED_SOURCES) +$(CONF_GENERATED_SOURCES): $(GENERATED_FILES_STAMP) +MAINTAINERCLEANFILES +=3D $(CONF_GENERATED_SOURCES) +CLEANFILES +=3D $(CONF_GENERATED_SOURCES) + noinst_LTLIBRARIES +=3D libvirt_conf.la libvirt_la_BUILT_LIBADD +=3D libvirt_conf.la libvirt_conf_la_SOURCES =3D $(CONF_SOURCES) libvirt_conf_la_CFLAGS =3D \ - -I$(srcdir)/conf \ + -I$(srcdir)/conf -I./conf \ $(AM_CFLAGS) \ $(NULL) libvirt_conf_la_LDFLAGS =3D $(AM_LDFLAGS) diff --git a/src/esx/Makefile.inc.am b/src/esx/Makefile.inc.am index d53cef1..1df9a54 100644 --- a/src/esx/Makefile.inc.am +++ b/src/esx/Makefile.inc.am @@ -78,7 +78,7 @@ noinst_LTLIBRARIES +=3D libvirt_driver_esx.la libvirt_la_BUILT_LIBADD +=3D libvirt_driver_esx.la libvirt_driver_esx_la_CFLAGS =3D \ $(CURL_CFLAGS) \ - -I$(srcdir)/conf \ + -I$(srcdir)/conf -I./conf \ -I$(builddir)/esx \ -I$(srcdir)/vmx \ $(AM_CFLAGS) \ diff --git a/src/interface/Makefile.inc.am b/src/interface/Makefile.inc.am index 46a43e6..03ccef1 100644 --- a/src/interface/Makefile.inc.am +++ b/src/interface/Makefile.inc.am @@ -23,7 +23,7 @@ mod_LTLIBRARIES +=3D libvirt_driver_interface.la libvirt_driver_interface_la_CFLAGS =3D \ -I$(srcdir)/access \ -I$(builddir)/access \ - -I$(srcdir)/conf \ + -I$(srcdir)/conf -I./conf \ $(AM_CFLAGS) \ $(LIBNL_CFLAGS) \ $(NULL) diff --git a/src/lxc/Makefile.inc.am b/src/lxc/Makefile.inc.am index b8c2e1e..fdbefb5 100644 --- a/src/lxc/Makefile.inc.am +++ b/src/lxc/Makefile.inc.am @@ -95,6 +95,7 @@ libvirt_driver_lxc_impl_la_CFLAGS =3D \ -I$(srcdir)/access \ -I$(builddir)/access \ -I$(srcdir)/conf \ + -I./conf \ -I$(builddir)/lxc \ -I$(builddir)/rpc \ -I$(srcdir)/hypervisor \ diff --git a/src/network/Makefile.inc.am b/src/network/Makefile.inc.am index 196a30e..d260f75 100644 --- a/src/network/Makefile.inc.am +++ b/src/network/Makefile.inc.am @@ -46,7 +46,7 @@ libvirt_driver_network_impl_la_CFLAGS =3D \ $(DBUS_CFLAGS) \ -I$(srcdir)/access \ -I$(builddir)/access \ - -I$(srcdir)/conf \ + -I$(srcdir)/conf -I./conf \ $(AM_CFLAGS) \ $(NULL) libvirt_driver_network_impl_la_SOURCES =3D $(NETWORK_DRIVER_SOURCES) diff --git a/src/node_device/Makefile.inc.am b/src/node_device/Makefile.inc= .am index 7885636..ee3c3bc 100644 --- a/src/node_device/Makefile.inc.am +++ b/src/node_device/Makefile.inc.am @@ -40,7 +40,7 @@ libvirt_driver_nodedev_la_SOURCES =3D $(NODE_DEVICE_DRIVE= R_SOURCES) libvirt_driver_nodedev_la_CFLAGS =3D \ -I$(srcdir)/access \ -I$(builddir)/access \ - -I$(srcdir)/conf \ + -I$(srcdir)/conf -I./conf \ $(AM_CFLAGS) \ $(LIBNL_CFLAGS) \ $(NULL) diff --git a/src/nwfilter/Makefile.inc.am b/src/nwfilter/Makefile.inc.am index 20db809..774b681 100644 --- a/src/nwfilter/Makefile.inc.am +++ b/src/nwfilter/Makefile.inc.am @@ -40,7 +40,7 @@ libvirt_driver_nwfilter_impl_la_CFLAGS =3D \ $(DBUS_CFLAGS) \ -I$(srcdir)/access \ -I$(builddir)/access \ - -I$(srcdir)/conf \ + -I$(srcdir)/conf -I./conf \ $(AM_CFLAGS) \ $(NULL) libvirt_driver_nwfilter_impl_la_LDFLAGS =3D $(AM_LDFLAGS) diff --git a/src/qemu/Makefile.inc.am b/src/qemu/Makefile.inc.am index 6a7fc08..680ec88 100644 --- a/src/qemu/Makefile.inc.am +++ b/src/qemu/Makefile.inc.am @@ -101,6 +101,7 @@ libvirt_driver_qemu_impl_la_CFLAGS =3D \ -I$(srcdir)/access \ -I$(builddir)/access \ -I$(srcdir)/conf \ + -I./conf \ -I$(srcdir)/secret \ -I$(srcdir)/hypervisor \ $(AM_CFLAGS) \ diff --git a/src/remote/Makefile.inc.am b/src/remote/Makefile.inc.am index 1b1be83..4e42608 100644 --- a/src/remote/Makefile.inc.am +++ b/src/remote/Makefile.inc.am @@ -47,7 +47,7 @@ REMOTE_DAEMON_CFLAGS =3D \ $(COVERAGE_CFLAGS) \ -I$(srcdir)/access \ -I$(builddir)/access \ - -I$(srcdir)/conf \ + -I$(srcdir)/conf -I./conf \ -I$(srcdir)/rpc \ -I$(builddir)/rpc \ -I$(builddir)/remote \ diff --git a/src/secret/Makefile.inc.am b/src/secret/Makefile.inc.am index a8390f8..198b666 100644 --- a/src/secret/Makefile.inc.am +++ b/src/secret/Makefile.inc.am @@ -20,7 +20,7 @@ mod_LTLIBRARIES +=3D libvirt_driver_secret.la libvirt_driver_secret_la_CFLAGS =3D \ -I$(srcdir)/access \ -I$(builddir)/access \ - -I$(srcdir)/conf \ + -I$(srcdir)/conf -I./conf \ $(AM_CFLAGS) \ $(NULL) libvirt_driver_secret_la_LIBADD =3D \ diff --git a/src/storage/Makefile.inc.am b/src/storage/Makefile.inc.am index 2f46d24..556d07b 100644 --- a/src/storage/Makefile.inc.am +++ b/src/storage/Makefile.inc.am @@ -122,7 +122,7 @@ libvirt_driver_storage_impl_la_SOURCES =3D libvirt_driver_storage_impl_la_CFLAGS =3D \ -I$(srcdir)/access \ -I$(builddir)/access \ - -I$(srcdir)/conf \ + -I$(srcdir)/conf -I./conf \ -I$(srcdir)/secret \ $(AM_CFLAGS) \ $(NULL) diff --git a/src/test/Makefile.inc.am b/src/test/Makefile.inc.am index b84ab52..ce1e635 100644 --- a/src/test/Makefile.inc.am +++ b/src/test/Makefile.inc.am @@ -21,7 +21,7 @@ driver_test_assetdir =3D $(pkgdatadir) noinst_LTLIBRARIES +=3D libvirt_driver_test.la libvirt_la_BUILT_LIBADD +=3D libvirt_driver_test.la libvirt_driver_test_la_CFLAGS =3D \ - -I$(srcdir)/conf \ + -I$(srcdir)/conf -I./conf \ $(AM_CFLAGS) \ $(NULL) libvirt_driver_test_la_SOURCES =3D $(TEST_DRIVER_SOURCES) diff --git a/src/util/Makefile.inc.am b/src/util/Makefile.inc.am index 5bc60cb..4056f1d 100644 --- a/src/util/Makefile.inc.am +++ b/src/util/Makefile.inc.am @@ -1,5 +1,8 @@ # vim: filetype=3Dautomake =20 +UTIL_GENERATED_SOURCES =3D \ + $(NULL) + # These files are not related to driver APIs. Simply generic # helper APIs for various purposes UTIL_SOURCES =3D \ @@ -236,9 +239,9 @@ UTIL_SOURCES =3D \ util/virmdev.h \ util/virfilecache.c \ util/virfilecache.h \ + $(UTIL_GENERATED_SOURCES) \ $(NULL) =20 - EXTRA_DIST +=3D \ $(srcdir)/keycodemapdb/data/keymaps.csv \ $(srcdir)/keycodemapdb/tools/keymap-gen \ @@ -253,8 +256,9 @@ KEYTABLES =3D \ $(KEYNAMES:%=3Dutil/virkeynametable_%.h) \ $(NULL) =20 -BUILT_SOURCES +=3D $(KEYTABLES) -CLEANFILES +=3D $(KEYTABLES) +BUILT_SOURCES +=3D $(KEYTABLES) $(UTIL_GENERATED_SOURCES) +CLEANFILES +=3D $(KEYTABLES) $(UTIL_GENERATED_SOURCES) +MAINTAINERCLEANFILES +=3D $(KEYTABLES) $(UTIL_GENERATED_SOURCES) =20 UTIL_IO_HELPER_SOURCES =3D util/iohelper.c =20 @@ -300,6 +304,8 @@ libvirt_util_la_LIBADD =3D \ $(NULL) =20 =20 +$(UTIL_GENERATED_SOURCES): $(GENERATED_FILES_STAMP) + util/virkeycodetable_%.h: $(srcdir)/keycodemapdb/data/keymaps.csv \ $(srcdir)/keycodemapdb/tools/keymap-gen Makefile.am $(AM_V_GEN)export NAME=3D`echo $@ | sed -e 's,util/virkeycodetable_,,' \ diff --git a/src/vbox/Makefile.inc.am b/src/vbox/Makefile.inc.am index c5c6d53..7348475 100644 --- a/src/vbox/Makefile.inc.am +++ b/src/vbox/Makefile.inc.am @@ -48,7 +48,7 @@ mod_LTLIBRARIES +=3D libvirt_driver_vbox.la libvirt_driver_vbox_la_LDFLAGS =3D $(AM_LDFLAGS_MOD_NOUNDEF) =20 libvirt_driver_vbox_impl_la_CFLAGS =3D \ - -I$(srcdir)/conf \ + -I$(srcdir)/conf -I./conf \ $(AM_CFLAGS) \ -DVBOX_DRIVER \ $(NULL) diff --git a/tests/Makefile.am b/tests/Makefile.am index f5766a7..486de26 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -21,7 +21,9 @@ AM_CPPFLAGS =3D \ -I$(top_builddir)/include -I$(top_srcdir)/include \ -I$(top_builddir)/src -I$(top_srcdir)/src \ -I$(top_srcdir)/src/util \ + -I$(top_builddir)/src/util \ -I$(top_srcdir)/src/conf \ + -I$(top_builddir)/src/conf \ -I$(top_srcdir)/src/hypervisor \ -I$(top_builddir)/src/rpc \ $(NULL) diff --git a/tools/Makefile.am b/tools/Makefile.am index 53df930..05a219e 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -19,6 +19,8 @@ AM_CPPFLAGS =3D \ -I$(top_builddir)/include -I$(top_srcdir)/include \ -I$(top_builddir)/src -I$(top_srcdir)/src \ -I$(top_srcdir)/src/util \ + -I$(top_builddir)/src/util \ + -I$(top_builddir)/src/conf \ -I$(top_srcdir) \ $(NULL) =20 --=20 2.17.1