help-make
[Top][All Lists]
Advanced

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

Using error and warning functions inside a user defined function


From: Edson Seabra
Subject: Using error and warning functions inside a user defined function
Date: Fri, 28 Oct 2005 11:35:54 -0700




Hi,

I'm trying  to write a custom function that will abort the make if  there
are variables not defined in the list passed as parameter 1.

The idea is call  the funcion in several places inside the makefile:

....

$(call check_undefined_vars,<var_list1>)

....

$(call check_undefined_vars,<var_list2>)


But I have to write this:

VARS_NOT_DEFINED :=
$(call check_undefined_vars, <var_list>)
ifneq ($(words $(VARS_NOT_DEFINED)),0)
$(error Variable(s): '$(VARS_NOT_DEFINED)' must be defined.)
endif

Because if I move the if with the call to error inside the function
"check_undefined_vars" the make aborts always it does not matter if the
variables in <var_list> are defined or not.

Thanks,
Edson.






reply via email to

[Prev in Thread] Current Thread [Next in Thread]