Article 5FEKV ifeq comparison problem

ifeq comparison problem

by
shogun1234
from LinuxQuestions.org on (#5FEKV)
I think I am confused with ifneq clause in Makefile (make: 4.3/ kernel: 5.6.0-1-rt-amd64, debian bullseye/sid).

I want to check if svn command exists or not so I draft the following in Makefile
Code: $(eval svn_path := $(shell which svn))
$(eval svn_bin := $(shell basename $(svn_path)))
$(warning svn_bin=$(svn_bin)) // this line prints svn_bin=svn
ifneq ($(svn_bin),svn)
echo "svn=$(svn_bin)"
endifMy expectation is ifneq will skip the echo section because I have svn installed and the variable svn_bin is svn so svn = svn, which should skip the echo line. However the result is the execution goes down to echo statement and prints svn=svn. I am really confused.

So I check the doc at [1]. I copy the example, changing ifeq to ifneq; and run the problem. The result does exactly show ifneq then gcc will get printed on console. So I do not know what goes wrong with my code (I expect svn = svn, so the echo statement should not be ran at all).

Any advice? Thanks

[1]. https://www.gnu.org/software/make/ma...l-Example.htmllatest?d=yIl2AUoC8zA latest?i=gQAprDonQXg:RqnsV36s_zU:F7zBnMy latest?i=gQAprDonQXg:RqnsV36s_zU:V_sGLiP latest?d=qj6IDK7rITs latest?i=gQAprDonQXg:RqnsV36s_zU:gIN9vFwgQAprDonQXg
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments