# HG changeset patch # User Shinji KONO # Date 1607946278 -32400 # Node ID 03b57cc656d986b0926801c6879c57a79bf326fc # Parent 8c6ae8783321f5204b4ad2fe14ef98ba83743c59 llvm option in pmake.pl diff -r 8c6ae8783321 -r 03b57cc656d9 src/gearsTools/pmake.pl --- a/src/gearsTools/pmake.pl Mon Dec 14 15:57:53 2020 +0900 +++ b/src/gearsTools/pmake.pl Mon Dec 14 20:44:38 2020 +0900 @@ -5,7 +5,7 @@ use Cwd 'getcwd'; use File::Path 'rmtree'; -my ($cc,$cflags,$asm,$ld,$ldflags,$libgcc,$cmake,$kernel_cflags,$kernel_ld_flags,$kernel_ld_command, $initcode_cflags, $initcode_ld_command); +my ($cc,$cflags,$asm,$ld,$ldflags,$libgcc,$cmake,$kernel_cflags,$kernel_ld_flags,$kernel_ld_command, $initcode_cflags, $initcode_ld_command,$cbcmdir); my $curdir = getcwd; @@ -19,6 +19,13 @@ print "delete ...\n"; map { rmtree $_ } @current_dir_file; } + shift; + } else { + if ($ARGV[0] =~ /--llvm/) { + shift; + $cbcmdir = $ARGV[0]; + shift; + } } } @@ -32,9 +39,11 @@ my $armdir = "/usr/local/Cellar/arm-none-eabi-gcc/9-2019-q4-major"; $objcopy = "$armdir/bin/arm-none-eabi-objcopy"; # my $cbcmdir = "/usr/local/Cellar/cbc/llvm10"; - my $cbcmdir = `brew info --formula cbc | grep llvm`; - chop $cbcmdir; - $cbcmdir =~ s/ .*//; + if (! defined $cbcmdir) { + $cbcmdir = `brew info --formula cbc | grep llvm`; + chop $cbcmdir; + $cbcmdir =~ s/ .*//; + } if (! -d $cbcmdir) { die "cant' find cbclangdir $cbcmdir"; }