[Top][All Lists]

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

Re: Break or exit out of user defined procedure

From: Rakesh Sharma
Subject: Re: Break or exit out of user defined procedure
Date: Mon, 29 Jan 2018 10:38:01 +0000

Hi TP ,

You can make use of the $(if ...) construct of GNU make for this scenario.

$(if $(call strip,$(filter $(1),$(PACKAGES_ALL))),true_portion,false_portion)

The true portion you already noted as a warning funtion.

And in case the false portion of the $(if ...) clause is too big and hampers 
maintainability of the

code, you factor out into another user-defined macro, and have that macro 
called up in the false portion

in the false portion.

For more info, you can check the manual out:



From: Help-make <address@hidden> on behalf of Toan Pham <address@hidden>
Sent: Friday, January 26, 2018 9:43 AM
To: address@hidden
Subject: Break or exit out of user defined procedure


Is it possible to exit a user defined procedure with something like this?

define inner-generic-package

ifneq ($(call strip,$(filter $(1),$(PACKAGES_ALL))),)
$$(warning Package '$(1)' defined a second time in '$(pkgdir)'; \
   previous definition was in '$$($(2)_PKGDIR)')

<do alot of things>


Help-make mailing list
Help-make -- Users list for the GNU implementation of 
This list is for users and installers of GNU make to ask for help. Please send 
bug reports to address@hidden instead of posting them here. To see the 
collection of ...

reply via email to

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