summaryrefslogtreecommitdiffstats
path: root/build/deps.mk
blob: 3db62b622ced3804b7305920db1dad3834e515ba (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 'CPPFLAGS += -MD -MP\n'; \
	fi >>$@ 2>$@.log
	${VCAT} $@
	@printf -- '-include %s\n' ${OBJS:.o=.d} >>$@