diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2001-07-19 23:16:18 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2001-07-19 23:16:18 +0000 |
commit | 9bb969be60ecc43df7377a21fa735dc03c3eff56 (patch) | |
tree | 181aa67d8d1bbc382eda9fe789f672724eb6ddcf | |
parent | f2eb26bea22100ce3c40d83d0195b8ee91395829 (diff) |
Minor speed-up tweaks.
- use .for a b in new syntax for make to handle links.
- kill mips
- .include shlib_version, since its contents is happy as a Makefile
fragment (avoids 10 shell escapes per lib directory, roughly)
okay millert@
-rw-r--r-- | share/mk/bsd.lib.mk | 46 | ||||
-rw-r--r-- | share/mk/bsd.man.mk | 24 | ||||
-rw-r--r-- | share/mk/bsd.prog.mk | 18 |
3 files changed, 31 insertions, 57 deletions
diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk index 447e695f8ce..06c7dc8d417 100644 --- a/share/mk/bsd.lib.mk +++ b/share/mk/bsd.lib.mk @@ -1,4 +1,4 @@ -# $OpenBSD: bsd.lib.mk,v 1.30 2001/07/18 13:23:03 espie Exp $ +# $OpenBSD: bsd.lib.mk,v 1.31 2001/07/19 23:16:17 espie 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 @@ -9,8 +9,7 @@ .endif .if exists(${.CURDIR}/shlib_version) -SHLIB_MAJOR != . ${.CURDIR}/shlib_version ; echo $$major -SHLIB_MINOR != . ${.CURDIR}/shlib_version ; echo $$minor +.include "${.CURDIR}/shlib_version" .endif .MAIN: all @@ -134,8 +133,8 @@ _LIBS+=lib${LIB}_p.a .if (${MACHINE_ARCH} != "mips") _LIBS+=lib${LIB}_pic.a .endif -.if defined(SHLIB_MAJOR) && defined(SHLIB_MINOR) -_LIBS+=lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR} +.if defined(major) && defined(minor) +_LIBS+=lib${LIB}.so.${major}.${minor} .endif .endif @@ -174,21 +173,12 @@ lib${LIB}_pic.a:: ${SOBJS} @${AR} cq lib${LIB}_pic.a `${LORDER} ${SOBJS} | tsort -q` ${RANLIB} lib${LIB}_pic.a -.if (${MACHINE_ARCH} == "mips") -lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR}: ${OBJS} ${DPADD} - @echo building shared ${LIB} library \(version ${SHLIB_MAJOR}.${SHLIB_MINOR}\) - @rm -f lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR} - ${CC} -shared ${PICFLAG} -Wl,-soname,lib${LIB}.so.${SHLIB_MAJOR} \ - -o lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \ - `${LORDER} ${OBJS}|tsort -q` ${LDADD} -.else -lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR}: ${SOBJS} ${DPADD} - @echo building shared ${LIB} library \(version ${SHLIB_MAJOR}.${SHLIB_MINOR}\) - @rm -f lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR} +lib${LIB}.so.${major}.${minor}: ${SOBJS} ${DPADD} + @echo building shared ${LIB} library \(version ${major}.${minor}\) + @rm -f lib${LIB}.so.${major}.${minor} ${CC} -shared ${PICFLAG} \ - -o lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \ + -o lib${LIB}.so.${major}.${minor} \ `${LORDER} ${SOBJS}|tsort -q` ${LDADD} -.endif LOBJS+= ${LSRCS:.c=.ln} ${SRCS:M*.c:.c=.ln} # the following looks XXX to me... -- cgd @@ -262,25 +252,21 @@ realinstall: .endif chmod ${LIBMODE} ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a .endif -.if !defined(NOPIC) && defined(SHLIB_MAJOR) && defined(SHLIB_MINOR) +.if !defined(NOPIC) && defined(major) && defined(minor) ${INSTALL} ${INSTALL_COPY} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ - lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR} ${DESTDIR}${LIBDIR} + lib${LIB}.so.${major}.${minor} ${DESTDIR}${LIBDIR} .endif .if !defined(NOLINT) ${INSTALL} ${INSTALL_COPY} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ llib-l${LIB}.ln ${DESTDIR}${LINTLIBDIR} .endif .if defined(LINKS) && !empty(LINKS) - @set ${LINKS}; \ - while test $$# -ge 2; do \ - l=${DESTDIR}$$1; \ - shift; \ - t=${DESTDIR}$$1; \ - shift; \ - echo $$t -\> $$l; \ - rm -f $$t; \ - ln $$l $$t; \ - done; true +. for lnk file in ${LINKS} + @l=${DESTDIR}${lnk}; \ + t=${DESTDIR}${file}; \ + echo $$t -\> $$l; \ + rm -f $$t; ln $$l $$t +. endfor .endif install: maninstall _SUBDIRUSE diff --git a/share/mk/bsd.man.mk b/share/mk/bsd.man.mk index 19eacdf42d4..24b78b22e63 100644 --- a/share/mk/bsd.man.mk +++ b/share/mk/bsd.man.mk @@ -1,4 +1,4 @@ -# $OpenBSD: bsd.man.mk,v 1.20 2000/11/10 02:55:40 deraadt Exp $ +# $OpenBSD: bsd.man.mk,v 1.21 2001/07/19 23:16:17 espie Exp $ # $NetBSD: bsd.man.mk,v 1.23 1996/02/10 07:49:33 jtc Exp $ # @(#)bsd.man.mk 5.2 (Berkeley) 5/11/90 @@ -116,21 +116,13 @@ maninstall: done .endif .if defined(MLINKS) && !empty(MLINKS) -. for _subdir in ${MANSUBDIR} - @set ${MLINKS}; \ - while test $$# -ge 2; do \ - name=$$1; \ - shift; \ - dir=${DESTDIR}${MANDIR}$${name##*.}; \ - l=$${dir}${_subdir}/$${name%.*}.0${MCOMPRESSSUFFIX}; \ - name=$$1; \ - shift; \ - dir=${DESTDIR}${MANDIR}$${name##*.}; \ - t=$${dir}${_subdir}/$${name%.*}.0${MCOMPRESSSUFFIX}; \ - echo $$t -\> $$l; \ - rm -f $$t; \ - ln $$l $$t; \ - done +. for sub in ${MANSUBDIR} +. for lnk file in ${MLINKS} + @l=${DESTDIR}${MANDIR}${lnk:E}${sub}/${lnk:R}.0${MCOMPRESSSUFFIX}; \ + t=${DESTDIR}${MANDIR}${file:E}${sub}/${file:R}.0${MCOMPRESSSUFFIX}; \ + echo $$t -\> $$l; \ + rm -f $$t; ln $$l $$t; +. endfor . endfor .endif diff --git a/share/mk/bsd.prog.mk b/share/mk/bsd.prog.mk index 7ceb75684bc..93c47c7ec64 100644 --- a/share/mk/bsd.prog.mk +++ b/share/mk/bsd.prog.mk @@ -1,4 +1,4 @@ -# $OpenBSD: bsd.prog.mk,v 1.24 2001/07/18 13:23:03 espie Exp $ +# $OpenBSD: bsd.prog.mk,v 1.25 2001/07/19 23:16:17 espie Exp $ # $NetBSD: bsd.prog.mk,v 1.55 1996/04/08 21:19:26 jtc Exp $ # @(#)bsd.prog.mk 5.26 (Berkeley) 6/25/91 @@ -141,16 +141,12 @@ realinstall: install: maninstall _SUBDIRUSE .if defined(LINKS) && !empty(LINKS) - @set ${LINKS}; \ - while test $$# -ge 2; do \ - l=${DESTDIR}$$1; \ - shift; \ - t=${DESTDIR}$$1; \ - shift; \ - echo $$t -\> $$l; \ - rm -f $$t; \ - ln $$l $$t; \ - done; true +. for lnk file in ${LINKS} + @l=${DESTDIR}${lnk}; \ + t=${DESTDIR}${file}; \ + echo $$t -\> $$l; \ + rm -f $$t; ln $$l $$t +. endfor .endif maninstall: afterinstall |