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
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 queriesShell/Bash queries related to "Makefile ifeq else if"
Browse Other Code Languages
Abap ActionScript Assembly BASIC C C# C++ Clojure Cobol CSS Dart Delphi Elixir Erlang F# Fortran Go Groovy Haskell Html Java Javascript Julia Kotlin Lisp Lua Matlab Objective-C Pascal Perl PHP PostScript Prolog Python R Ruby Rust Scala Scheme Shell/Bash Smalltalk SQL Swift TypeScript VBA WebAssembly Whatever