On 2021-03-22 at 06:33, Richard Forst wrote: > I have a Makefile used to check whether svn command existing or not. > The content is below
I'm not remotely a make expert (not even really familiar with make, except to read it), but a couple of questions do occur to me. (I also look at this and think "okay, this seems way too complicated for such a simple goal, you've got to be doing it wrong somehow" - but I don't know make well enough to actually make that determination, much less propose a better way in make, so it's entirely possible that I'm wrong. That said, I think the usual practice is to test for command existence et cetera in a configure script, use that to define variables, and have the make call reference those variables.) > all: > $(eval svnbin=$(shell basename $(shell which svn))) There's no 'shell' command in my environment. Is this a make-ism I'm not familiar with, or do you have something set up we're not seeing? > $(info X$(svnbin)Y) > $(echo X$(svnbin)Y) > ifneq ($(strip $(svnbin)),svn) What are you expecting this to do ? In my environment, 'strip' is the program which strips debugging symbols (et cetera) from compiled object files (usually meaning ELF-format executables or libraries), and wouldn't output anything suitable for comparing for equality to the string 'svn'. -- The Wanderer The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore all progress depends on the unreasonable man. -- George Bernard Shaw
signature.asc
Description: OpenPGP digital signature