public inbox for newlib-cvs@sourceware.org help / color / mirror / Atom feed
From: Michael Frysinger <vapier@sourceware.org> To: newlib-cvs@sourceware.org Subject: [newlib-cygwin] newlib: simplify header setup rules Date: Tue, 1 Mar 2022 00:03:59 +0000 (GMT) [thread overview] Message-ID: <20220301000359.421183858D20@sourceware.org> (raw) https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=ec5ea6efaebae94f0b37d88b6f1cdc5d24ef878a commit ec5ea6efaebae94f0b37d88b6f1cdc5d24ef878a Author: Mike Frysinger <vapier@gentoo.org> Date: Sat Feb 19 00:22:14 2022 -0500 newlib: simplify header setup rules Since POSIX cp requires copying a file to a directory without having to specify the name explicitly, rely on that to avoid calling basename on every source file. We can also drop the stub `true` call if the -f test failed. The use of `if` already takes care of that in POSIX shell. Diff: --- newlib/Makefile.am | 36 +++++++++++++++--------------------- newlib/Makefile.in | 36 +++++++++++++++--------------------- 2 files changed, 30 insertions(+), 42 deletions(-) diff --git a/newlib/Makefile.am b/newlib/Makefile.am index ad69e95fb..6ee0adf04 100644 --- a/newlib/Makefile.am +++ b/newlib/Makefile.am @@ -211,39 +211,33 @@ stmp-targ-include: config.status targ-include/bits -$(AM_V_at)if [ -n "$(shared_machine_dir)" ]; then \ for i in $(srcdir)/libc/machine/$(shared_machine_dir)/machine/*.h; do \ - if [ -f $$i ]; then \ - cp $$i targ-include/machine/`basename $$i`; \ - else true; fi ; \ - done; \ + [ -f $$i ] && cp $$i targ-include/machine/; \ + done; \ for i in $(srcdir)/libc/machine/$(shared_machine_dir)/sys/*.h; do \ - if [ -f $$i ]; then \ - cp $$i targ-include/sys/`basename $$i`; \ - else true; fi ; \ - done; \ + [ -f $$i ] && cp $$i targ-include/sys/; \ + done; \ for i in $(srcdir)/libc/machine/$(shared_machine_dir)/include/*.h; do \ - if [ -f $$i ]; then \ - cp $$i targ-include/`basename $$i`; \ - else true; fi ; \ - done; \ + [ -f $$i ] && cp $$i targ-include/; \ + done; \ fi -$(AM_V_at)for i in $(srcdir)/libc/machine/$(machine_dir)/machine/*.h; do \ if [ -f $$i ]; then \ - cp $$i targ-include/machine/`basename $$i`; \ + cp $$i targ-include/machine/; \ else true; fi ; \ done -$(AM_V_at)for i in $(srcdir)/libc/machine/$(machine_dir)/sys/*.h; do \ if [ -f $$i ]; then \ - cp $$i targ-include/sys/`basename $$i`; \ + cp $$i targ-include/sys/; \ else true; fi ; \ done -$(AM_V_at)for i in $(srcdir)/libc/machine/$(machine_dir)/include/*.h; do \ if [ -f $$i ]; then \ - cp $$i targ-include/`basename $$i`; \ + cp $$i targ-include/; \ else true; fi ; \ done -$(AM_V_at)for i in $(srcdir)/libc/sys/$(sys_dir)/include/*.h; do \ if [ -f $$i ]; then \ - cp $$i targ-include/`basename $$i`; \ + cp $$i targ-include/; \ else true; fi ; \ done -$(AM_V_at)for i in $(srcdir)/libc/sys/$(sys_dir)/include/*; do \ @@ -258,27 +252,27 @@ stmp-targ-include: config.status done -$(AM_V_at)for i in $(srcdir)/libc/sys/$(sys_dir)/sys/*.h; do \ if [ -f $$i ]; then \ - cp $$i targ-include/sys/`basename $$i`; \ + cp $$i targ-include/sys/; \ else true; fi ; \ done -$(AM_V_at)for i in $(srcdir)/libc/sys/$(sys_dir)/bits/*.h; do \ if [ -f $$i ]; then \ - cp $$i targ-include/bits/`basename $$i`; \ + cp $$i targ-include/bits/; \ else true; fi ; \ done -$(AM_V_at)for i in $(srcdir)/libc/sys/$(sys_dir)/machine/*.h; do \ if [ -f $$i ]; then \ - cp $$i targ-include/machine/`basename $$i`; \ + cp $$i targ-include/machine/; \ else true; fi ; \ done -$(AM_V_at)for i in $(srcdir)/libc/sys/$(sys_dir)/machine/$(machine_dir)/*.h; do \ if [ -f $$i ]; then \ - cp $$i targ-include/machine/`basename $$i`; \ + cp $$i targ-include/machine/; \ else true; fi ; \ done -$(AM_V_at)for i in $(srcdir)/libc/sys/$(sys_dir)/machine/$(machine_dir)/include/*.h; do \ if [ -f $$i ]; then \ - cp $$i targ-include/machine/`basename $$i`; \ + cp $$i targ-include/machine/; \ else true; fi ; \ done $(AM_V_at)$(MAKE) targ-include/newlib.h diff --git a/newlib/Makefile.in b/newlib/Makefile.in index 1491aa1c3..6213d6328 100644 --- a/newlib/Makefile.in +++ b/newlib/Makefile.in @@ -8738,39 +8738,33 @@ stmp-targ-include: config.status targ-include/bits -$(AM_V_at)if [ -n "$(shared_machine_dir)" ]; then \ for i in $(srcdir)/libc/machine/$(shared_machine_dir)/machine/*.h; do \ - if [ -f $$i ]; then \ - cp $$i targ-include/machine/`basename $$i`; \ - else true; fi ; \ - done; \ + [ -f $$i ] && cp $$i targ-include/machine/; \ + done; \ for i in $(srcdir)/libc/machine/$(shared_machine_dir)/sys/*.h; do \ - if [ -f $$i ]; then \ - cp $$i targ-include/sys/`basename $$i`; \ - else true; fi ; \ - done; \ + [ -f $$i ] && cp $$i targ-include/sys/; \ + done; \ for i in $(srcdir)/libc/machine/$(shared_machine_dir)/include/*.h; do \ - if [ -f $$i ]; then \ - cp $$i targ-include/`basename $$i`; \ - else true; fi ; \ - done; \ + [ -f $$i ] && cp $$i targ-include/; \ + done; \ fi -$(AM_V_at)for i in $(srcdir)/libc/machine/$(machine_dir)/machine/*.h; do \ if [ -f $$i ]; then \ - cp $$i targ-include/machine/`basename $$i`; \ + cp $$i targ-include/machine/; \ else true; fi ; \ done -$(AM_V_at)for i in $(srcdir)/libc/machine/$(machine_dir)/sys/*.h; do \ if [ -f $$i ]; then \ - cp $$i targ-include/sys/`basename $$i`; \ + cp $$i targ-include/sys/; \ else true; fi ; \ done -$(AM_V_at)for i in $(srcdir)/libc/machine/$(machine_dir)/include/*.h; do \ if [ -f $$i ]; then \ - cp $$i targ-include/`basename $$i`; \ + cp $$i targ-include/; \ else true; fi ; \ done -$(AM_V_at)for i in $(srcdir)/libc/sys/$(sys_dir)/include/*.h; do \ if [ -f $$i ]; then \ - cp $$i targ-include/`basename $$i`; \ + cp $$i targ-include/; \ else true; fi ; \ done -$(AM_V_at)for i in $(srcdir)/libc/sys/$(sys_dir)/include/*; do \ @@ -8785,27 +8779,27 @@ stmp-targ-include: config.status done -$(AM_V_at)for i in $(srcdir)/libc/sys/$(sys_dir)/sys/*.h; do \ if [ -f $$i ]; then \ - cp $$i targ-include/sys/`basename $$i`; \ + cp $$i targ-include/sys/; \ else true; fi ; \ done -$(AM_V_at)for i in $(srcdir)/libc/sys/$(sys_dir)/bits/*.h; do \ if [ -f $$i ]; then \ - cp $$i targ-include/bits/`basename $$i`; \ + cp $$i targ-include/bits/; \ else true; fi ; \ done -$(AM_V_at)for i in $(srcdir)/libc/sys/$(sys_dir)/machine/*.h; do \ if [ -f $$i ]; then \ - cp $$i targ-include/machine/`basename $$i`; \ + cp $$i targ-include/machine/; \ else true; fi ; \ done -$(AM_V_at)for i in $(srcdir)/libc/sys/$(sys_dir)/machine/$(machine_dir)/*.h; do \ if [ -f $$i ]; then \ - cp $$i targ-include/machine/`basename $$i`; \ + cp $$i targ-include/machine/; \ else true; fi ; \ done -$(AM_V_at)for i in $(srcdir)/libc/sys/$(sys_dir)/machine/$(machine_dir)/include/*.h; do \ if [ -f $$i ]; then \ - cp $$i targ-include/machine/`basename $$i`; \ + cp $$i targ-include/machine/; \ else true; fi ; \ done $(AM_V_at)$(MAKE) targ-include/newlib.h
reply other threads:[~2022-03-01 0:03 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=20220301000359.421183858D20@sourceware.org \ --to=vapier@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).