I have a function in my .profile which I need in a makefile (one of the first ones I ever made). As far as I can tell make doesn’t allow for interactively defined functions or aliases
How can I still make use of the function? This is defined in my .profile:
matlabs(){
/Applications/Matlab.app/bin/matlab -nodesktop -nosplash -nojvm -r "disp('MATLAB:');${1}; quit();" | tail -n +11
}
And I would like to do this in the makefile:
num.txt : finance.m
matlabs finance
Makefiles aren’t shell scripts. What you can do is make a shell script out of your
matlabsfunction; put the following in an executable filematlabssomewhere in yourPATH:Alternatively, if you don’t want the Makefile to depend on an external script and you need to do this transformation often, you can define an implicit Makefile rule for it: