Here’s a fun one. The following command:
java -Xmx2g Test
works fine when run from the command-line, but not when run from within a make recipe. It errors out with the following message:
Error occurred during initialization of VM
Could not reserve enough space for object heap
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
I just spent a good 20 minutes trying to figure out how to have a makefile conditionally color its output depending on the current terminal’s level of color support. Long story short, there were a number of make idiosyncrasies that I wasn’t expecting / had forgotten about. So, for future reference, here’s a quick recap:
echoevaluates escapes by default
:=evaluates immediately, while
This is a makefile template that contains the following Git directives:
It’s handy for managing a project under Git version control (especially a project with a remote origin).