git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2] abspath.h file is generated by makeheaders tool

From
Đoàn Trần Công Danh <congdanhqx@gmail.com>
Date
Oct 16, 2022, 13:13 UTC
Message-ID
<Y0wDieA32uVtYmgx@danh.dev>
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:
Show 8 quoted lines
> 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>
> ---
[...]
Show 17 quoted lines
> 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
Previous: Skrab SahNext: Skrab Sah
Message 5 of 11 in “abspath.h file is generated by makeheaders tool”
  1. abspath.h file is generated by makeheaders toolskrab-sah via GitGitGadget, Oct 12, 2022
  2. Ævar Arnfjörð BjarmasonOct 12, 2022
  3. abspath.h file is generated by makeheaders toolskrab-sah via GitGitGadget, Oct 13, 2022
  4. Skrab SahOct 16, 2022
  5. Đoàn Trần Công DanhOct 16, 2022
  6. Skrab SahOct 16, 2022
  7. Junio C HamanoOct 16, 2022
  8. Đoàn Trần Công DanhOct 17, 2022
  9. Skrab SahOct 17, 2022
  10. Junio C HamanoOct 17, 2022
  11. Skrab SahOct 18, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.