How to check if a variable is set in Makefile?

 To check if a variable is set in Makefile, use the unset command. Did you write a Makefile that tries to figure out all the different ways there are for a user to set an environment variable before compiling your program? It can be a tricky, time-consuming problem, but there's a simple check you can add to your Makefile so that you can be sure you're taking care of it all. 

makefile ifeq or

on Jan 01, 1970
ifeq ($(GCC_MINOR),4)
    @echo Supported version
else ifeq ($(GCC_MINOR),5)
    @echo Supported version
else
    @echo Unsupported version
endif

Add Comment

0

This is one of the most common questions in make/cmake/guess compiler, bash world. The rule is simple.

Shell/Bash answers related to "Makefile ifeq else if"

View All Shell/Bash queries

Shell/Bash queries related to "Makefile ifeq else if"

Browse Other Code Languages

CodeProZone