This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Re: [patch] link headers if possible
- From: Andrew STUBBS <andrew dot stubbs at st dot com>
- To: "Neal H. Walfield" <neal at walfield dot org>
- Cc: newlib at sourceware dot org
- Date: Tue, 22 Jan 2008 10:56:48 +0000
- Subject: Re: [patch] link headers if possible
- References: <87ejcag3e2.wl%neal@walfield.org>
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.
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.