diff options
author | Takashi Kokubun <takashikkbn@gmail.com> | 2020-03-22 23:07:09 -0700 |
---|---|---|
committer | Takashi Kokubun <takashikkbn@gmail.com> | 2020-03-22 23:12:54 -0700 |
commit | d578f1d3ea317ef8d899d0fd9a4440ba67821d17 (patch) | |
tree | 6bed16a320b5ecb3ec869735c0a8843545e967a7 /tool/run_without_tabs.rb | |
parent | d059714746466b4062545719f2e81ca612aa22f3 (diff) |
Change the run_without_tabs switching to dedicated
variable of make instead of d059714746 as requested.
You can disable this like `make MJIT_WITHOUT_TABS=false` or
`export MJIT_WITHOUT_TABS=false`.
Diffstat (limited to 'tool/run_without_tabs.rb')
-rw-r--r-- | tool/run_without_tabs.rb | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/tool/run_without_tabs.rb b/tool/run_without_tabs.rb index aa5fb7f798..d1640c6d82 100644 --- a/tool/run_without_tabs.rb +++ b/tool/run_without_tabs.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true # This is a script to run a command in ARGV, expanding tabs in some files -# included by vm.c to normalize indentation of MJIT header when debugflags -# is -ggdb3 (default). +# included by vm.c to normalize indentation of MJIT header. You can disable +# this feature by setting MJIT_WITHOUT_TABS=false make variable. # # Note that preprocessor of GCC converts a hard tab to one spaces, where # we expect it to be shown as 8 spaces. To obviate this script, we need @@ -22,18 +22,15 @@ SKIPPED_FILES = %w[ vm_opts.h ] -unless split_index = ARGV.index('--') - abort "Usage: #{$0} [debugflags] -- [cmmand...]" -end -debugflags, command = ARGV[0...split_index], ARGV[(split_index + 1)..-1] - srcdir = File.expand_path('..', __dir__) targets = EXPAND_TARGETS.flat_map { |t| Dir.glob(File.join(srcdir, t)) } - SKIPPED_FILES.map { |f| File.join(srcdir, f) } sources = {} mtimes = {} +flag, *command = ARGV + targets.each do |target| - next unless debugflags.include?('-ggdb3') + next if flag != 'true' unless File.writable?(target) puts "tool/run_without_tabs.rb: Skipping #{target.dump} as it's not writable." next |