Thursday 15 April 2010

shell - TCSH Makefile - copy file to name and change permissions -



shell - TCSH Makefile - copy file to name and change permissions -

im trying create makefile tcsh script copies file name proj3 , changes permissions executable everyone. know how makefiles c++ , c , such dont know why we're doing shell scripts.

my file name proj3final

here have far:

proj3final: cp final proj3 chmod 755 proj3

whenever run make proj3 or make prompts nothing done

a makefile rule should always create file same name target.

if want create able tell when needs run rule rule needs prerequisites.

your rule tells create create proj3final file creates proj3 file. going confuse make.

additionally, rule gives target no prerequisites whenever proj3final file exists create assume date , no work must done.

assuming input file named final , want copied file named proj3final rule want is

proj3final: final cp $< $@ chmod 755 $@

which should want , uses automatic variables current target ($@) , first prerequisite ($<).

shell scripting makefile tcsh

No comments:

Post a Comment