xref: /freebsd/contrib/bmake/mk/prlist.mk (revision c59c3bf34db360695f07735bebc76a768cac5afc)
1*c59c3bf3SSimon J. Gerraty# SPDX-License-Identifier: BSD-2-Clause
2*c59c3bf3SSimon J. Gerraty#
3*c59c3bf3SSimon J. Gerraty# $Id: prlist.mk,v 1.6 2024/02/17 17:26:57 sjg Exp $
43cbdda60SSimon J. Gerraty#
53cbdda60SSimon J. Gerraty#	@(#) Copyright (c) 2006, Simon J. Gerraty
63cbdda60SSimon J. Gerraty#
73cbdda60SSimon J. Gerraty#	This file is provided in the hope that it will
83cbdda60SSimon J. Gerraty#	be of use.  There is absolutely NO WARRANTY.
93cbdda60SSimon J. Gerraty#	Permission to copy, redistribute or otherwise
103cbdda60SSimon J. Gerraty#	use this file is hereby granted provided that
113cbdda60SSimon J. Gerraty#	the above copyright notice and this notice are
123cbdda60SSimon J. Gerraty#	left intact.
133cbdda60SSimon J. Gerraty#
143cbdda60SSimon J. Gerraty#	Please send copies of changes and bug-fixes to:
153cbdda60SSimon J. Gerraty#	sjg@crufty.net
163cbdda60SSimon J. Gerraty#
173cbdda60SSimon J. Gerraty
183cbdda60SSimon J. Gerraty.if !target(__${.PARSEFILE}__)
1912904384SSimon J. Gerraty__${.PARSEFILE}__: .NOTMAIN
203cbdda60SSimon J. Gerraty
213cbdda60SSimon J. Gerraty# this needs to be included after all the lists it will process
223cbdda60SSimon J. Gerraty# are defined - which is why it is a separate file.
233cbdda60SSimon J. Gerraty# Usage looks like:
243cbdda60SSimon J. Gerraty#   MAKEFLAGS= ${.MAKE} -f ${MAKEFILE} prlist.SOMETHING_HUGE | xargs whatever
253cbdda60SSimon J. Gerraty#
263cbdda60SSimon J. Gerraty.if make(prlist.*)
273cbdda60SSimon J. Gerraty.for t in ${.TARGETS:Mprlist.*:E}
283cbdda60SSimon J. Gerraty.if empty($t)
293cbdda60SSimon J. Gerratyprlist.$t:
303cbdda60SSimon J. Gerraty.else
313cbdda60SSimon J. Gerratyprlist.$t:	${$t:O:u:S,^,prlist-,}
323cbdda60SSimon J. Gerraty${$t:O:u:S,^,prlist-,}: .PHONY
333cbdda60SSimon J. Gerraty	@echo "${.TARGET:S,prlist-,,}"
343cbdda60SSimon J. Gerraty.endif
353cbdda60SSimon J. Gerraty.endfor
363cbdda60SSimon J. Gerraty.endif
373cbdda60SSimon J. Gerraty
383cbdda60SSimon J. Gerraty.endif
39