]> jspc29.x-matter.uni-frankfurt.de Git - trb3.git/commitdiff
ADC: Make compile_constraints.pl work with base/create_project.pl
authorAndreas Neiser <neiser@kph.uni-mainz.de>
Mon, 12 Jan 2015 16:39:10 +0000 (17:39 +0100)
committerAndreas Neiser <neiser@kph.uni-mainz.de>
Mon, 12 Jan 2015 16:39:10 +0000 (17:39 +0100)
ADC/compile_constraints.pl

index 5644d4bf3d784156eee88c3881566b280816998b..287f00a90bf095ca611da4f65239ac3830deceb6 100755 (executable)
@@ -3,7 +3,13 @@ use Data::Dumper;
 use warnings;
 use strict;
 
+my $workdir = shift @ARGV || 'workdir';
+unless(-d $workdir) {
+       print "Creating workdir $workdir\n";
+       mkdir $workdir or die "cant create $workdir: $!";
+}
+
 my $TOPNAME  = "trb3_periph_adc"; #Name of top-level entity
 
-system("cp ../base/$TOPNAME.lpf workdir/$TOPNAME.lpf");
-system("cat ".$TOPNAME."_constraints.lpf >> workdir/$TOPNAME.lpf");
+system("cp ../base/$TOPNAME.lpf $workdir/$TOPNAME.lpf");
+system("cat ".$TOPNAME."_constraints.lpf >> $workdir/$TOPNAME.lpf");