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.
# 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/,.*//')
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"
# 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/,.*//')
# 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/,.*//')
$(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
$(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
Makefile \
$(srcdir)/config/nvptx/nvptx-sm.def
$(SHELL) $< \
- $(dir $<) \
$(multilib_options_isa_default) \
'$(multilib_options_isa_list)' \
> $@
omp-device-properties-nvptx: $(srcdir)/config/nvptx/nvptx-sm.def
$(SHELL) $(srcdir)/config/nvptx/gen-omp-device-properties.sh \
- "$(srcdir)/config/nvptx" > $@
+ > $@