summaryrefslogtreecommitdiffstats
path: root/config/pkg.mk
blob: fafe5629941c8fd02e498fa5b0e9ed20d8ac70cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Copyright © Tavian Barnes <tavianator@tavianator.com>
# SPDX-License-Identifier: 0BSD

# Makefile that generates gen/lib*.mk

include config/prelude.mk
include ${GEN}/vars.mk
include ${GEN}/flags.mk
include config/exports.mk

# Like ${TGT} but for ${TARGET}, not $@
SHORT = ${TARGET:${BUILDDIR}/%=%}

default::
	@printf '# %s\n' "${SHORT}" >${TARGET}
	config/pkg.sh ${TARGET:${GEN}/%.mk=%} >>${TARGET} 2>${TARGET}.log
	@if [ "${IS_V}" ]; then \
	    cat ${TARGET}; \
	elif grep -q PKGS ${TARGET}; then \
	    printf '[ GEN] %-${MSG_WIDTH}s  ✔\n' ${SHORT}; \
	else \
	    printf '[ GEN] %-${MSG_WIDTH}s  ✘\n' ${SHORT}; \
	fi