Script from makefile issues

Associate
Joined
22 Sep 2009
Posts
2,085
Location
Leicester
Attempting to write some shell scripts to aid compiling in Linux however it's being as awkward as possible to get working without issue :p

So far I have is...

makefile:
Code:
...
package:
	$(shell ./package_kernel.sh $(VAR))
...

package_kernel.sh:
Code:
if [ $# -gt 0 ] ; then
	echo Packaging kernel to $1...
	gzip -9 kernel.bin -c > ../$1
	echo Done!
else
	echo No filename supplied, using default...
	gzip -9 kernel.bin -c > ../Project_Evolution.kgz
	echo Done!
fi

terminal said:
ubuntu@ubuntu:/media/3A12-10C1/os$ make package VAR=package.kgz
Packaging kernel to package.kgz... Done!
/bin/sh: Packaging: not found
make: *** [package] Error 127

Obviously something is wrong here and I think it's with my echos, running the script via the terminal (./package_kernel package.kgz) works as expected so I'm assuming there is some funky quirk I'm not yet aware of, would anyone mind enlightening me?
 
Whoops.

Code:
package:

	$(shell . package_kernel.sh $(VAR))

terminal said:
ubuntu@ubuntu:/media/3A12-10C1/os$ make package VAR=package.kgz
.: 1: package_kernel.sh: not found
make: `package' is up to date.

Code:
package:

	$(shell . ./package_kernel.sh $(VAR))

terminal said:
ubuntu@ubuntu:/media/3A12-10C1/os$ make package VAR=package.kgz
No filename supplied, using default... Done!
/bin/sh: No: not found
make: *** [package] Error 127

If i use what was in my first post everything works, however the echo gets printed at the end and then the make error, remove the echo and everything works flawlessly but I can't see how things are getting on (I know in this script it doesn't affect things, but in my larger ones it'd be nice to see progress).
 
Back
Top Bottom