diff options
author | Thomas Schwinge <tschwinge@baylibre.com> | 2024-12-02 16:42:14 +0100 |
---|---|---|
committer | Thomas Schwinge <tschwinge@baylibre.com> | 2024-12-06 10:08:19 +0100 |
commit | 61da068638779580684c59d6d330f58c016a2268 (patch) | |
tree | a2aae56b21c16b1109a298950601d2969dd79dab /gcc | |
parent | b352f89d81bb30dbeb406ff7e4d148e2fb640975 (diff) | |
download | gcc-61da068638779580684c59d6d330f58c016a2268.zip gcc-61da068638779580684c59d6d330f58c016a2268.tar.gz gcc-61da068638779580684c59d6d330f58c016a2268.tar.bz2 |
'gcc/config/nvptx/gen-*.sh': Simplify interface
What we currently pass in as '$1' is simply 'dirname "$0"'.
gcc/
* config/nvptx/gen-h.sh: Don't pass in '$1'; compute it locally.
* config/nvptx/gen-multilib-matches.sh: Likewise.
* config/nvptx/gen-omp-device-properties.sh: Likewise.
* config/nvptx/gen-opt.sh: Likewise.
* config/nvptx/t-nvptx (s-nvptx-gen-h:, s-nvptx-gen-opt:)
(t-nvptx-gen-multilib-matches:): Adjust.
* config/nvptx/t-omp-device (omp-device-properties-nvptx):
Likewise.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/config/nvptx/gen-h.sh | 8 | ||||
-rwxr-xr-x | gcc/config/nvptx/gen-multilib-matches.sh | 8 | ||||
-rw-r--r-- | gcc/config/nvptx/gen-omp-device-properties.sh | 6 | ||||
-rw-r--r-- | gcc/config/nvptx/gen-opt.sh | 8 | ||||
-rw-r--r-- | gcc/config/nvptx/t-nvptx | 5 | ||||
-rw-r--r-- | gcc/config/nvptx/t-omp-device | 2 |
6 files changed, 26 insertions, 11 deletions
diff --git a/gcc/config/nvptx/gen-h.sh b/gcc/config/nvptx/gen-h.sh index ea75e12..bc4ce9a 100644 --- a/gcc/config/nvptx/gen-h.sh +++ b/gcc/config/nvptx/gen-h.sh @@ -18,8 +18,12 @@ # along with GCC; see the file COPYING3. If not see # <http://www.gnu.org/licenses/>. -nvptx_sm_def="$1/nvptx-sm.def" -gen_copyright_sh="$1/gen-copyright.sh" + +nvptx_dir=$(dirname "$0") + + +nvptx_sm_def="$nvptx_dir/nvptx-sm.def" +gen_copyright_sh="$nvptx_dir/gen-copyright.sh" sms=$(grep ^NVPTX_SM $nvptx_sm_def | sed 's/.*(//;s/,.*//') diff --git a/gcc/config/nvptx/gen-multilib-matches.sh b/gcc/config/nvptx/gen-multilib-matches.sh index e52d571..09761a9 100755 --- a/gcc/config/nvptx/gen-multilib-matches.sh +++ b/gcc/config/nvptx/gen-multilib-matches.sh @@ -22,11 +22,15 @@ set -e -nvptx_sm_def="$1/nvptx-sm.def" -shift + +nvptx_dir=$(dirname "$0") + + +nvptx_sm_def="$nvptx_dir/nvptx-sm.def" sms=$(grep ^NVPTX_SM $nvptx_sm_def | sed 's/.*(//;s/,.*//') + # Every variant in 'sms' has to either be remapped to the default variant # ('.', which is always built), or does get built as non-default variant # ('misa=sm_SM'; thus not remapped), or has to be remapped to the "next lower" diff --git a/gcc/config/nvptx/gen-omp-device-properties.sh b/gcc/config/nvptx/gen-omp-device-properties.sh index 3666f97..5995d49 100644 --- a/gcc/config/nvptx/gen-omp-device-properties.sh +++ b/gcc/config/nvptx/gen-omp-device-properties.sh @@ -18,7 +18,11 @@ # along with GCC; see the file COPYING3. If not see # <http://www.gnu.org/licenses/>. -nvptx_sm_def="$1/nvptx-sm.def" + +nvptx_dir=$(dirname "$0") + + +nvptx_sm_def="$nvptx_dir/nvptx-sm.def" sms=$(grep ^NVPTX_SM $nvptx_sm_def | sed 's/.*(//;s/,.*//') diff --git a/gcc/config/nvptx/gen-opt.sh b/gcc/config/nvptx/gen-opt.sh index 6022f51..103bcdd 100644 --- a/gcc/config/nvptx/gen-opt.sh +++ b/gcc/config/nvptx/gen-opt.sh @@ -18,8 +18,12 @@ # along with GCC; see the file COPYING3. If not see # <http://www.gnu.org/licenses/>. -nvptx_sm_def="$1/nvptx-sm.def" -gen_copyright_sh="$1/gen-copyright.sh" + +nvptx_dir=$(dirname "$0") + + +nvptx_sm_def="$nvptx_dir/nvptx-sm.def" +gen_copyright_sh="$nvptx_dir/gen-copyright.sh" sms=$(grep ^NVPTX_SM $nvptx_sm_def | sed 's/.*(//;s/,.*//') diff --git a/gcc/config/nvptx/t-nvptx b/gcc/config/nvptx/t-nvptx index 6c6a632..00a7b15 100644 --- a/gcc/config/nvptx/t-nvptx +++ b/gcc/config/nvptx/t-nvptx @@ -16,7 +16,7 @@ mkoffload$(exeext): mkoffload.o collect-utils.o libcommon-target.a $(LIBIBERTY) $(srcdir)/config/nvptx/nvptx.h: $(srcdir)/config/nvptx/nvptx-gen.h $(srcdir)/config/nvptx/nvptx-gen.h: s-nvptx-gen-h; @true s-nvptx-gen-h: $(srcdir)/config/nvptx/nvptx-sm.def - $(SHELL) $(srcdir)/config/nvptx/gen-h.sh "$(srcdir)/config/nvptx" \ + $(SHELL) $(srcdir)/config/nvptx/gen-h.sh \ > tmp-nvptx-gen.h $(SHELL) $(srcdir)/../move-if-change \ tmp-nvptx-gen.h $(srcdir)/config/nvptx/nvptx-gen.h @@ -25,7 +25,7 @@ s-nvptx-gen-h: $(srcdir)/config/nvptx/nvptx-sm.def $(srcdir)/config/nvptx/nvptx-gen.opt: s-nvptx-gen-opt; @true s-nvptx-gen-opt: $(srcdir)/config/nvptx/nvptx-sm.def \ $(srcdir)/config/nvptx/gen-opt.sh - $(SHELL) $(srcdir)/config/nvptx/gen-opt.sh "$(srcdir)/config/nvptx" \ + $(SHELL) $(srcdir)/config/nvptx/gen-opt.sh \ > tmp-nvptx-gen.opt $(SHELL) $(srcdir)/../move-if-change \ tmp-nvptx-gen.opt $(srcdir)/config/nvptx/nvptx-gen.opt @@ -49,7 +49,6 @@ t-nvptx-gen-multilib-matches: $(srcdir)/config/nvptx/gen-multilib-matches.sh \ Makefile \ $(srcdir)/config/nvptx/nvptx-sm.def $(SHELL) $< \ - $(dir $<) \ $(multilib_options_isa_default) \ '$(multilib_options_isa_list)' \ > $@ diff --git a/gcc/config/nvptx/t-omp-device b/gcc/config/nvptx/t-omp-device index c2b28a4..6785ddd 100644 --- a/gcc/config/nvptx/t-omp-device +++ b/gcc/config/nvptx/t-omp-device @@ -1,3 +1,3 @@ omp-device-properties-nvptx: $(srcdir)/config/nvptx/nvptx-sm.def $(SHELL) $(srcdir)/config/nvptx/gen-omp-device-properties.sh \ - "$(srcdir)/config/nvptx" > $@ + > $@ |