Deleted Added
full compact
2c2
< # $FreeBSD: head/share/mk/bsd.prog.mk 248753 2013-03-26 20:32:46Z emaste $
---
> # $FreeBSD: head/share/mk/bsd.prog.mk 251512 2013-06-07 21:40:02Z emaste $
26a27,36
> .if defined(PROG_CXX)
> PROG= ${PROG_CXX}
> .endif
>
> .if defined(PROG) && target(${PROG})
> MK_DEBUG_FILES= no
> .elif !empty(LDFLAGS:M-Wl,*--oformat,*) || !empty(LDFLAGS:M-static)
> MK_DEBUG_FILES= no
> .endif
>
28a39,43
> .else
> .if ${MK_DEBUG_FILES} != "no" && empty(DEBUG_FLAGS:M-g) && \
> empty(DEBUG_FLAGS:M-gdwarf-*)
> CFLAGS+= -g
> CTFFLAGS+= -g
29a45
> .endif
39,40c55,67
< .if defined(PROG_CXX)
< PROG= ${PROG_CXX}
---
> .if ${MK_DEBUG_FILES} != "no"
> PROG_FULL=${PROG}.full
> # Use ${DEBUGDIR} for base system debug files, else .debug subdirectory
> .if defined(BINDIR) && (\
> ${BINDIR} == "/bin" ||\
> ${BINDIR} == "/libexec" ||\
> ${BINDIR} == "/sbin" ||\
> ${BINDIR:C%/usr/(bin|bsdinstall|games|libexec|lpr|sendmail|sm.bin|sbin)(/.*)?%/usr/bin%} == "/usr/bin"\
> )
> DEBUGFILEDIR= ${DEBUGDIR}${BINDIR}
> .else
> DEBUGFILEDIR?= ${BINDIR}/.debug
> DEBUGMKDIR=
41a69,71
> .else
> PROG_FULL= ${PROG}
> .endif
44a75
>
51c82
< ${PROG}: beforelinking
---
> ${PROG_FULL}: beforelinking
53c84
< ${PROG}: ${OBJS}
---
> ${PROG_FULL}: ${OBJS}
81c112
< ${PROG}: beforelinking
---
> ${PROG_FULL}: beforelinking
83c114
< ${PROG}: ${OBJS}
---
> ${PROG_FULL}: ${OBJS}
92c123
< .endif
---
> .endif # !target(${PROG})
95a127,135
> .if ${MK_DEBUG_FILES} != "no"
> ${PROG}: ${PROG_FULL} ${PROGNAME}.debug
> ${OBJCOPY} --strip-debug --add-gnu-debuglink=${PROGNAME}.debug \
> ${PROG_FULL} ${.TARGET}
>
> ${PROGNAME}.debug: ${PROG_FULL}
> ${OBJCOPY} --only-keep-debug ${PROG_FULL} ${.TARGET}
> .endif
>
111a152,153
> .if ${MK_DEBUG_FILES} != "no"
> CLEANFILES+= ${PROG_FULL} ${PROGNAME}.debug
112a155
> .endif
158a202,204
> .if ${MK_DEBUG_FILES} != "no"
> .if defined(DEBUGMKDIR)
> ${INSTALL} -T debug -d ${DESTDIR}${DEBUGFILEDIR}
159a206,209
> ${INSTALL} -T debug -o ${BINOWN} -g ${BINGRP} -m ${DEBUGMODE} \
> ${PROGNAME}.debug ${DESTDIR}${DEBUGFILEDIR}/${PROGNAME}.debug
> .endif
> .endif