I have a Makefile of the following form:
upload_image_local: build_image_local ; echo "This gets printed" ; upload_image
with
build_image_local: echo "This is build_image_local"
./my_shell_script_1.sh $(SOME_ENV_VAR_1)
upload_image: echo "This is upload_image"
./my_shell_script_2.sh $(SOME_ENV_VAR_2)
As you can tell, when I run make upload_image_local
, I want build_image_local
and upload_image
to be run. Instead I get:
/bin/sh: upload_image: command not found
I know for file dependencies we put spaces between them, but here I'm not sure how to separate the two statements properly. I also tried putting them in the next line with semicolons and a tab character (I know it matters):
upload_image_local:
build_image_local ; echo "This gets printed" ; upload_image
In which case I get:
/bin/sh: build_image_local: command not found
make: *** [upload_image_local] Error 127
What is the correct way to run this target? Also, why do the echo
commands get printed fine? If it matters I'm running this Makefile on a Mac and with the sh
shell (as it says).