bsd.lib.mk (ce8341fcb34aeb06512c443f2dd60f5b5d293e61) bsd.lib.mk (42f8c5b5800d41d7af6d1e3f55b4bbc72f10ea47)
1# from: @(#)bsd.lib.mk 5.26 (Berkeley) 5/2/91
2# $FreeBSD$
3#
4
5.include <bsd.init.mk>
6
7# Set up the variables controlling shared libraries. After this section,
8# SHLIB_NAME will be defined only if we are to create a shared library.

--- 29 unchanged lines hidden (view full) ---

38
39.if ${MK_CTF} != "no" && ${DEBUG_FLAGS:M-g} != ""
40CTFFLAGS+= -g
41.endif
42.else
43STRIP?= -s
44.endif
45
1# from: @(#)bsd.lib.mk 5.26 (Berkeley) 5/2/91
2# $FreeBSD$
3#
4
5.include <bsd.init.mk>
6
7# Set up the variables controlling shared libraries. After this section,
8# SHLIB_NAME will be defined only if we are to create a shared library.

--- 29 unchanged lines hidden (view full) ---

38
39.if ${MK_CTF} != "no" && ${DEBUG_FLAGS:M-g} != ""
40CTFFLAGS+= -g
41.endif
42.else
43STRIP?= -s
44.endif
45
46.if ${MK_DEBUG_FILES} != "no" && empty(DEBUG_FLAGS:M-g) && \
47 empty(DEBUG_FLAGS:M-gdwarf*)
48CFLAGS+= -g
49CTFFLAGS+= -g
50.endif
51
46.include <bsd.libnames.mk>
47
48# prefer .s to a .c, add .po, remove stuff not used in the BSD libraries
49# .So used for PIC object files
50.SUFFIXES:
51.SUFFIXES: .out .o .po .So .S .asm .s .c .cc .cpp .cxx .C .f .y .l .ln
52
53.if !defined(PICFLAG)

--- 55 unchanged lines hidden (view full) ---

109
110.S.So:
111 ${CC} ${PICFLAG} -DPIC ${CFLAGS} ${ACFLAGS} -c ${.IMPSRC} -o ${.TARGET}
112 ${CTFCONVERT_CMD}
113
114all: objwarn
115
116.if defined(SHLIB_NAME)
52.include <bsd.libnames.mk>
53
54# prefer .s to a .c, add .po, remove stuff not used in the BSD libraries
55# .So used for PIC object files
56.SUFFIXES:
57.SUFFIXES: .out .o .po .So .S .asm .s .c .cc .cpp .cxx .C .f .y .l .ln
58
59.if !defined(PICFLAG)

--- 55 unchanged lines hidden (view full) ---

115
116.S.So:
117 ${CC} ${PICFLAG} -DPIC ${CFLAGS} ${ACFLAGS} -c ${.IMPSRC} -o ${.TARGET}
118 ${CTFCONVERT_CMD}
119
120all: objwarn
121
122.if defined(SHLIB_NAME)
117.if defined(DEBUG_FLAGS)
118SHLIB_NAME_FULL=${SHLIB_NAME}.debug
123.if ${MK_DEBUG_FILES} != "no"
124SHLIB_NAME_FULL=${SHLIB_NAME}.full
125# Use ${DEBUGDIR} for base system debug files, else .debug subdirectory
126.if ${SHLIBDIR} == "/boot" ||\
127 ${SHLIBDIR:C%/lib(/.*)?$%/lib%} == "/lib" ||\
128 ${SHLIBDIR:C%/usr/lib(32)?(/.*)?%/usr/lib%} == "/usr/lib"
129DEBUGFILEDIR=${DEBUGDIR}${SHLIBDIR}
119.else
130.else
131DEBUGFILEDIR=${SHLIBDIR}/.debug
132DEBUGMKDIR=
133.endif
134.else
120SHLIB_NAME_FULL=${SHLIB_NAME}
121.endif
122.endif
123
124.include <bsd.symver.mk>
125
126# Allow libraries to specify their own version map or have it
127# automatically generated (see bsd.symver.mk above).

--- 68 unchanged lines hidden (view full) ---

196 @${CC} ${LDFLAGS} ${SSP_CFLAGS} ${SOLINKOPTS} \
197 -o ${.TARGET} -Wl,-soname,${SONAME} \
198 `NM='${NM}' lorder ${SOBJS} | tsort -q` ${LDADD}
199.endif
200.if ${MK_CTF} != "no"
201 ${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${SOBJS}
202.endif
203
135SHLIB_NAME_FULL=${SHLIB_NAME}
136.endif
137.endif
138
139.include <bsd.symver.mk>
140
141# Allow libraries to specify their own version map or have it
142# automatically generated (see bsd.symver.mk above).

--- 68 unchanged lines hidden (view full) ---

211 @${CC} ${LDFLAGS} ${SSP_CFLAGS} ${SOLINKOPTS} \
212 -o ${.TARGET} -Wl,-soname,${SONAME} \
213 `NM='${NM}' lorder ${SOBJS} | tsort -q` ${LDADD}
214.endif
215.if ${MK_CTF} != "no"
216 ${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${SOBJS}
217.endif
218
204.if defined(DEBUG_FLAGS)
205CLEANFILES+= ${SHLIB_NAME_FULL} ${SHLIB_NAME}.symbols
206${SHLIB_NAME}: ${SHLIB_NAME_FULL} ${SHLIB_NAME}.symbols
207 ${OBJCOPY} --strip-debug --add-gnu-debuglink=${SHLIB_NAME}.symbols \
219.if ${MK_DEBUG_FILES} != "no"
220CLEANFILES+= ${SHLIB_NAME_FULL} ${SHLIB_NAME}.debug
221${SHLIB_NAME}: ${SHLIB_NAME_FULL} ${SHLIB_NAME}.debug
222 ${OBJCOPY} --strip-debug --add-gnu-debuglink=${SHLIB_NAME}.debug \
208 ${SHLIB_NAME_FULL} ${.TARGET}
209
223 ${SHLIB_NAME_FULL} ${.TARGET}
224
210${SHLIB_NAME}.symbols: ${SHLIB_NAME_FULL}
225${SHLIB_NAME}.debug: ${SHLIB_NAME_FULL}
211 ${OBJCOPY} --only-keep-debug ${SHLIB_NAME_FULL} ${.TARGET}
212.endif
213.endif #defined(SHLIB_NAME)
214
215.if defined(INSTALL_PIC_ARCHIVE) && defined(LIB) && !empty(LIB) && ${MK_TOOLCHAIN} != "no"
216_LIBS+= lib${LIB}_pic.a
217
218lib${LIB}_pic.a: ${SOBJS}

--- 62 unchanged lines hidden (view full) ---

281.if ${MK_PROFILE} != "no" && defined(LIB) && !empty(LIB)
282 ${INSTALL} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
283 ${_INSTALLFLAGS} lib${LIB}_p.a ${DESTDIR}${LIBDIR}
284.endif
285.if defined(SHLIB_NAME)
286 ${INSTALL} ${STRIP} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
287 ${_INSTALLFLAGS} ${_SHLINSTALLFLAGS} \
288 ${SHLIB_NAME} ${DESTDIR}${SHLIBDIR}
226 ${OBJCOPY} --only-keep-debug ${SHLIB_NAME_FULL} ${.TARGET}
227.endif
228.endif #defined(SHLIB_NAME)
229
230.if defined(INSTALL_PIC_ARCHIVE) && defined(LIB) && !empty(LIB) && ${MK_TOOLCHAIN} != "no"
231_LIBS+= lib${LIB}_pic.a
232
233lib${LIB}_pic.a: ${SOBJS}

--- 62 unchanged lines hidden (view full) ---

296.if ${MK_PROFILE} != "no" && defined(LIB) && !empty(LIB)
297 ${INSTALL} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
298 ${_INSTALLFLAGS} lib${LIB}_p.a ${DESTDIR}${LIBDIR}
299.endif
300.if defined(SHLIB_NAME)
301 ${INSTALL} ${STRIP} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
302 ${_INSTALLFLAGS} ${_SHLINSTALLFLAGS} \
303 ${SHLIB_NAME} ${DESTDIR}${SHLIBDIR}
289.if defined(DEBUG_FLAGS)
290 ${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
304.if ${MK_DEBUG_FILES} != "no"
305.if defined(DEBUGMKDIR)
306 ${INSTALL} -T debug -d ${DESTDIR}${DEBUGFILEDIR}
307.endif
308 ${INSTALL} -T debug -o ${LIBOWN} -g ${LIBGRP} -m ${DEBUGMODE} \
291 ${_INSTALLFLAGS} \
309 ${_INSTALLFLAGS} \
292 ${SHLIB_NAME}.symbols ${DESTDIR}${SHLIBDIR}
310 ${SHLIB_NAME}.debug ${DESTDIR}${DEBUGFILEDIR}
293.endif
294.if defined(SHLIB_LINK)
295# ${_SHLIBDIRPREFIX} and ${_LDSCRIPTROOT} are both needed when cross-building
296# and when building 32 bits library shims. ${_SHLIBDIRPREFIX} is the directory
297# prefix where shared objects will be installed by the install target.
298#
299# ${_LDSCRIPTROOT} is the directory prefix that will be used when generating
300# ld(1) scripts. The crosstools' ld is configured to lookup libraries in an

--- 125 unchanged lines hidden ---
311.endif
312.if defined(SHLIB_LINK)
313# ${_SHLIBDIRPREFIX} and ${_LDSCRIPTROOT} are both needed when cross-building
314# and when building 32 bits library shims. ${_SHLIBDIRPREFIX} is the directory
315# prefix where shared objects will be installed by the install target.
316#
317# ${_LDSCRIPTROOT} is the directory prefix that will be used when generating
318# ld(1) scripts. The crosstools' ld is configured to lookup libraries in an

--- 125 unchanged lines hidden ---