1 # $NetBSD: bsd.prog.mk,v 1.292 2015/06/07 15:04:28 matt Exp $
2 # @(#)bsd.prog.mk 8.2 (Berkeley) 4/2/94
7 .
include <bsd.shlib.mk
>
9 .
include <minix.gcov.mk
>
12 # Definitions and targets shared among all programs built by a single
17 realinstall
: proginstall scriptsinstall
21 .if defined
(DESTDIR
) && !empty
(DESTDIR
)
22 echo
"set solib-absolute-prefix ${DESTDIR}" > .gdbinit
26 .for __gdbinit in
${GDBINIT}
27 echo
"source ${__gdbinit}" >> .gdbinit
30 CLEANFILES
+= a.out
[Ee
]rrs mklog core
*.core .gdbinit
32 .if defined
(SHAREDSTRINGS
)
35 ${CC} -E
${CPPFLAGS} ${CFLAGS} ${.IMPSRC
} | xstr
-c
-
36 @
${CC} ${CPPFLAGS} ${CFLAGS} -c x.c
-o
${.TARGET
}
37 .if defined
(CTFCONVERT
)
38 ${CTFCONVERT} ${CTFFLAGS} ${.TARGET
}
42 .
cc.o .
cpp.o .
cxx.o .C.o
:
43 ${CXX} -E
${CPPFLAGS} ${CXXFLAGS} ${.IMPSRC
} | xstr
-c
-
45 @
${CXX} ${CPPFLAGS} ${CXXFLAGS} -c x.
cc -o
${.TARGET
}
46 .if defined
(CTFCONVERT
)
47 ${CTFCONVERT} ${CTFFLAGS} ${.TARGET
}
52 .if defined
(MKPIE
) && (${MKPIE} != "no")
53 CFLAGS
+= ${PIE_CFLAGS}
54 AFLAGS
+= ${PIE_AFLAGS}
55 LDFLAGS
+= ${PIE_LDFLAGS}
59 .if defined
(MKDEBUG
) && (${MKDEBUG} != "no")
62 OBJCFLAGS
+= ${OBJCOPTS}
63 MKDEP_SUFFIXES?
= .o .ln .d
65 # CTF preserve debug symbols
66 .if
(${MKCTF
:Uno
} != "no") && (${CFLAGS
:M-g
} != "")
69 .if defined
(HAVE_GCC
) && ${HAVE_GCC} >= 48
74 # ELF platforms depend on crti.o, crtbegin.o, crtend.o, and crtn.o
76 LIBCRTBEGIN
= ${DESTDIR}/usr
/lib
/${MLIBDIR
:D
${MLIBDIR}/}crti.o
${_GCC_CRTBEGIN}
80 LIBCRTEND
= ${_GCC_CRTEND} ${DESTDIR}/usr
/lib
/${MLIBDIR
:D
${MLIBDIR}/}crtn.o
83 _SHLINKER
= ${SHLINKDIR}/ld.elf_so
86 LIBCRT0
= ${DESTDIR}/usr
/lib
/${MLIBDIR
:D
${MLIBDIR}/}crt0.o
91 LIBCRTI
= ${DESTDIR}/usr
/lib
/${MLIBDIR
:D
${MLIBDIR}/}crti.o
95 ##### Installed system library definitions
98 # LIBC?=${DESTDIR}/usr/lib/libc.a
99 # LIBX11?=${DESTDIR}/usr/X11R7/lib/libX11.a
101 # NB: If you are a library here, add it in bsd.README
209 .
ifndef LIB
${_lib
:tu
}
210 LIB
${_lib
:tu
}= ${DESTDIR}/usr
/lib
/lib
${_lib
:S
/xx
/++/:S
/atf_c
/atf-c
/}.a
211 .MADE
: ${LIB
${_lib
:tu
}} # Note: ${DESTDIR} will be expanded
247 .
ifndef LIB
${_lib
:tu
}
248 LIB
${_lib
:tu
}= ${DESTDIR}/usr
/lib
/lib
${_lib
:S
/xx
/++/:S
/atf_c
/atf-c
/}.a
249 .MADE
: ${LIB
${_lib
:tu
}} # Note: ${DESTDIR} will be expanded
253 # PAM applications, if linked statically, need more libraries
254 .if
(${MKPIC} == "no")
255 .if
(${MKCRYPTO} != "no")
256 PAM_STATIC_LDADD
+= -lssh
257 PAM_STATIC_DPADD
+= ${LIBSSH}
259 .if
(${MKKERBEROS} != "no")
260 PAM_STATIC_LDADD
+= -lkafs
-lkrb5
-lhx509
-lwind
-lasn1 \
261 -lroken
-lcom_err
-lheimbase
-lcrypto
262 PAM_STATIC_DPADD
+= ${LIBKAFS} ${LIBKRB5} ${LIBHX509} ${LIBWIND} ${LIBASN1} \
263 ${LIBROKEN} ${LIBCOM_ERR} ${LIBHEIMBASE} ${LIBCRYPTO}
265 .if
(${MKSKEY} != "no")
266 PAM_STATIC_LDADD
+= -lskey
267 PAM_STATIC_DPADD
+= ${LIBSKEY}
269 PAM_STATIC_LDADD
+= -lradius
-lcrypt
-lrpcsvc
-lutil
270 PAM_STATIC_DPADD
+= ${LIBRADIUS} ${LIBCRYPT} ${LIBRPCSVC} ${LIBUTIL}
276 .if defined
(__MINIX
) && ${MACHINE_ARCH} == "earm"
277 # LSC: On ARM, when compiling statically, with gcc, lgcc_eh is required
278 LDFLAGS
+= ${${ACTIVE_CC} == "gcc":?
-lgcc_eh
:}
279 .
endif # defined(__MINIX) && ${MACHINE_ARCH} == "earm"
281 # NB: If you are a library here, add it in bsd.README
318 .
ifndef LIB
${_lib
:tu
}
319 LIB
${_lib
:tu
}= ${DESTDIR}${X11USRLIBDIR}/lib
${_lib}.a
320 .MADE
: ${LIB
${_lib
:tu
}} # Note: ${DESTDIR} will be expanded
325 LIBX11_XCB
= ${DESTDIR}${X11USRLIBDIR}/libX11-xcb.a
326 LIBXCB
= ${DESTDIR}${X11USRLIBDIR}/libxcb.a
328 .if defined
(RESCUEDIR
)
329 CPPFLAGS
+= -DRESCUEDIR
=\"${RESCUEDIR}\"
333 .if
${SHLINKDIR} != "/usr/libexec" # XXX: change or remove if ld.so moves
334 _PROGLDOPTS
+= -Wl
,-dynamic-linker
=${_SHLINKER}
336 .if
${SHLIBDIR} != "/usr/lib"
337 _PROGLDOPTS
+= -Wl
,-rpath
,${SHLIBDIR} \
339 .elif
${SHLIBINSTALLDIR} != "/usr/lib"
340 _PROGLDOPTS
+= -Wl
,-rpath-link
,${DESTDIR}${SHLIBINSTALLDIR} \
341 -L
=${SHLIBINSTALLDIR}
346 ${INSTALL_FILE} -o
${BINOWN} -g
${BINGRP} -m
${BINMODE} \
347 ${STRIPFLAG} ${.ALLSRC
} ${.TARGET
}
349 __progrumpinstall
: .USE
351 ${INSTALL_FILE} -o
${RUMPBINOWN} -g
${RUMPBINGRP} -m
${RUMPBINMODE} \
352 ${STRIPFLAG} ${.ALLSRC
} ${.TARGET
}
354 __progdebuginstall
: .USE
356 ${INSTALL_FILE} -o
${DEBUGOWN} -g
${DEBUGGRP} -m
${DEBUGMODE} \
357 ${.ALLSRC
} ${.TARGET
}
362 # Backwards compatibility with Makefiles that assume that bsd.prog.mk
363 # can only build a single binary.
371 .if defined
(PROG_CXX
)
373 _CCLINK
= ${CXX} ${_CCLINKFLAGS}
376 # BJG - stack unwinding (for C++ exceptions) doesn't work on static executables when built with llvm.
378 .
endif # defined(__MINIX)
383 .
ifndef CRUNCHEDPROG
384 . if
(${MKRUMP} != "no")
385 PROGS
= ${RUMPPRG} rump.
${RUMPPRG}
390 . if
(${MKRUMP} != "no")
391 SRCS.rump.
${PROG}:= ${SRCS} ${PROG}_rumpops.c
${RUMPSRCS}
393 SRCS
+= ${PROG}_hostops.c
395 SRCS
= ${PROG}.c
${PROG}_hostops.c
396 . if
(${MKRUMP} != "no")
397 SRCS.rump.
${PROG}= ${PROG}.c
${PROG}_rumpops.c
${RUMPSRCS}
400 . if
(${MKRUMP} != "no")
401 DPSRCS
+= ${PROG}_rumpops.c
${RUMPSRCS}
402 LDADD.rump.
${PROG}+= -lrumpclient
403 DPADD.rump.
${PROG}+= ${LIBRUMPCLIENT}
404 MAN.rump.
${PROG}= # defined but feeling empty
405 _RUMPINSTALL.rump.
${PROG}=# defined
407 .
else # CRUNCHEDPROG
409 CPPFLAGS
+= -DCRUNCHOPS
414 _CCLINK?
= ${CC} ${_CCLINKFLAGS}
420 OBJS
= ${OBJS.
${PROG}}
422 . if defined
(PROGNAME
)
423 PROGNAME.
${PROG}= ${PROGNAME}
426 SRCS.
${PROG}= ${SRCS}
431 # Turn the single-program PROG and PROG_CXX variables into their multi-word
432 # counterparts, PROGS and PROGS_CXX.
433 .if
!defined
(RUMPPRG
)
434 . if defined
(PROG_CXX
) && !defined
(PROGS_CXX
)
435 PROGS_CXX
= ${PROG_CXX}
436 . elif defined
(PROG
) && !defined
(PROGS
)
441 ##### Libraries that this may depend upon.
442 .if defined
(PROGDPLIBS
) # {
443 .for _lib _dir in
${PROGDPLIBS}
444 .if
!defined
(BINDO.
${_lib})
445 PROGDO.
${_lib}!= cd
"${_dir}" && ${PRINTOBJDIR}
446 .MAKEOVERRIDES
+=PROGDO.
${_lib}
448 LDADD
+= -L
${PROGDO.
${_lib}} -l
${_lib}
449 .if exists
(${PROGDO.
${_lib}}/lib
${_lib}_pic.a
)
450 DPADD
+= ${PROGDO.
${_lib}}/lib
${_lib}_pic.a
451 .elif exists
(${PROGDO.
${_lib}}/lib
${_lib}.so
)
452 DPADD
+= ${PROGDO.
${_lib}}/lib
${_lib}.so
454 DPADD
+= ${PROGDO.
${_lib}}/lib
${_lib}.a
459 # Per-program definitions and targets.
462 _CCLINK.CDEFAULT
= ${CC} ${_CCLINKFLAGS}
463 # Definitions specific to C programs.
466 _CCLINK.
${_P}= ${CC} ${_CCLINKFLAGS}
467 _CFLAGS.
${_P}= ${CFLAGS} ${CPUFLAGS}
468 _CPPFLAGS.
${_P}= ${CPPFLAGS}
469 _COPTS.
${_P}= ${COPTS}
472 _CCLINK.CXXDEFAULT
= ${CXX} ${_CCLINKFLAGS}
473 # Definitions specific to C++ programs.
474 .for _P in
${PROGS_CXX}
475 SRCS.
${_P}?
= ${_P}.
cc
476 _CCLINK.
${_P}= ${CXX} ${_CCLINKFLAGS}
479 # Language-independent definitions.
481 .if
${USE_BITCODE
:Uno
} == "yes"
483 .
endif # ${USE_BITCODE:Uno} == "yes"
485 .if
${USE_BITCODE
:Uyes
} == "no"
486 #LSC Gold linker seems to require the library directory to be set up if
487 # a sysroot parameter has been given.
488 LDFLAGS
+= -L
${DESTDIR}/usr
/lib
489 .
endif # ${USE_BITCODE:U} == "no"
490 .
endif # defined(__MINIX)
492 .for _P in
${PROGS} ${PROGS_CXX} # {
494 BINDIR.
${_P}?
= ${BINDIR}
495 PROGNAME.
${_P}?
= ${_P}
497 .if
${MKDEBUG} != "no" && !commands
(${_P})
498 _PROGDEBUG.
${_P}:= ${PROGNAME.
${_P}}.debug
501 .if defined
(PAXCTL_FLAGS
)
502 PAXCTL_FLAGS.
${_P}?
= ${PAXCTL_FLAGS}
505 ##### PROG specific flags.
507 _DPADD.
${_P}= ${DPADD} ${DPADD.
${_P}}
508 _LDADD.
${_P}= ${LDADD} ${LDADD.
${_P}}
509 _LDFLAGS.
${_P}= ${LDFLAGS} ${LDFLAGS.
${_P}}
510 _LDSTATIC.
${_P}= ${LDSTATIC} ${LDSTATIC.
${_P}}
512 ##### Build and install rules
513 .if
!empty
(_APPEND_SRCS
:M
[Yy
][Ee
][Ss
])
514 SRCS
+= ${SRCS.
${_P}} # For bsd.dep.mk
517 _YPSRCS.
${_P}= ${SRCS.
${_P}:M
*.
[ly
]:C
/\..
$/.c
/} ${YHEADER
:D
${SRCS.
${_P}:M
*.y
:.y
=.h
}}
519 DPSRCS
+= ${_YPSRCS.
${_P}}
520 CLEANFILES
+= ${_YPSRCS.
${_P}}
522 .if
!empty
(SRCS.
${_P}:N
*.h
:N
*.sh
:N
*.fth
)
523 OBJS.
${_P}+= ${SRCS.
${_P}:N
*.h
:N
*.sh
:N
*.fth
:R
:S
/$/.o
/g
}
524 LOBJS.
${_P}+= ${LSRCS
:.c
=.ln
} ${SRCS.
${_P}:M
*.c
:.c
=.ln
}
527 .if defined
(OBJS.
${_P}) && !empty
(OBJS.
${_P}) # {
528 .NOPATH
: ${OBJS.
${_P}} ${_P} ${_YPSRCS.
${_P}}
530 .if
(defined
(USE_COMBINE
) && ${USE_COMBINE} != "no" && !commands
(${_P}) \
531 && (${_CCLINK.
${_P}} == ${_CCLINK.CDEFAULT
} \
532 ||
${_CCLINK.
${_P}} == ${_CCLINK.CXXDEFAULT
}) \
533 && !defined
(NOCOMBINE.
${_P}) && !defined
(NOCOMBINE
))
534 .for f in
${SRCS.
${_P}:N
*.h
:N
*.sh
:N
*.fth
:C
/\.
[yl
]$/.c
/g
}
535 #_XFLAGS.$f := ${CPPFLAGS.$f:D1} ${CPUFLAGS.$f:D2} \
536 # ${COPTS.$f:D3} ${OBJCOPTS.$f:D4} ${CXXFLAGS.$f:D5}
537 .if
(${CPPFLAGS.
$f:D1
} == "1" ||
${CPUFLAGS.
$f:D2
} == "2" \
538 ||
${COPTS.
$f:D3
} == "3" ||
${OBJCOPTS.
$f:D4
} == "4" \
539 ||
${CXXFLAGS.
$f:D5
} == "5") \
540 ||
("${f:M*.[cyl]}" == "" || commands
(${f
:R
:S
/$/.o
/}))
541 XOBJS.
${_P}+= ${f
:R
:S
/$/.o
/}
548 ${_P}: .gdbinit
${LIBCRT0} ${LIBCRTI} ${XOBJS.
${_P}} ${SRCS.
${_P}} \
549 ${DPSRCS} ${LIBC} ${LIBCRTBEGIN} ${LIBCRTEND} ${_DPADD.
${_P}}
552 ${_CCLINK.
${_P}} -Wl
,-nostdlib \
553 ${_LDFLAGS.
${_P}} ${_LDSTATIC.
${_P}} -o
${.TARGET
} ${_PROGLDOPTS} \
554 -B
${_GCC_CRTDIR}/ -B
${DESTDIR}/usr
/lib
/ \
555 -MD
--combine
${_CPPFLAGS.
${_P}} ${_CFLAGS.
${_P}} ${_COPTS.
${_P}} \
556 ${XSRCS.
${_P}:@.SRC.@
${.ALLSRC
:M
*.c
:M
*${.SRC.
}}@
:O
:u
} ${XOBJS.
${_P}} \
557 ${_LDADD.
${_P}} -L
${_GCC_LIBGCCDIR} -L
${DESTDIR}/usr
/lib
559 ${_CCLINK.
${_P}} ${_LDFLAGS.
${_P}} ${_LDSTATIC.
${_P}} -o
${.TARGET
} ${_PROGLDOPTS} \
560 -MD
--combine
${_CPPFLAGS.
${_P}} ${_COPTS.
${_P}}
561 ${XSRCS.
${_P}:@.SRC.@
${.ALLSRC
:M
*.c
:M
*${.SRC.
}}@
:O
:u
} ${XOBJS.
${_P}} \
563 .
endif # defined(DESTDIR)
564 .if defined
(CTFMERGE
)
565 ${CTFMERGE} ${CTFMFLAGS} -o
${.TARGET
} ${OBJS.
${_P}}
567 .if defined
(PAXCTL_FLAGS.
${_P})
568 ${PAXCTL} ${PAXCTL_FLAGS.
${_P}} ${.TARGET
}
570 .if
${MKSTRIPIDENT} != "no"
571 ${OBJCOPY} -R .ident
${.TARGET
}
576 .
include "${_P}.d" # include -MD depend for program.
580 ${OBJS.
${_P}} ${LOBJS.
${_P}}: ${DPSRCS}
582 .if defined
(__MINIX
) && ${USE_BITCODE
:Uno
} == "yes"
583 CLEANFILES
+= ${_P}.opt.bcl
${_P}.bcl
${_P}.bcl.o
585 OPTFLAGS.
${_P}?
= ${OPTFLAGS}
586 BITCODE_LD_FLAGS_1ST.
${_P}+= ${BITCODE_LD_FLAGS_1ST}
587 BITCODE_LD_FLAGS_2ND.
${_P}+= ${BITCODE_LD_FLAGS_2ND}
589 ${_P}.bcl
: .gdbinit
${LIBCRT0} ${LIBCRTI} ${OBJS.
${_P}} ${LIBC} ${LIBCRTBEGIN} \
590 ${LIBCRTEND} ${_DPADD.
${_P}}
595 -L
${DESTDIR}/usr
/lib
/bc \
596 ${OBJS.
${_P}} ${LLVM_LINK_ARGS} ${_LDADD.
${_P}:N-shared
} \
597 ${_LDSTATIC.
${_P}} ${_PROGLDOPTS} \
599 ${BITCODE_LD_FLAGS_1ST.
${_P}} \
600 -Wl
,-plugin-opt
=emit-llvm
602 ${_P}.opt.bcl
: ${_P}.bcl
${LLVM_PASS}
604 ${OPT} ${OPTFLAGS.
${_P}} -o
${.TARGET
} ${_P}.bcl
606 ${_P}.bcl.o
: ${_P}.opt.bcl
608 ${LLC} -O1
-march
=x86
-mcpu
=i586
-filetype
=obj
-o
${.TARGET
} ${.ALLSRC
}
615 -L
${DESTDIR}/usr
/lib \
616 ${_LDSTATIC.
${_P}} -o
${.TARGET
} \
617 ${.TARGET
}.bcl.o
${_PROGLDOPTS} ${_LDADD.
${_P}} \
618 ${BITCODE_LD_FLAGS_2ND.
${_P}} \
619 -Wl
,--allow-multiple-definition
620 .
endif # !commands(${_P})
623 ${_P}: .gdbinit
${LIBCRT0} ${LIBCRTI} ${OBJS.
${_P}} ${LIBC} ${LIBCRTBEGIN} \
624 ${LIBCRTEND} ${_DPADD.
${_P}}
628 ${_LDFLAGS.
${_P}} ${_LDSTATIC.
${_P}} -o
${.TARGET
} \
629 ${OBJS.
${_P}} ${_PROGLDOPTS} ${_LDADD.
${_P}}
630 .if defined
(CTFMERGE
)
631 ${CTFMERGE} ${CTFMFLAGS} -o
${.TARGET
} ${OBJS.
${_P}}
633 .if defined
(PAXCTL_FLAGS.
${_P})
634 ${PAXCTL} ${PAXCTL_FLAGS.
${_P}} ${.TARGET
}
636 .if
${MKSTRIPIDENT} != "no"
637 ${OBJCOPY} -R .ident
${.TARGET
}
639 .
endif # !commands(${_P})
640 .
endif # defined(__MINIX) && ${USE_BITCODE:Uno} == "yes"
643 ${_P}.ro
: ${OBJS.
${_P}} ${_DPADD.
${_P}}
645 ${CC} ${LDFLAGS
:N-Wl
,-pie
} -nostdlib
-r
-Wl
,-dc
-o
${.TARGET
} ${OBJS.
${_P}}
647 .if defined
(_PROGDEBUG.
${_P})
648 ${_PROGDEBUG.
${_P}}: ${_P}
650 ( ${OBJCOPY} --only-keep-debug
${_P} ${_PROGDEBUG.
${_P}} \
651 && ${OBJCOPY} --strip-debug
-p
-R .gnu_debuglink \
652 --add-gnu-debuglink
=${_PROGDEBUG.
${_P}} ${_P} \
653 ) ||
(rm -f
${_PROGDEBUG.
${_P}}; false
)
656 .
endif # defined(OBJS.${_P}) && !empty(OBJS.${_P}) # }
658 .if
!defined
(MAN.
${_P})
660 .
endif # !defined(MAN.${_P})
661 .if
!empty
(_APPEND_MANS
:M
[Yy
][Ee
][Ss
])
665 realall
: ${_P} ${_PROGDEBUG.
${_P}}
667 CLEANFILES
+= ${_P} ${_PROGDEBUG.
${_P}}
669 .if defined
(OBJS.
${_P}) && !empty
(OBJS.
${_P})
670 CLEANFILES
+= ${OBJS.
${_P}} ${LOBJS.
${_P}}
673 _PROG_INSTALL
+= proginstall-
${_P}
675 .if
!target
(proginstall-
${_P}) # {
676 proginstall-
${_P}:: ${DESTDIR}${BINDIR.
${_P}}/${PROGNAME.
${_P}} \
677 ${_PROGDEBUG.
${_P}:D
${DESTDIR}${DEBUGDIR}${BINDIR.
${_P}}/${_PROGDEBUG.
${_P}}}
678 .PRECIOUS
: ${DESTDIR}${BINDIR.
${_P}}/${PROGNAME.
${_P}} \
679 ${_PROGDEBUG.
${_P}:D
${DESTDIR}${DEBUGDIR}${BINDIR.
${_P}}/${_PROGDEBUG.
${_P}}}
681 .if
${MKUPDATE} == "no"
682 .if defined
(_RUMPINSTALL.
${_P})
683 ${DESTDIR}${BINDIR.
${_P}}/${PROGNAME.
${_P}}! ${_P} __progrumpinstall
685 ${DESTDIR}${BINDIR.
${_P}}/${PROGNAME.
${_P}}! ${_P} __proginstall
687 .if
!defined
(BUILD
) && !make
(all) && !make
(${_P})
688 ${DESTDIR}${BINDIR.
${_P}}/${PROGNAME.
${_P}}! .MADE
690 .if defined
(_PROGDEBUG.
${_P})
691 ${DESTDIR}${DEBUGDIR}${BINDIR.
${_P}}/${_PROGDEBUG.
${_P}}! ${_PROGDEBUG.
${_P}} __progdebuginstall
692 .if
!defined
(BUILD
) && !make
(all) && !make
(${_P})
693 ${DESTDIR}${DEBUGDIR}${BINDIR.
${_P}}/${_PROGDEBUG.
${_P}}! .MADE
695 .
endif # define(_PROGDEBUG.${_P})
696 .
else # MKUPDATE != no
697 .if defined
(_RUMPINSTALL.
${_P})
698 ${DESTDIR}${BINDIR.
${_P}}/${PROGNAME.
${_P}}: ${_P} __progrumpinstall
700 ${DESTDIR}${BINDIR.
${_P}}/${PROGNAME.
${_P}}: ${_P} __proginstall
702 .if
!defined
(BUILD
) && !make
(all) && !make
(${_P})
703 ${DESTDIR}${BINDIR.
${_P}}/${PROGNAME.
${_P}}: .MADE
705 .if defined
(_PROGDEBUG.
${_P})
706 ${DESTDIR}${DEBUGDIR}${BINDIR.
${_P}}/${_PROGDEBUG.
${_P}}: ${_PROGDEBUG.
${_P}} __progdebuginstall
707 .if
!defined
(BUILD
) && !make
(all) && !make
(${_P})
708 ${DESTDIR}${DEBUGDIR}${BINDIR.
${_P}}/${_PROGDEBUG.
${_P}}: .MADE
710 .
endif # defined(_PROGDEBUG.${_P})
711 .
endif # MKUPDATE != no
713 .
endif # !target(proginstall-${_P}) # }
716 lint-
${_P}: ${LOBJS.
${_P}}
717 .if defined
(LOBJS.
${_P}) && !empty
(LOBJS.
${_P})
718 ${LINT} ${LINTFLAGS} ${_LDFLAGS.
${_P}:C
/-L
[ ]*/-L
/Wg
:M-L
*} ${LOBJS.
${_P}} ${_LDADD.
${_P}}
721 .endfor
# _P in ${PROGS} ${PROGS_CXX} # }
723 .if defined
(OBJS
) && !empty
(OBJS
) && \
724 (empty
(PROGS
) && empty
(PROGS_CXX
))
725 CLEANFILES
+= ${OBJS} ${LOBJS}
728 .if
!target
(proginstall
)
729 proginstall
:: ${_PROG_INSTALL}
736 .if defined
(SCRIPTS
) && !target
(scriptsinstall
) # {
737 SCRIPTSDIR?
=${BINDIR}
738 SCRIPTSOWN?
=${BINOWN}
739 SCRIPTSGRP?
=${BINGRP}
740 SCRIPTSMODE?
=${BINMODE}
742 scriptsinstall
:: ${SCRIPTS
:@S@
${DESTDIR}${SCRIPTSDIR_
${S}:U
${SCRIPTSDIR}}/${SCRIPTSNAME_
${S}:U
${SCRIPTSNAME
:U
${S
:T
:R
}}}@
}
743 .PRECIOUS
: ${SCRIPTS
:@S@
${DESTDIR}${SCRIPTSDIR_
${S}:U
${SCRIPTSDIR}}/${SCRIPTSNAME_
${S}:U
${SCRIPTSNAME
:U
${S
:T
:R
}}}@
}
745 __scriptinstall
: .USE
748 -o
${SCRIPTSOWN_
${.ALLSRC
:T
}:U
${SCRIPTSOWN}} \
749 -g
${SCRIPTSGRP_
${.ALLSRC
:T
}:U
${SCRIPTSGRP}} \
750 -m
${SCRIPTSMODE_
${.ALLSRC
:T
}:U
${SCRIPTSMODE}} \
751 ${.ALLSRC
} ${.TARGET
}
753 .for S in
${SCRIPTS
:O
:u
}
754 .if
${MKUPDATE} == "no"
755 ${DESTDIR}${SCRIPTSDIR_
${S}:U
${SCRIPTSDIR}}/${SCRIPTSNAME_
${S}:U
${SCRIPTSNAME
:U
${S
:T
:R
}}}! ${S} __scriptinstall
756 .if
!defined
(BUILD
) && !make
(all) && !make
(${S})
757 ${DESTDIR}${SCRIPTSDIR_
${S}:U
${SCRIPTSDIR}}/${SCRIPTSNAME_
${S}:U
${SCRIPTSNAME
:U
${S
:T
:R
}}}! .MADE
760 ${DESTDIR}${SCRIPTSDIR_
${S}:U
${SCRIPTSDIR}}/${SCRIPTSNAME_
${S}:U
${SCRIPTSNAME
:U
${S
:T
:R
}}}: ${S} __scriptinstall
761 .if
!defined
(BUILD
) && !make
(all) && !make
(${S})
762 ${DESTDIR}${SCRIPTSDIR_
${S}:U
${SCRIPTSDIR}}/${SCRIPTSNAME_
${S}:U
${SCRIPTSNAME
:U
${S
:T
:R
}}}: .MADE
768 .if
!target
(scriptsinstall
)
771 .PHONY
: scriptsinstall
773 ##### Pull in related .mk logic
776 LINKSMODE?
= ${BINMODE}
777 .
include <bsd.man.mk
>
778 .
include <bsd.nls.mk
>
779 .
include <bsd.files.mk
>
780 .
include <bsd.inc.mk
>
781 .
include <bsd.links.mk
>
782 .
include <bsd.sys.mk
>
783 .
include <bsd.dep.mk
>
784 .
include <bsd.clang-analyze.mk
>
785 .
include <bsd.
clean.mk
>
787 ${TARGETS}: # ensure existence