git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Đoàn Trần Công Danh" <congdanhqx@gmail.com>
To: skrab-sah via GitGitGadget <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org, "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>,
	skrab-sah <skrab.sah@gmail.com>
Subject: Re: [PATCH v2] abspath.h file is generated by makeheaders tool
Date: Sun, 16 Oct 2022 20:13:45 +0700	[thread overview]
Message-ID: <Y0wDieA32uVtYmgx@danh.dev> (raw)
In-Reply-To: <pull.1353.v2.git.git.1665679233107.gitgitgadget@gmail.com>

On 2022-10-13 16:40:32+0000, skrab-sah via GitGitGadget <gitgitgadget@gmail.com> wrote:
> From: skrab-sah <skrab.sah@gmail.com>
> 
> 1. We don't need to commit the file.
> 2. Added routin for abspath.c in Makefile.
> 3. Added tool support for makeheaders.
> 
> Signed-off-by: skrab-sah <skrab.sah@gmail.com>
> ---

[...]

> diff --git a/Makefile b/Makefile
> index cac3452edb9..e1136e96283 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1,6 +1,16 @@
>  # The default target of this Makefile is...
>  all::
>  
> +# compile header
> +.PHONY: hdr
> +hdr:: abspath.h
> +
> +makeheaders: tools/makeheaders.c
> +	$(CC) -o $@ $<
> +
> +abspath.h: abspath.c makeheaders
> +	./makeheaders $<

This will break cross-compilation.
At the very least, we needs to use either HOSTCC (likes linux project),
HOST_CC or CC_FOR_BUILD (GNU Autotools' convention) to compile
makeheaders

So, something like (not tested, whatsoever):

	CC_FOR_BUILD = $(CC)
	CFLAGS_FOR_BUILD = $(CFLAGS)
	LDFLAGS_FOR_BUILD = $(LDFLAGS)
	QUIET_HOSTCC = echo '	' HOSTCC $@;
	QUIET_MAKEHEADERS = echo '	' MAKEHEADERS $@;
	
	makeheaders: tools/makeheaders.c
		$(QUIET_HOSTCC)$(CC_FOR_BUILD) -o $@ $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) $<

	abspath.h: abspath.c makeheaders
		$(QUIET_MAKEHEADERS)./makeheaders $<

-- 
Danh

  parent reply	other threads:[~2022-10-16 13:14 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-12  8:36 [PATCH] abspath.h file is generated by makeheaders tool skrab-sah via GitGitGadget
2022-10-12  9:04 ` Ævar Arnfjörð Bjarmason
2022-10-13 16:40 ` [PATCH v2] " skrab-sah via GitGitGadget
2022-10-16  9:44   ` Skrab Sah
2022-10-16 13:13   ` Đoàn Trần Công Danh [this message]
2022-10-16 16:06     ` Skrab Sah
2022-10-16 16:51     ` Junio C Hamano
2022-10-17  0:34       ` Đoàn Trần Công Danh
2022-10-17  7:55         ` Skrab Sah
2022-10-17 18:39       ` Junio C Hamano
2022-10-18  0:52         ` Skrab Sah

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y0wDieA32uVtYmgx@danh.dev \
    --to=congdanhqx@gmail.com \
    --cc=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=skrab.sah@gmail.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.
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 NNTP newsgroup(s).