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

# Makefile that generates gen/deps.mk

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

${GEN}/deps.mk::
	${MSG} "[ GEN] ${TGT}"
	printf '# %s\n' "${TGT}" >$@
	if config/cc.sh -MD -MP -MF /dev/null config/empty.c; then \
	    printf 'DEPFLAGS = -MD -MP -MF $${@:.o=.d}\n'; \
	fi >>$@ 2>$@.log
	${VCAT} $@
	@printf -- '-include %s\n' ${OBJS:.o=.d} >>$@