This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Re: [patch] link headers if possible
- From: "Neal H. Walfield" <neal at walfield dot org>
- To: Andrew STUBBS <andrew dot stubbs at st dot com>
- Cc: newlib at sourceware dot org
- Date: Tue, 22 Jan 2008 12:04:51 +0100
- Subject: Re: [patch] link headers if possible
- References: <87ejcag3e2.wl%neal@walfield.org> <4795CBF0.7050208@st.com>
At Tue, 22 Jan 2008 10:56:48 +0000,
Andrew STUBBS wrote:
>
> Neal H. Walfield wrote:
> > This patch removes one scenario where I've had to run make clean to
> > make the build system recognize some changes that I've made in the
> > source tree. Specifically, it tries first to link header files to
> > targ-include and only falls back to copying them if that fails.
>
> That won't give any benefit to platforms where links don't work. MinGW
> springs to mind.
Yes, on platforms where there are no symlinks, this should be no worse
than the status quo.
> How about something more like this?
>
> HFILES := $(shell cd $(WHEREEVER) && find . ! -type d -name '*.h')
> LOCALHFILES := $(addprefix targ-include/,$(HFILES))
>
> targ-include/% : $(WHEREEVER)/%
> $(INSTALL) -D -p $< $@
>
>
> all: $(LOCALHFILES)
>
> This will probably only work with GNU make and only when find is
> available, but those are probably requirements already. Make now treats
> the individual header files as dependencies and updates them as required.
This apporach would be fine but unless I misunderstand your code, your
code does not use the same selection criteria for choosing the headers
to install. For instance, there is a lock.h in
libc/include/sys/lock.h and another in libc/sys/linux/sys/lock.h.
When configuring for GNU/Linux, the latter is installed in
targ-include, other the more generic one is used.
Thanks,