1319884Ssjg# $Id: init.mk,v 1.15 2017/05/07 20:27:54 sjg Exp $
2246149Ssjg#
3246149Ssjg#	@(#) Copyright (c) 2002, Simon J. Gerraty
4246149Ssjg#
5246149Ssjg#	This file is provided in the hope that it will
6246149Ssjg#	be of use.  There is absolutely NO WARRANTY.
7246149Ssjg#	Permission to copy, redistribute or otherwise
8246149Ssjg#	use this file is hereby granted provided that 
9246149Ssjg#	the above copyright notice and this notice are
10246149Ssjg#	left intact. 
11246149Ssjg#      
12246149Ssjg#	Please send copies of changes and bug-fixes to:
13246149Ssjg#	sjg@crufty.net
14246149Ssjg#
15246149Ssjg
16246149Ssjg.if !target(__${.PARSEFILE}__)
17246149Ssjg__${.PARSEFILE}__:
18246149Ssjg
19246149Ssjg.if ${MAKE_VERSION:U0} > 20100408
20246149Ssjg_this_mk_dir := ${.PARSEDIR:tA}
21246149Ssjg.else
22246149Ssjg_this_mk_dir := ${.PARSEDIR}
23246149Ssjg.endif
24246149Ssjg
25246149Ssjg.-include <local.init.mk>
26300313Ssjg.-include <${.CURDIR:H}/Makefile.inc>
27246149Ssjg.include <own.mk>
28246149Ssjg
29246149Ssjg.MAIN:		all
30246149Ssjg
31300313Ssjg# should have been set by sys.mk
32300313SsjgCXX_SUFFIXES?= .cc .cpp .cxx .C
33300313Ssjg
34246149Ssjg.if !empty(WARNINGS_SET) || !empty(WARNINGS_SET_${MACHINE_ARCH})
35246149Ssjg.include <warnings.mk>
36246149Ssjg.endif
37246149Ssjg
38246149SsjgCOPTS += ${COPTS.${.IMPSRC:T}}
39246149SsjgCPPFLAGS += ${CPPFLAGS.${.IMPSRC:T}}
40246149SsjgCPUFLAGS += ${CPUFLAGS.${.IMPSRC:T}}
41246149Ssjg
42253883SsjgCC_PG?= -pg
43253883SsjgCXX_PG?= ${CC_PG}
44253883SsjgCC_PIC?= -DPIC
45253883SsjgCXX_PIC?= ${CC_PIC}
46253883SsjgPROFFLAGS?= -DGPROF -DPROF
47253883Ssjg
48246149Ssjg.if ${.MAKE.LEVEL:U1} == 0 && ${BUILD_AT_LEVEL0:Uyes:tl} == "no"
49246149Ssjg# this tells lib.mk and prog.mk to not actually build anything
50246149Ssjg_SKIP_BUILD = not building at level 0
51246149Ssjg.endif
52246149Ssjg
53319884Ssjg.if !defined(.PARSEDIR)
54319884Ssjg# no-op is the best we can do if not bmake.
55319884Ssjg.WAIT:
56319884Ssjg.endif
57319884Ssjg
58319884Ssjg# define this once for consistency
59319884Ssjg.if empty(_SKIP_BUILD)
60319884Ssjg# beforebuild is a hook for things that must be done early
61319884Ssjgall: beforebuild .WAIT realbuild
62319884Ssjg.else
63291978Ssjgall: .PHONY
64291978Ssjg.warning ${_SKIP_BUILD}
65246149Ssjg.endif
66319884Ssjgbeforebuild:
67319884Ssjgrealbuild:
68319884Ssjg
69291978Ssjg.endif
70