public inbox for newlib-cvs@sourceware.org help / color / mirror / Atom feed
From: Jeff Johnston <jjohnstn@sourceware.org> To: newlib-cvs@sourceware.org Subject: [newlib-cygwin] Add wildcard support to recurse into sys include directories Date: Thu, 10 Aug 2023 18:17:22 +0000 (GMT) [thread overview] Message-ID: <20230810181722.0D3E83858298@sourceware.org> (raw) https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=3550d74823bfc17ca5a1a687350821421b0d74e1 commit 3550d74823bfc17ca5a1a687350821421b0d74e1 Author: Alexey Lapshin <alexey.lapshin@espressif.com> Date: Thu Aug 10 14:13:11 2023 -0400 Add wildcard support to recurse into sys include directories Diff: --- newlib/Makefile.am | 31 ++++++++++++------------------- newlib/Makefile.in | 47 ++++++++++++++++++++--------------------------- 2 files changed, 32 insertions(+), 46 deletions(-) diff --git a/newlib/Makefile.am b/newlib/Makefile.am index a188845d6..126cf24c1 100644 --- a/newlib/Makefile.am +++ b/newlib/Makefile.am @@ -110,6 +110,9 @@ AWK_UNIQUE_OBJS = $(AWK) '{ \ print objs[i]; \ }' +# Recursive Wildcard function +rwildcard=$(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2)$(filter $(subst *,%,$2),$d)) + # The functions ldexp, frexp and modf are traditionally supplied in # both libc.a and libm.a. We build them in libm.a and copy them over, # along with some required supporting routines. @@ -236,13 +239,11 @@ stmp-targ-include: config.status $(AM_V_at)s=machine/$(machine_dir)/sys d=sys $(TARG_INCLUDE_CP_DIR) $(AM_V_at)s=machine/$(machine_dir)/include d= $(TARG_INCLUDE_CP_DIR) $(AM_V_at)s=sys/$(sys_dir)/include d= $(TARG_INCLUDE_CP_DIR) - $(AM_V_at)for i in $(srcdir)/libc/sys/$(sys_dir)/include/*/; do \ - if [ -d $$i ]; then \ - d=`basename $$i`; \ - $(MKDIR_P) targ-include/$$d; \ - s=sys/${sys_dir}/include/$$d $(TARG_INCLUDE_CP_DIR) || exit $$?; \ - fi \ - done + $(AM_V_at)for i in $(call rwildcard,$(srcdir)/libc/sys/$(sys_dir)/include/,*.h); do \ + f=`echo $$i | sed s:$(srcdir)/libc/sys/$(sys_dir)/include/::`; \ + $(MKDIR_P) targ-include/`dirname $$f`; \ + cp $$i targ-include/$$f; \ + done $(AM_V_at)s=sys/$(sys_dir)/sys d=sys $(TARG_INCLUDE_CP_DIR) $(AM_V_at)s=sys/$(sys_dir)/bits d=bits $(TARG_INCLUDE_CP_DIR) $(AM_V_at)s=sys/$(sys_dir)/machine d=machine $(TARG_INCLUDE_CP_DIR) @@ -332,18 +333,10 @@ install-data-local: install-toollibLIBRARIES install-multi $(INSTALL_DATA_LOCAL) $(INSTALL_DATA) $$i $(DESTDIR)$(tooldir)/include/machine/`basename $$i`; \ else true; fi ; \ done ; \ - for i in $(srcdir)/libc/sys/$(sys_dir)/include/*.h; do \ - if [ -f $$i ]; then \ - $(INSTALL_DATA) $$i $(DESTDIR)$(tooldir)/include/`basename $$i`; \ - else true; fi ; \ - done ; \ - for i in $(srcdir)/libc/sys/$(sys_dir)/include/*; do \ - if [ -d $$i ]; then \ - $(MKDIR_P) $(DESTDIR)$(tooldir)/include/`basename $$i`; \ - for j in $$i/*.h; do \ - $(INSTALL_DATA) $$j $(DESTDIR)$(tooldir)/include/`basename $$i`/`basename $$j`; \ - done ; \ - else true; fi ; \ + for i in $(call rwildcard,$(srcdir)/libc/sys/$(sys_dir)/include/,*.h); do \ + f=`echo $$i | sed s:$(srcdir)/libc/sys/$(sys_dir)/include/::`; \ + $(MKDIR_P) $(DESTDIR)$(tooldir)/`dirname $$f`; \ + $(INSTALL_DATA) $$i $(DESTDIR)$(tooldir)/`dirname $$f`; \ done ; \ for i in $(srcdir)/libc/sys/$(sys_dir)/machine/$(machine_dir)/include/*.h; do \ if [ -f $$i ]; then \ diff --git a/newlib/Makefile.in b/newlib/Makefile.in index 6e5b0fbd6..93a97b5fb 100644 --- a/newlib/Makefile.in +++ b/newlib/Makefile.in @@ -912,18 +912,18 @@ check_PROGRAMS = @NEWLIB_HW_FP_FALSE@am__append_136 = libm/math/math.tex @HAVE_LONG_DOUBLE_TRUE@am__append_137 = $(libm_common_lsrc) @HAVE_FPMATH_H_TRUE@@HAVE_LONG_DOUBLE_TRUE@am__append_138 = $(libm_ld_lsrc) -@HAVE_FPMATH_H_TRUE@am__append_139 = -@HAVE_FPMATH_H_TRUE@am__append_140 = +@HAVE_FPMATH_H_TRUE@am__append_139 = +@HAVE_FPMATH_H_TRUE@am__append_140 = @HAVE_LIBM_MACHINE_AARCH64_TRUE@am__append_141 = $(libm_machine_aarch64_src) @HAVE_LIBM_MACHINE_AARCH64_TRUE@@HAVE_LONG_DOUBLE_TRUE@am__append_142 = $(libm_ld128_lsrc) -@HAVE_LIBM_MACHINE_AARCH64_TRUE@am__append_143 = -@HAVE_LIBM_MACHINE_AARCH64_TRUE@am__append_144 = +@HAVE_LIBM_MACHINE_AARCH64_TRUE@am__append_143 = +@HAVE_LIBM_MACHINE_AARCH64_TRUE@am__append_144 = @HAVE_LIBM_MACHINE_AMDGCN_TRUE@am__append_145 = $(libm_machine_amdgcn_src) @HAVE_LIBM_MACHINE_ARM_TRUE@am__append_146 = $(libm_machine_arm_src) @HAVE_LIBM_MACHINE_I386_TRUE@am__append_147 = $(libm_machine_i386_src) @HAVE_LIBM_MACHINE_I386_TRUE@@HAVE_LONG_DOUBLE_TRUE@am__append_148 = $(libm_ld80_lsrc) -@HAVE_LIBM_MACHINE_I386_TRUE@am__append_149 = -@HAVE_LIBM_MACHINE_I386_TRUE@am__append_150 = +@HAVE_LIBM_MACHINE_I386_TRUE@am__append_149 = +@HAVE_LIBM_MACHINE_I386_TRUE@am__append_150 = @HAVE_LIBM_MACHINE_MIPS_TRUE@am__append_151 = $(libm_machine_mips_src) @HAS_NDS32_FPU_SP_TRUE@@HAVE_LIBM_MACHINE_NDS32_TRUE@am__append_152 = libm/machine/nds32/wf_sqrt.S @HAS_NDS32_FPU_DP_TRUE@@HAVE_LIBM_MACHINE_NDS32_TRUE@am__append_153 = libm/machine/nds32/w_sqrt.S @@ -935,8 +935,8 @@ check_PROGRAMS = @HAVE_LIBM_MACHINE_RISCV_TRUE@am__append_159 = $(libm_machine_riscv_src) @HAVE_LIBM_MACHINE_X86_64_TRUE@am__append_160 = $(libm_machine_x86_64_src) @HAVE_LIBM_MACHINE_X86_64_TRUE@@HAVE_LONG_DOUBLE_TRUE@am__append_161 = $(libm_ld80_lsrc) -@HAVE_LIBM_MACHINE_X86_64_TRUE@am__append_162 = -@HAVE_LIBM_MACHINE_X86_64_TRUE@am__append_163 = +@HAVE_LIBM_MACHINE_X86_64_TRUE@am__append_162 = +@HAVE_LIBM_MACHINE_X86_64_TRUE@am__append_163 = subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/../config/depstand.m4 \ @@ -3968,6 +3968,9 @@ AWK_UNIQUE_OBJS = $(AWK) '{ \ }' +# Recursive Wildcard function +rwildcard = $(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2)$(filter $(subst *,%,$2),$d)) + # The functions ldexp, frexp and modf are traditionally supplied in # both libc.a and libm.a. We build them in libm.a and copy them over, # along with some required supporting routines. @@ -49971,13 +49974,11 @@ stmp-targ-include: config.status $(AM_V_at)s=machine/$(machine_dir)/sys d=sys $(TARG_INCLUDE_CP_DIR) $(AM_V_at)s=machine/$(machine_dir)/include d= $(TARG_INCLUDE_CP_DIR) $(AM_V_at)s=sys/$(sys_dir)/include d= $(TARG_INCLUDE_CP_DIR) - $(AM_V_at)for i in $(srcdir)/libc/sys/$(sys_dir)/include/*/; do \ - if [ -d $$i ]; then \ - d=`basename $$i`; \ - $(MKDIR_P) targ-include/$$d; \ - s=sys/${sys_dir}/include/$$d $(TARG_INCLUDE_CP_DIR) || exit $$?; \ - fi \ - done + $(AM_V_at)for i in $(call rwildcard,$(srcdir)/libc/sys/$(sys_dir)/include/,*.h); do \ + f=`echo $$i | sed s:$(srcdir)/libc/sys/$(sys_dir)/include/::`; \ + $(MKDIR_P) targ-include/`dirname $$f`; \ + cp $$i targ-include/$$f; \ + done $(AM_V_at)s=sys/$(sys_dir)/sys d=sys $(TARG_INCLUDE_CP_DIR) $(AM_V_at)s=sys/$(sys_dir)/bits d=bits $(TARG_INCLUDE_CP_DIR) $(AM_V_at)s=sys/$(sys_dir)/machine d=machine $(TARG_INCLUDE_CP_DIR) @@ -50062,18 +50063,10 @@ install-data-local: install-toollibLIBRARIES install-multi $(INSTALL_DATA_LOCAL) $(INSTALL_DATA) $$i $(DESTDIR)$(tooldir)/include/machine/`basename $$i`; \ else true; fi ; \ done ; \ - for i in $(srcdir)/libc/sys/$(sys_dir)/include/*.h; do \ - if [ -f $$i ]; then \ - $(INSTALL_DATA) $$i $(DESTDIR)$(tooldir)/include/`basename $$i`; \ - else true; fi ; \ - done ; \ - for i in $(srcdir)/libc/sys/$(sys_dir)/include/*; do \ - if [ -d $$i ]; then \ - $(MKDIR_P) $(DESTDIR)$(tooldir)/include/`basename $$i`; \ - for j in $$i/*.h; do \ - $(INSTALL_DATA) $$j $(DESTDIR)$(tooldir)/include/`basename $$i`/`basename $$j`; \ - done ; \ - else true; fi ; \ + for i in $(call rwildcard,$(srcdir)/libc/sys/$(sys_dir)/include/,*.h); do \ + f=`echo $$i | sed s:$(srcdir)/libc/sys/$(sys_dir)/include/::`; \ + $(MKDIR_P) $(DESTDIR)$(tooldir)/`dirname $$f`; \ + $(INSTALL_DATA) $$i $(DESTDIR)$(tooldir)/`dirname $$f`; \ done ; \ for i in $(srcdir)/libc/sys/$(sys_dir)/machine/$(machine_dir)/include/*.h; do \ if [ -f $$i ]; then \
reply other threads:[~2023-08-10 18:17 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20230810181722.0D3E83858298@sourceware.org \ --to=jjohnstn@sourceware.org \ --cc=newlib-cvs@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).