mirror of
https://github.com/nasa/trick.git
synced 2024-12-18 20:57:55 +00:00
CP needs more verbose checking of makefile generation
CP now tests if the current directory is writable before trying to create a makefile and compile the sim. Fixes #26.
This commit is contained in:
parent
306dee18a3
commit
48a09d386e
6
bin/CP
6
bin/CP
@ -4,12 +4,18 @@
|
||||
# so I converted CP back to perl. :)
|
||||
|
||||
use File::Basename ;
|
||||
use Cwd ;
|
||||
use Cwd 'abs_path';
|
||||
|
||||
$trick_bin = dirname(abs_path($0)) ;
|
||||
$trick_home = dirname($trick_bin) ;
|
||||
|
||||
if ( -f "S_define" ) {
|
||||
if ( not -w "." ) {
|
||||
print getcwd() , " is not writable\n" ;
|
||||
print "CP aborted\n" ;
|
||||
exit 1 ;
|
||||
}
|
||||
unlink "Makefile_sim", "makefile" ;
|
||||
$makefile_text = do { local $/; <main::DATA> } ;
|
||||
$makefile_text =~ s/SUB_TRICK_HOME/$trick_home/ ;
|
||||
|
Loading…
Reference in New Issue
Block a user