[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] mintlib Makefile requires bash as shell



Eero Tamminen wrote:
RESULT = false
RESULT = true

works fine.

Of course.
The makefile variable is affected multiple times *outside from any rule*, the last one wins.

As I think should:
RESULT ?= false
all:
	if ($$(RESULT) == false) \
		RESULT=true $(MAKE); \
 	fi

This fragment contains multiple syntax errors.
But I understand your method.
Because the makefiles variables are read-only at runtime, you fork another make instance with an overridden variable value.

I fixed the syntax and added a trace, the following works:

RESULT := false

all:
	echo Trace MAKELEVEL=$(MAKELEVEL) RESULT=$(RESULT)
ifeq ($(RESULT), false)
	$(MAKE) RESULT=true
endif

--
Vincent Rivière