summaryrefslogtreecommitdiffstats
path: root/build/deps.mk
blob: e8dd9fb8b5a17ec0c070430a3ba052d32ab8c6b9 (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 build/prelude.mk
include gen/vars.mk
include gen/flags.mk
include build/exports.mk

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