From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: Jeff King <peff@peff.net>
Cc: Ramsay Jones <ramsay@ramsayjones.plus.com>,
Johannes Schindelin via GitGitGadget <gitgitgadget@gmail.com>,
git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH 1/1] Makefile: use `git ls-files` to list header files, if possible
Date: Sat, 2 Mar 2019 20:54:55 +0100 (STD) [thread overview]
Message-ID: <nycvar.QRO.7.76.6.1903022053290.45@tvgsbejvaqbjf.bet> (raw)
In-Reply-To: <20190301220112.GA14966@sigill.intra.peff.net>
Hi Peff,
On Fri, 1 Mar 2019, Jeff King wrote:
> On Fri, Mar 01, 2019 at 04:54:15PM -0500, Jeff King wrote:
>
> > The one thing we do lose, though, is make's parallelization. It would
> > probably be possible to actually shove this into a sub-make which
> > defined the hdr-check rules, but I don't know how complicated that would
> > become.
>
> This seems to work, though it's kind of horrid.
>
> It costs at least one extra process to run "make hdr-check", and
> probably more for things like $(GIT_VERSION) that the Makefile include
> likely triggers. But when you're not running hdr-check (which is the
> norm), it's zero-cost.
If we want to go that route (and I am not saying we should), we could
easily just add another target (say, `check-headers`) that requires a list
of headers to check to be passed in via a Makefile variable that is
defined via the command-line.
Ciao,
Dscho
>
> -Peff
>
> diff --git a/Makefile b/Makefile
> index c5240942f2..ab6ecf450e 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -2735,16 +2735,8 @@ $(SP_OBJ): %.sp: %.c GIT-CFLAGS FORCE
> .PHONY: sparse $(SP_OBJ)
> sparse: $(SP_OBJ)
>
> -GEN_HDRS := command-list.h unicode-width.h
> -EXCEPT_HDRS := $(GEN_HDRS) compat% xdiff%
> -CHK_HDRS = $(filter-out $(EXCEPT_HDRS),$(patsubst ./%,%,$(LIB_H)))
> -HCO = $(patsubst %.h,%.hco,$(CHK_HDRS))
> -
> -$(HCO): %.hco: %.h FORCE
> - $(QUIET_HDR)$(CC) -include git-compat-util.h -I. -o /dev/null -c -xc $<
> -
> -.PHONY: hdr-check $(HCO)
> -hdr-check: $(HCO)
> +hdr-check:
> + $(MAKE) -f hdr-check.mak hdr-check
>
> .PHONY: style
> style:
> diff --git a/hdr-check.mak b/hdr-check.mak
> new file mode 100644
> index 0000000000..b8924afa90
> --- /dev/null
> +++ b/hdr-check.mak
> @@ -0,0 +1,12 @@
> +include Makefile
> +
> +GEN_HDRS := command-list.h unicode-width.h
> +EXCEPT_HDRS := $(GEN_HDRS) compat% xdiff%
> +CHK_HDRS = $(filter-out $(EXCEPT_HDRS),$(patsubst ./%,%,$(LIB_H)))
> +HCO = $(patsubst %.h,%.hco,$(CHK_HDRS))
> +
> +$(HCO): %.hco: %.h FORCE
> + $(QUIET_HDR)$(CC) -include git-compat-util.h -I. -o /dev/null -c -xc $<
> +
> +.PHONY: hdr-check $(HCO)
> +hdr-check: $(HCO)
>
next prev parent reply other threads:[~2019-03-02 19:55 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-01 19:57 [PATCH 0/1] Avoid calling find in the Makefile, if possible Johannes Schindelin via GitGitGadget
2019-03-01 19:57 ` [PATCH 1/1] Makefile: use `git ls-files` to list header files, " Johannes Schindelin via GitGitGadget
2019-03-01 21:36 ` Jeff King
2019-03-01 21:54 ` Jeff King
2019-03-01 22:01 ` Jeff King
2019-03-02 19:54 ` Johannes Schindelin [this message]
2019-03-03 17:08 ` Jeff King
2019-03-02 19:57 ` Johannes Schindelin
2019-03-03 17:11 ` Jeff King
2019-03-02 20:05 ` Johannes Schindelin
2019-03-03 17:19 ` Jeff King
2019-03-03 21:30 ` Ramsay Jones
2019-03-04 12:38 ` Johannes Schindelin
2019-03-04 20:31 ` Ramsay Jones
2019-03-04 21:37 ` Jeff King
2019-03-04 11:08 ` Johannes Schindelin
2019-03-04 21:41 ` Jeff King
2019-03-05 5:50 ` Junio C Hamano
2019-03-05 15:28 ` Johannes Schindelin
2019-03-05 22:26 ` Junio C Hamano
2019-03-05 23:07 ` Jeff King
2019-03-06 0:23 ` Ramsay Jones
2019-03-06 4:40 ` Jeff King
2019-03-06 5:28 ` Junio C Hamano
2019-03-06 19:05 ` [PATCH] compat/bswap: add include header guards Jeff King
2019-03-06 22:42 ` Junio C Hamano
2019-03-04 13:47 ` [PATCH v2 0/1] Avoid calling find in the Makefile, if possible Johannes Schindelin via GitGitGadget
2019-03-04 13:47 ` [PATCH v2 1/1] Makefile: use `git ls-files` to list header files, " Johannes Schindelin via GitGitGadget
2019-03-04 20:38 ` Ramsay Jones
2019-03-04 21:01 ` Ramsay Jones
2019-03-04 21:43 ` Jeff King
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=nycvar.QRO.7.76.6.1903022053290.45@tvgsbejvaqbjf.bet \
--to=johannes.schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=gitster@pobox.com \
--cc=peff@peff.net \
--cc=ramsay@ramsayjones.plus.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).