Say I have the following function defined in my .bashrc:
foo (){
touch $1
}
I want to call this function in a makefile like so:
%.png : %.tex
bash -i -c foo $<
But this complains about a missing operand. (The error is "touch: missing file operand", so it is calling touch...). I've seen some solutions to similar issues, but they aren't applicable since I need the automatic variable $< (or rather, its value) to be passed as an argument to the shell script.
I know I could work around this problem (copy the function wholesale into the makefile, for example) but I'm curious to see how I could solve my problem within the makefile.