diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2005-12-01 22:07:27 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2005-12-01 22:07:27 +0000 |
commit | f0e1bf55fddb5d4c9b40e5583be45b1e0c94a7a0 (patch) | |
tree | 155a8fccc0009af3ee38df691b22aac18c92129c /share/mk | |
parent | 3b49bfccb11bb7ff4713f63a86244549c3d96a67 (diff) |
Build lib.a, lib_p.a and lib.so.x.y with -g1.
This should give us meaningful backtraces through system libraries.
ok deraadt@
Diffstat (limited to 'share/mk')
-rw-r--r-- | share/mk/bsd.lib.mk | 45 |
1 files changed, 26 insertions, 19 deletions
diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk index 5dccb09d981..c83d8ae4a79 100644 --- a/share/mk/bsd.lib.mk +++ b/share/mk/bsd.lib.mk @@ -1,4 +1,4 @@ -# $OpenBSD: bsd.lib.mk,v 1.46 2005/11/30 13:04:55 steven Exp $ +# $OpenBSD: bsd.lib.mk,v 1.47 2005/12/01 22:07:26 kettenis Exp $ # $NetBSD: bsd.lib.mk,v 1.67 1996/01/17 20:39:26 mycroft Exp $ # @(#)bsd.lib.mk 5.26 (Berkeley) 5/2/91 @@ -23,8 +23,8 @@ SHLIB_MINOR=${minor} .SUFFIXES: .out .o .go .po .so .S .s .c .cc .C .cxx .f .y .l .ln .m4 .m .c.o: - @echo "${COMPILE.c} ${.IMPSRC} -o ${.TARGET}" - @${COMPILE.c} ${.IMPSRC} -o ${.TARGET}.o + @echo "${COMPILE.c} ${DEBUG1} ${.IMPSRC} -o ${.TARGET}" + @${COMPILE.c} ${DEBUG1} ${.IMPSRC} -o ${.TARGET}.o @${LD} -x -r ${.TARGET}.o -o ${.TARGET} @rm -f ${.TARGET}.o @@ -35,14 +35,15 @@ SHLIB_MINOR=${minor} @rm -f ${.TARGET}.o .c.po: - @echo "${COMPILE.c} -p ${.IMPSRC} -o ${.TARGET}" - @${COMPILE.c} -p ${.IMPSRC} -o ${.TARGET}.o + @echo "${COMPILE.c} ${DEBUG1} -p ${.IMPSRC} -o ${.TARGET}" + @${COMPILE.c} ${DEBUG1} -p ${.IMPSRC} -o ${.TARGET}.o @${LD} -X -r ${.TARGET}.o -o ${.TARGET} @rm -f ${.TARGET}.o .c.so: - @echo "${COMPILE.c} ${PICFLAG} -DPIC ${.IMPSRC} -o ${.TARGET}" - @${COMPILE.c} ${PICFLAG} -DPIC ${.IMPSRC} -o ${.TARGET}.o + @echo "${COMPILE.c} ${DEBUG1} ${PICFLAG} -DPIC ${.IMPSRC} \ + -o ${.TARGET}" + @${COMPILE.c} ${DEBUG1} ${PICFLAG} -DPIC ${.IMPSRC} -o ${.TARGET}.o @${LD} -x -r ${.TARGET}.o -o ${.TARGET} @rm -f ${.TARGET}.o @@ -50,8 +51,8 @@ SHLIB_MINOR=${minor} ${LINT} ${LINTFLAGS} ${CFLAGS:M-[IDU]*} ${CPPFLAGS:M-[IDU]*} -i ${.IMPSRC} .cc.o .C.o .cxx.o: - @echo "${COMPILE.cc} ${.IMPSRC} -o ${.TARGET}" - @${COMPILE.cc} ${.IMPSRC} -o ${.TARGET}.o + @echo "${COMPILE.cc} ${DEBUG1} ${.IMPSRC} -o ${.TARGET}" + @${COMPILE.cc} ${DEBUG1} ${.IMPSRC} -o ${.TARGET}.o @${LD} -x -r ${.TARGET}.o -o ${.TARGET} @rm -f ${.TARGET}.o @@ -62,21 +63,22 @@ SHLIB_MINOR=${minor} @rm -f ${.TARGET}.o .cc.po .C.po .cxx.po: - @echo "${COMPILE.cc} -p ${.IMPSRC} -o ${.TARGET}" - @${COMPILE.cc} -p ${.IMPSRC} -o ${.TARGET}.o + @echo "${COMPILE.cc} ${DEBUG1} -p ${.IMPSRC} -o ${.TARGET}" + @${COMPILE.cc} ${DEBUG1} -p ${.IMPSRC} -o ${.TARGET}.o @${LD} -X -r ${.TARGET}.o -o ${.TARGET} @rm -f ${.TARGET}.o .cc.so .C.so .cxx.so: - @echo "${COMPILE.cc} ${PICFLAG} -DPIC ${.IMPSRC} -o ${.TARGET}" - @${COMPILE.cc} ${PICFLAG} -DPIC ${.IMPSRC} -o ${.TARGET}.o + @echo "${COMPILE.cc} ${DEBUG1} ${PICFLAG} -DPIC ${.IMPSRC} \ + -o ${.TARGET}" + @${COMPILE.cc} ${DEBUG1} ${PICFLAG} -DPIC ${.IMPSRC} -o ${.TARGET}.o @${LD} -x -r ${.TARGET}.o -o ${.TARGET} @rm -f ${.TARGET}.o # Fortran 77 .f.o: - @echo "${COMPILE.f} ${.IMPSRC} -o ${.TARGET}" - @${COMPILE.f} ${.IMPSRC} -o ${.TARGET}.o + @echo "${COMPILE.f} ${DEBUG1} ${.IMPSRC} -o ${.TARGET}" + @${COMPILE.f} ${DEBUG1} ${.IMPSRC} -o ${.TARGET}.o @${LD} -x -r ${.TARGET}.o -o ${.TARGET} @rm -f ${.TARGET}.o @@ -87,14 +89,15 @@ SHLIB_MINOR=${minor} @rm -f ${.TARGET}.o .f.po: - @echo "${COMPILE.f} -p ${.IMPSRC} -o ${.TARGET}" - @${COMPILE.f} -p ${.IMPSRC} -o ${.TARGET}.o + @echo "${COMPILE.f} ${DEBUG1} -p ${.IMPSRC} -o ${.TARGET}" + @${COMPILE.f} ${DEBUG1} -p ${.IMPSRC} -o ${.TARGET}.o @${LD} -X -r ${.TARGET}.o -o ${.TARGET} @rm -f ${.TARGET}.o .f.so: - @echo "${COMPILE.f} ${PICFLAG} -DPIC ${.IMPSRC} -o ${.TARGET}" - @${COMPILE.f} ${PICFLAG} -DPIC ${.IMPSRC} -o ${.TARGET}.o + @echo "${COMPILE.f} ${DEBUG1} ${PICFLAG} -DPIC ${.IMPSRC} \ + -o ${.TARGET}" + @${COMPILE.f} ${DEBUG1} ${PICFLAG} -DPIC ${.IMPSRC} -o ${.TARGET}.o @${LD} -x -r ${.TARGET}.o -o ${.TARGET} @rm -f ${.TARGET}.o @@ -142,6 +145,10 @@ CXXFLAGS+= ${CXXDIAGFLAGS} CFLAGS+= ${COPTS} CXXFLAGS+= ${CXXOPTS} +.if !defined(DEBUG) +DEBUG1?= -g1 +.endif + _LIBS=lib${LIB}.a .if (${DEBUGLIBS:L} == "yes") _LIBS+=lib${LIB}_g.a |