[patch] link headers if possible

Andrew STUBBS andrew.stubbs@st.com
Tue Jan 22 11:05:00 GMT 2008

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.

More information about the Newlib mailing list