help-make
[Top][All Lists]
Advanced

[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:

https://www.gnu.org/software/make/manual/html_node/Conditional-Functions.html#Conditional-Functions


Thanks,

Rakesh

________________________________
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

Hi,


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)')
*return*
endif

<do alot of things>
endef




thanks,

TP
_______________________________________________
Help-make mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/help-make
Help-make -- Users list for the GNU implementation of 
make<https://lists.gnu.org/mailman/listinfo/help-make>
lists.gnu.org
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]