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