How can I print message in Makefile?

Makefile

Makefile Problem Overview


I want to print some message while doing build process with a makefile. The following one can print the message, but it will not execute the script after it. How can I fix this issues?

ifeq (yes, ${TEST})
        CXXFLAGS := ${CXXFLAGS} -DDESKTOP_TEST
test:
        @echo '************  TEST VERSION ************'
else
release:
        @echo "************ RELEASE VERSIOIN **********"
endif

Makefile Solutions


Solution 1 - Makefile

It's not clear what you want, or whether you want this trick to work with different targets, or whether you've defined these targets elsewhere, or what version of Make you're using, but what the heck, I'll go out on a limb:

ifeq (yes, ${TEST})
CXXFLAGS := ${CXXFLAGS} -DDESKTOP_TEST
test:
$(info ************  TEST VERSION ************)
else
release:
$(info ************ RELEASE VERSIOIN **********)
endif

Solution 2 - Makefile

>$(info your_text) : Information. This doesn't stop the execution.
> >$(warning your_text) : Warning. This shows the text as a warning.
> >$(error your_text) : Fatal Error. This will stop the execution.

src: https://www.gnu.org/software/make/manual/make.html#Make-Control-Functions

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionDanView Question on Stackoverflow
Solution 1 - MakefileBetaView Answer on Stackoverflow
Solution 2 - MakefileVishnu N KView Answer on Stackoverflow