Mercurial > hg > CbC > CbC_xv6
changeset 394:03b57cc656d9
llvm option in pmake.pl
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 14 Dec 2020 20:44:38 +0900 |
parents | 8c6ae8783321 |
children | 17e8a4bc06a7 |
files | src/gearsTools/pmake.pl |
diffstat | 1 files changed, 13 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- 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"; }