xref: /freebsd/share/mk/bsd.prog.mk (revision bcf99d2d99910404f734b910c5214854e0fe626d)
13585b293SGarrett Wollman#	from: @(#)bsd.prog.mk	5.26 (Berkeley) 6/25/91
27f3dea24SPeter Wemm# $FreeBSD$
3afe61c15SRodney W. Grimes
42bdaf7e8SRuslan Ermilov.include <bsd.init.mk>
5bd871f14SWarner Losh.include <bsd.compiler.mk>
6afe61c15SRodney W. Grimes
7e4195e2eSJonathan Anderson.SUFFIXES: .out .o .bc .c .cc .cpp .cxx .C .m .y .l .ll .ln .s .S .asm
8afe61c15SRodney W. Grimes
948aea4daSRuslan Ermilov# XXX The use of COPTS in modern makefiles is discouraged.
1041f89315SRuslan Ermilov.if defined(COPTS)
119b8d26fdSBryan Drewery.warning ${.CURDIR}: COPTS should be CFLAGS.
1241f89315SRuslan ErmilovCFLAGS+=${COPTS}
1341f89315SRuslan Ermilov.endif
1441f89315SRuslan Ermilov
154df1f59eSWarner Losh.if ${MK_ASSERT_DEBUG} == "no"
164df1f59eSWarner LoshCFLAGS+= -DNDEBUG
17e2e1ab1cSDavid E. O'BrienNO_WERROR=
184df1f59eSWarner Losh.endif
194df1f59eSWarner Losh
2041f89315SRuslan Ermilov.if defined(DEBUG_FLAGS)
2141f89315SRuslan ErmilovCFLAGS+=${DEBUG_FLAGS}
228eba8cd8SMarcel MoolenaarCXXFLAGS+=${DEBUG_FLAGS}
23770ac3b2SJohn Birrell
2483cb5baeSMax Khon.if ${MK_CTF} != "no" && ${DEBUG_FLAGS:M-g} != ""
25770ac3b2SJohn BirrellCTFFLAGS+= -g
26770ac3b2SJohn Birrell.endif
2741f89315SRuslan Ermilov.endif
2841f89315SRuslan Ermilov
2942f8c5b5SEd Maste.if defined(PROG_CXX)
3042f8c5b5SEd MastePROG=	${PROG_CXX}
3142f8c5b5SEd Maste.endif
3242f8c5b5SEd Maste
336e521732SEd Maste.if !empty(LDFLAGS:M-Wl,*--oformat,*) || !empty(LDFLAGS:M-static)
3442f8c5b5SEd MasteMK_DEBUG_FILES=	no
3542f8c5b5SEd Maste.endif
3642f8c5b5SEd Maste
37bf81eb3cSEd Maste# ELF hardening knobs
38bf81eb3cSEd Maste.if ${MK_BIND_NOW} != "no"
39bf81eb3cSEd MasteLDFLAGS+= -Wl,-znow
40bf81eb3cSEd Maste.endif
41*bcf99d2dSEd Maste.if ${MK_PIE} != "no" && \
42*bcf99d2dSEd Maste    !defined(NO_SHARED) || ${NO_SHARED} == "no" || ${NO_SHARED} == "NO"
43*bcf99d2dSEd MasteCFLAGS+= -fPIE
44*bcf99d2dSEd MasteCXXFLAGS+= -fPIE
45*bcf99d2dSEd MasteLDFLAGS+= -pie
46*bcf99d2dSEd Maste.endif
47fc191b11SEd Maste.if ${MK_RETPOLINE} != "no"
48fc191b11SEd MasteCFLAGS+= -mretpoline
49fc191b11SEd MasteCXXFLAGS+= -mretpoline
5014608708SEd Maste# retpolineplt is broken with static linking (PR 233336)
5114608708SEd Maste.if !defined(NO_SHARED) || ${NO_SHARED} == "no" || ${NO_SHARED} == "NO"
52fc191b11SEd MasteLDFLAGS+= -Wl,-zretpolineplt
53fc191b11SEd Maste.endif
5414608708SEd Maste.endif
55fc191b11SEd Maste
5641f89315SRuslan Ermilov.if defined(CRUNCH_CFLAGS)
573c9b8563SGordon TetlowCFLAGS+=${CRUNCH_CFLAGS}
5842f8c5b5SEd Maste.else
5942f8c5b5SEd Maste.if ${MK_DEBUG_FILES} != "no" && empty(DEBUG_FLAGS:M-g) && \
6042f8c5b5SEd Maste    empty(DEBUG_FLAGS:M-gdwarf-*)
61de6feefdSJohn BaldwinCFLAGS+= ${DEBUG_FILES_CFLAGS}
6242f8c5b5SEd MasteCTFFLAGS+= -g
6342f8c5b5SEd Maste.endif
6441f89315SRuslan Ermilov.endif
65afe61c15SRodney W. Grimes
66e82b0b99SJordan K. Hubbard.if !defined(DEBUG_FLAGS)
67afe61c15SRodney W. GrimesSTRIP?=	-s
68e82b0b99SJordan K. Hubbard.endif
69afe61c15SRodney W. Grimes
70dc6d22c9SBaptiste Daroussin.if defined(NO_ROOT)
71dc6d22c9SBaptiste Daroussin.if !defined(TAGS) || ! ${TAGS:Mpackage=*}
72dc6d22c9SBaptiste DaroussinTAGS+=		package=${PACKAGE:Uruntime}
73dc6d22c9SBaptiste Daroussin.endif
74dc6d22c9SBaptiste DaroussinTAG_ARGS=	-T ${TAGS:[*]:S/ /,/g}
75dc6d22c9SBaptiste Daroussin.endif
76dc6d22c9SBaptiste Daroussin
7783c7ade9SRuslan Ermilov.if defined(NO_SHARED) && (${NO_SHARED} != "no" && ${NO_SHARED} != "NO")
783585b293SGarrett WollmanLDFLAGS+= -static
793585b293SGarrett Wollman.endif
80afe61c15SRodney W. Grimes
8142f8c5b5SEd Maste.if ${MK_DEBUG_FILES} != "no"
8242f8c5b5SEd MastePROG_FULL=${PROG}.full
8342f8c5b5SEd Maste# Use ${DEBUGDIR} for base system debug files, else .debug subdirectory
8442f8c5b5SEd Maste.if defined(BINDIR) && (\
8542f8c5b5SEd Maste    ${BINDIR} == "/bin" ||\
865ea4b6d5SEd Maste    ${BINDIR:C%/libexec(/.*)?%/libexec%} == "/libexec" ||\
8742f8c5b5SEd Maste    ${BINDIR} == "/sbin" ||\
88b60371f8SEd Maste    ${BINDIR:C%/usr/(bin|bsdinstall|libexec|lpr|sendmail|sm.bin|sbin|tests)(/.*)?%/usr/bin%} == "/usr/bin" ||\
89b60371f8SEd Maste    ${BINDIR} == "/usr/lib" \
9042f8c5b5SEd Maste     )
9142f8c5b5SEd MasteDEBUGFILEDIR=	${DEBUGDIR}${BINDIR}
9242f8c5b5SEd Maste.else
9342f8c5b5SEd MasteDEBUGFILEDIR?=	${BINDIR}/.debug
94a324b0f0SBryan Drewery.endif
95a324b0f0SBryan Drewery.if !exists(${DESTDIR}${DEBUGFILEDIR})
9642f8c5b5SEd MasteDEBUGMKDIR=
9742f8c5b5SEd Maste.endif
9842f8c5b5SEd Maste.else
9942f8c5b5SEd MastePROG_FULL=	${PROG}
10047bf8a5cSRuslan Ermilov.endif
10147bf8a5cSRuslan Ermilov
102afe61c15SRodney W. Grimes.if defined(PROG)
103a0dc5970SEd MastePROGNAME?=	${PROG}
10442f8c5b5SEd Maste
105afe61c15SRodney W. Grimes.if defined(SRCS)
106afe61c15SRodney W. Grimes
1072506d700SSimon J. GerratyOBJS+=  ${SRCS:N*.h:${OBJS_SRCS_FILTER:ts:}:S/$/.o/g}
108afe61c15SRodney W. Grimes
1094f2fac37SJonathan Anderson# LLVM bitcode / textual IR representations of the program
1104f2fac37SJonathan AndersonBCOBJS+=${SRCS:N*.[hsS]:N*.asm:${OBJS_SRCS_FILTER:ts:}:S/$/.bco/g}
1114f2fac37SJonathan AndersonLLOBJS+=${SRCS:N*.[hsS]:N*.asm:${OBJS_SRCS_FILTER:ts:}:S/$/.llo/g}
1124f2fac37SJonathan Anderson
113c2c48445SRui Paulo.if target(beforelinking)
114593c0b49SMark Johnstonbeforelinking: ${OBJS}
11542f8c5b5SEd Maste${PROG_FULL}: beforelinking
116c2c48445SRui Paulo.endif
1175852ae2dSBryan Drewery${PROG_FULL}: ${OBJS}
1185d68012aSRuslan Ermilov.if defined(PROG_CXX)
1199160419cSBryan Drewery	${CXX:N${CCACHE_BIN}} ${CXXFLAGS:N-M*} ${LDFLAGS} -o ${.TARGET} \
1209160419cSBryan Drewery	    ${OBJS} ${LDADD}
1215d68012aSRuslan Ermilov.else
1229160419cSBryan Drewery	${CC:N${CCACHE_BIN}} ${CFLAGS:N-M*} ${LDFLAGS} -o ${.TARGET} ${OBJS} \
1239160419cSBryan Drewery	    ${LDADD}
1245d68012aSRuslan Ermilov.endif
12583cb5baeSMax Khon.if ${MK_CTF} != "no"
126cd49c2e8SMax Khon	${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${OBJS}
127cd49c2e8SMax Khon.endif
1285d68012aSRuslan Ermilov
12984aac273SHartmut Brandt.else	# !defined(SRCS)
130afe61c15SRodney W. Grimes
1315d68012aSRuslan Ermilov.if !target(${PROG})
13247bf8a5cSRuslan Ermilov.if defined(PROG_CXX)
13347bf8a5cSRuslan ErmilovSRCS=	${PROG}.cc
13447bf8a5cSRuslan Ermilov.else
135afe61c15SRodney W. GrimesSRCS=	${PROG}.c
13647bf8a5cSRuslan Ermilov.endif
137afe61c15SRodney W. Grimes
138a4c39c7aSBruce Evans# Always make an intermediate object file because:
139a4c39c7aSBruce Evans# - it saves time rebuilding when only the library has changed
140a4c39c7aSBruce Evans# - the name of the object gets put into the executable symbol table instead of
141a4c39c7aSBruce Evans#   the name of a variable temporary object.
142a4c39c7aSBruce Evans# - it's useful to keep objects around for crunching.
1437f7fc25bSMark JohnstonOBJS+=		${PROG}.o
1444f2fac37SJonathan AndersonBCOBJS+=	${PROG}.bc
1454f2fac37SJonathan AndersonLLOBJS+=	${PROG}.ll
1464f2fac37SJonathan AndersonCLEANFILES+=	${PROG}.o ${PROG}.bc ${PROG}.ll
147f5c75051SEivind Eklund
148c2c48445SRui Paulo.if target(beforelinking)
149593c0b49SMark Johnstonbeforelinking: ${OBJS}
15042f8c5b5SEd Maste${PROG_FULL}: beforelinking
151c2c48445SRui Paulo.endif
1525852ae2dSBryan Drewery${PROG_FULL}: ${OBJS}
153f8ba1555SRuslan Ermilov.if defined(PROG_CXX)
1549160419cSBryan Drewery	${CXX:N${CCACHE_BIN}} ${CXXFLAGS:N-M*} ${LDFLAGS} -o ${.TARGET} \
1559160419cSBryan Drewery	    ${OBJS} ${LDADD}
156f8ba1555SRuslan Ermilov.else
1579160419cSBryan Drewery	${CC:N${CCACHE_BIN}} ${CFLAGS:N-M*} ${LDFLAGS} -o ${.TARGET} ${OBJS} \
1589160419cSBryan Drewery	    ${LDADD}
159afe61c15SRodney W. Grimes.endif
16083cb5baeSMax Khon.if ${MK_CTF} != "no"
161cd49c2e8SMax Khon	${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${OBJS}
162cd49c2e8SMax Khon.endif
16342f8c5b5SEd Maste.endif # !target(${PROG})
164f5c75051SEivind Eklund
1650d947ed1SEd Maste.endif # !defined(SRCS)
166afe61c15SRodney W. Grimes
16742f8c5b5SEd Maste.if ${MK_DEBUG_FILES} != "no"
1685852ae2dSBryan Drewery${PROG}: ${PROG_FULL} ${PROGNAME}.debug
16942f8c5b5SEd Maste	${OBJCOPY} --strip-debug --add-gnu-debuglink=${PROGNAME}.debug \
17042f8c5b5SEd Maste	    ${PROG_FULL} ${.TARGET}
17142f8c5b5SEd Maste
1725852ae2dSBryan Drewery${PROGNAME}.debug: ${PROG_FULL}
17342f8c5b5SEd Maste	${OBJCOPY} --only-keep-debug ${PROG_FULL} ${.TARGET}
17442f8c5b5SEd Maste.endif
17542f8c5b5SEd Maste
176e4195e2eSJonathan Anderson.if defined(LLVM_LINK)
177e4195e2eSJonathan Anderson${PROG_FULL}.bc: ${BCOBJS}
178e4195e2eSJonathan Anderson	${LLVM_LINK} -o ${.TARGET} ${BCOBJS}
179e4195e2eSJonathan Anderson
180e4195e2eSJonathan Anderson${PROG_FULL}.ll: ${LLOBJS}
181e4195e2eSJonathan Anderson	${LLVM_LINK} -S -o ${.TARGET} ${LLOBJS}
182e4195e2eSJonathan Anderson
1836f6b66a8SJonathan AndersonCLEANFILES+=	${PROG_FULL}.bc ${PROG_FULL}.ll
184e4195e2eSJonathan Anderson.endif # defined(LLVM_LINK)
185e4195e2eSJonathan Anderson
186e1fe3dbaSRuslan Ermilov.if	${MK_MAN} != "no" && !defined(MAN) && \
187862d3deaSRuslan Ermilov	!defined(MAN1) && !defined(MAN2) && !defined(MAN3) && \
188afe61c15SRodney W. Grimes	!defined(MAN4) && !defined(MAN5) && !defined(MAN6) && \
1898b4f1f91SBrooks Davis	!defined(MAN7) && !defined(MAN8) && !defined(MAN9)
19019ea15a1SRuslan ErmilovMAN=	${PROG}.1
19119ea15a1SRuslan ErmilovMAN1=	${MAN}
192afe61c15SRodney W. Grimes.endif
1930d947ed1SEd Maste.endif # defined(PROG)
194afe61c15SRodney W. Grimes
1957750ad47SMarcel Moolenaar.if defined(_SKIP_BUILD)
1967750ad47SMarcel Moolenaarall:
1977750ad47SMarcel Moolenaar.else
1981bd4272fSBryan Dreweryall: ${PROG} ${SCRIPTS}
199e1fe3dbaSRuslan Ermilov.if ${MK_MAN} != "no"
200f1702f87SBryan Dreweryall: all-man
201862d3deaSRuslan Ermilov.endif
2027750ad47SMarcel Moolenaar.endif
203afe61c15SRodney W. Grimes
20441f89315SRuslan Ermilov.if defined(PROG)
205e4195e2eSJonathan AndersonCLEANFILES+= ${PROG} ${PROG}.bc ${PROG}.ll
20642f8c5b5SEd Maste.if ${MK_DEBUG_FILES} != "no"
2076f6b66a8SJonathan AndersonCLEANFILES+= ${PROG_FULL} ${PROGNAME}.debug
20842f8c5b5SEd Maste.endif
20941f89315SRuslan Ermilov.endif
21041f89315SRuslan Ermilov
21141f89315SRuslan Ermilov.if defined(OBJS)
212e4195e2eSJonathan AndersonCLEANFILES+= ${OBJS} ${BCOBJS} ${LLOBJS}
21341f89315SRuslan Ermilov.endif
214afe61c15SRodney W. Grimes
21551fa76c4SRuslan Ermilov.include <bsd.libnames.mk>
21651fa76c4SRuslan Ermilov
217218a2cd2SBruce Evans.if defined(PROG)
218799483e4SBryan Drewery.if !defined(NO_EXTRADEPEND)
219663e9677SBruce Evans_EXTRADEPEND:
22051fa76c4SRuslan Ermilov.if defined(LDFLAGS) && !empty(LDFLAGS:M-nostdlib)
22151fa76c4SRuslan Ermilov.if defined(DPADD) && !empty(DPADD)
22237fd8bc2SJohn Baldwin	echo ${PROG_FULL}: ${DPADD} >> ${DEPENDFILE}
22351fa76c4SRuslan Ermilov.endif
22451fa76c4SRuslan Ermilov.else
22537fd8bc2SJohn Baldwin	echo ${PROG_FULL}: ${LIBC} ${DPADD} >> ${DEPENDFILE}
2267273339dSWarner Losh.if defined(PROG_CXX)
22763e4d6f7SWarner Losh.if ${COMPILER_TYPE} == "clang" && empty(CXXFLAGS:M-stdlib=libstdc++)
22837fd8bc2SJohn Baldwin	echo ${PROG_FULL}: ${LIBCPLUSPLUS} >> ${DEPENDFILE}
229d515c63dSDimitry Andric.else
23037fd8bc2SJohn Baldwin	echo ${PROG_FULL}: ${LIBSTDCPLUSPLUS} >> ${DEPENDFILE}
231f8ba1555SRuslan Ermilov.endif
2328c05a446SPeter Wemm.endif
23351fa76c4SRuslan Ermilov.endif
234799483e4SBryan Drewery.endif	# !defined(NO_EXTRADEPEND)
235d515c63dSDimitry Andric.endif
236663e9677SBruce Evans
237afe61c15SRodney W. Grimes.if !target(install)
238afe61c15SRodney W. Grimes
239212acbefSRuslan Ermilov.if defined(PRECIOUSPROG)
24000fbd407SRuslan Ermilov.if !defined(NO_FSCHG)
241dee651ebSRuslan ErmilovINSTALLFLAGS+= -fschg
242dee651ebSRuslan Ermilov.endif
243212acbefSRuslan ErmilovINSTALLFLAGS+= -S
244212acbefSRuslan Ermilov.endif
245dee651ebSRuslan Ermilov
246e902c1bbSTim Vanderhoek_INSTALLFLAGS:=	${INSTALLFLAGS}
247e902c1bbSTim Vanderhoek.for ie in ${INSTALLFLAGS_EDIT}
248e902c1bbSTim Vanderhoek_INSTALLFLAGS:=	${_INSTALLFLAGS${ie}}
249e902c1bbSTim Vanderhoek.endfor
250e902c1bbSTim Vanderhoek
25151fa76c4SRuslan Ermilov.if !target(realinstall) && !defined(INTERNALPROG)
25287829387SRuslan Ermilovrealinstall: _proginstall
253badb7c1cSRuslan Ermilov.ORDER: beforeinstall _proginstall
25487829387SRuslan Ermilov_proginstall:
255afe61c15SRodney W. Grimes.if defined(PROG)
256dc6d22c9SBaptiste Daroussin	${INSTALL} ${TAG_ARGS} ${STRIP} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
25795f8c826SRuslan Ermilov	    ${_INSTALLFLAGS} ${PROG} ${DESTDIR}${BINDIR}/${PROGNAME}
25842f8c5b5SEd Maste.if ${MK_DEBUG_FILES} != "no"
25942f8c5b5SEd Maste.if defined(DEBUGMKDIR)
260b626f5a7SGlen Barber	${INSTALL} ${TAG_ARGS:D${TAG_ARGS},debug} -d ${DESTDIR}${DEBUGFILEDIR}/
26142f8c5b5SEd Maste.endif
262dc6d22c9SBaptiste Daroussin	${INSTALL} ${TAG_ARGS:D${TAG_ARGS},debug} -o ${BINOWN} -g ${BINGRP} -m ${DEBUGMODE} \
26342f8c5b5SEd Maste	    ${PROGNAME}.debug ${DESTDIR}${DEBUGFILEDIR}/${PROGNAME}.debug
26442f8c5b5SEd Maste.endif
26595f8c826SRuslan Ermilov.endif
26684aac273SHartmut Brandt.endif	# !target(realinstall)
267afe61c15SRodney W. Grimes
268f7ee8cfeSRuslan Ermilov.if defined(SCRIPTS) && !empty(SCRIPTS)
269f7ee8cfeSRuslan Ermilovrealinstall: _scriptsinstall
270badb7c1cSRuslan Ermilov.ORDER: beforeinstall _scriptsinstall
271f7ee8cfeSRuslan Ermilov
272f7ee8cfeSRuslan ErmilovSCRIPTSDIR?=	${BINDIR}
273f7ee8cfeSRuslan ErmilovSCRIPTSOWN?=	${BINOWN}
274f7ee8cfeSRuslan ErmilovSCRIPTSGRP?=	${BINGRP}
275f7ee8cfeSRuslan ErmilovSCRIPTSMODE?=	${BINMODE}
276f7ee8cfeSRuslan Ermilov
277116d4508SSimon J. GerratySTAGE_AS_SETS+= scripts
278116d4508SSimon J. Gerratystage_as.scripts: ${SCRIPTS}
279116d4508SSimon J. GerratyFLAGS.stage_as.scripts= -m ${SCRIPTSMODE}
280116d4508SSimon J. GerratySTAGE_FILES_DIR.scripts= ${STAGE_OBJTOP}
281f7ee8cfeSRuslan Ermilov.for script in ${SCRIPTS}
282f7ee8cfeSRuslan Ermilov.if defined(SCRIPTSNAME)
283f7ee8cfeSRuslan ErmilovSCRIPTSNAME_${script:T}?=	${SCRIPTSNAME}
284f7ee8cfeSRuslan Ermilov.else
285f7ee8cfeSRuslan ErmilovSCRIPTSNAME_${script:T}?=	${script:T:R}
286f7ee8cfeSRuslan Ermilov.endif
287f7ee8cfeSRuslan ErmilovSCRIPTSDIR_${script:T}?=	${SCRIPTSDIR}
288f7ee8cfeSRuslan ErmilovSCRIPTSOWN_${script:T}?=	${SCRIPTSOWN}
289f7ee8cfeSRuslan ErmilovSCRIPTSGRP_${script:T}?=	${SCRIPTSGRP}
290f7ee8cfeSRuslan ErmilovSCRIPTSMODE_${script:T}?=	${SCRIPTSMODE}
291116d4508SSimon J. GerratySTAGE_AS_${script:T}=		${SCRIPTSDIR_${script:T}}/${SCRIPTSNAME_${script:T}}
292a7aaf57eSRuslan Ermilov_scriptsinstall: _SCRIPTSINS_${script:T}
293a7aaf57eSRuslan Ermilov_SCRIPTSINS_${script:T}: ${script}
294dc6d22c9SBaptiste Daroussin	${INSTALL} ${TAG_ARGS} -o ${SCRIPTSOWN_${.ALLSRC:T}} \
295f7ee8cfeSRuslan Ermilov	    -g ${SCRIPTSGRP_${.ALLSRC:T}} -m ${SCRIPTSMODE_${.ALLSRC:T}} \
2964367bda6SRuslan Ermilov	    ${.ALLSRC} \
297f7ee8cfeSRuslan Ermilov	    ${DESTDIR}${SCRIPTSDIR_${.ALLSRC:T}}/${SCRIPTSNAME_${.ALLSRC:T}}
298f7ee8cfeSRuslan Ermilov.endfor
299f7ee8cfeSRuslan Ermilov.endif
300f7ee8cfeSRuslan Ermilov
3018479adc1SRuslan ErmilovNLSNAME?=	${PROG}
3028479adc1SRuslan Ermilov.include <bsd.nls.mk>
3038479adc1SRuslan Ermilov
3049b4f4918SBaptiste Daroussin.include <bsd.confs.mk>
305af2dc868SRuslan Ermilov.include <bsd.files.mk>
3065d862037SRuslan Ermilov.include <bsd.incs.mk>
307fa8c921eSBrooks Davis
308fa8c921eSBrooks DavisLINKOWN?=	${BINOWN}
309fa8c921eSBrooks DavisLINKGRP?=	${BINGRP}
310fa8c921eSBrooks DavisLINKMODE?=	${BINMODE}
31184f94a79SRuslan Ermilov.include <bsd.links.mk>
312c7b111cbSRuslan Ermilov
313e1fe3dbaSRuslan Ermilov.if ${MK_MAN} != "no"
314f1702f87SBryan Dreweryrealinstall: maninstall
315f1702f87SBryan Drewery.ORDER: beforeinstall maninstall
31687829387SRuslan Ermilov.endif
31787829387SRuslan Ermilov
318abb02fa2SBryan Drewery.endif	# !target(install)
319afe61c15SRodney W. Grimes
320e1fe3dbaSRuslan Ermilov.if ${MK_MAN} != "no"
321afe61c15SRodney W. Grimes.include <bsd.man.mk>
32269b87d3eSEivind Eklund.endif
32369b87d3eSEivind Eklund
32438f8fddfSEnji Cooper.if defined(HAS_TESTS)
32538f8fddfSEnji CooperMAKE+=			MK_MAKE_CHECK_USE_SANDBOX=yes
32638f8fddfSEnji CooperSUBDIR_TARGETS+=	check
32738f8fddfSEnji CooperTESTS_LD_LIBRARY_PATH+=	${.OBJDIR}
32838f8fddfSEnji CooperTESTS_PATH+=		${.OBJDIR}
32938f8fddfSEnji Cooper.endif
33038f8fddfSEnji Cooper
331d7beff08SBryan Drewery.if defined(PROG)
332d7beff08SBryan DreweryOBJS_DEPEND_GUESS+= ${SRCS:M*.h}
33388fe1f7aSBryan Drewery.endif
33488fe1f7aSBryan Drewery
33588fe1f7aSBryan Drewery.include <bsd.dep.mk>
336aae63957SBryan Drewery.include <bsd.clang-analyze.mk>
337cd9a2f5cSJordan K. Hubbard.include <bsd.obj.mk>
338d510ecb4SKris Kennaway.include <bsd.sys.mk>
339