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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2022-10-13 16:40:32+0000, skrab-sah via GitGitGadget <gitgitgadget@xxxxxxxxx> wrote:
> From: skrab-sah <skrab.sah@xxxxxxxxx>
> 
> 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@xxxxxxxxx>
> ---

[...]

> 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



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux