1 # $Id: init.mk,v 1.16 2019/09/28 16:54:02 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 .for x in COPTS CPPFLAGS CPUFLAGS LDFLAGS
40 $x += ${$x.${COMPILER_TYPE}:U} ${$x.${.IMPSRC:T}:U}
47 PROFFLAGS?= -DGPROF -DPROF
49 .if ${.MAKE.LEVEL:U1} == 0 && ${BUILD_AT_LEVEL0:Uyes:tl} == "no"
50 # this tells lib.mk and prog.mk to not actually build anything
51 _SKIP_BUILD = not building at level 0
54 .if !defined(.PARSEDIR)
55 # no-op is the best we can do if not bmake.
59 # define this once for consistency
60 .if empty(_SKIP_BUILD)
61 # beforebuild is a hook for things that must be done early
62 all: beforebuild .WAIT realbuild
65 .warning ${_SKIP_BUILD}