1 # $Id: init.mk,v 1.25 2020/11/27 17:59:46 sjg Exp $
3 # @(#) Copyright (c) 2002, Simon J. Gerraty
5 # This file is provided in the hope that it will
6 # be of use. There is absolutely NO WARRANTY.
7 # Permission to copy, redistribute or otherwise
8 # use this file is hereby granted provided that
9 # the above copyright notice and this notice are
12 # Please send copies of changes and bug-fixes to:
16 .if !target(__${.PARSEFILE}__)
19 .if ${MAKE_VERSION:U0} > 20100408
20 _this_mk_dir := ${.PARSEDIR:tA}
22 _this_mk_dir := ${.PARSEDIR}
25 .-include <local.init.mk>
26 .-include <${.CURDIR:H}/Makefile.inc>
28 .include <compiler.mk>
32 # should have been set by sys.mk
33 CXX_SUFFIXES?= .cc .cpp .cxx .C
35 .if !empty(WARNINGS_SET) || !empty(WARNINGS_SET_${MACHINE_ARCH})
36 .include <warnings.mk>
39 # these are applied in order, least specific to most
40 VAR_QUALIFIER_LIST += \
41 ${TARGET_SPEC_VARS:UMACHINE:@v@${$v}@} \
46 ${VAR_QUALIFIER_XTRA_LIST}
48 QUALIFIED_VAR_LIST += \
55 # a final :U avoids errors if someone uses :=
56 .for V in ${QUALIFIED_VAR_LIST:O:u:@q@$q $q_LAST@}
57 .for Q in ${VAR_QUALIFIER_LIST:u}
58 $V += ${$V.$Q:U} ${$V.$Q.${COMPILER_TYPE}:U}
66 PROFFLAGS?= -DGPROF -DPROF
68 .if ${.MAKE.LEVEL:U1} == 0 && ${MK_DIRDEPS_BUILD:Uno} == "yes"
69 # targets that are ok at level 0
70 DIRDEPS_BUILD_LEVEL0_TARGETS += clean* destroy*
71 M_ListToSkip?= O:u:S,^,N,:ts:
72 .if ${.TARGETS:Uall:${DIRDEPS_BUILD_LEVEL0_TARGETS:${M_ListToSkip}}} != ""
73 # this tells lib.mk and prog.mk to not actually build anything
74 _SKIP_BUILD = not building at level 0
78 .if !defined(.PARSEDIR)
79 # no-op is the best we can do if not bmake.
83 # define this once for consistency
84 .if !defined(_SKIP_BUILD)
85 # beforebuild is a hook for things that must be done early
86 all: beforebuild .WAIT realbuild
89 .if !empty(_SKIP_BUILD) && ${.MAKEFLAGS:M-V} == ""
90 .warning ${_SKIP_BUILD}