Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/share/mk Don't use .PHONY for targets that are actually inst...



details:   https://anonhg.NetBSD.org/src/rev/65683b92cb8c
branches:  trunk
changeset: 522158:65683b92cb8c
user:      mycroft <mycroft%NetBSD.org@localhost>
date:      Mon Feb 11 21:14:58 2002 +0000

description:
Don't use .PHONY for targets that are actually installed.  Instead use force
dependencies.  (Among other things, `make -t install' does something vaguely
sensible now.)

diffstat:

 share/mk/bsd.doc.mk   |  15 ++++++++++---
 share/mk/bsd.files.mk |  15 ++++++++++---
 share/mk/bsd.inc.mk   |   8 +++++-
 share/mk/bsd.info.mk  |  15 ++++++++++---
 share/mk/bsd.kinc.mk  |   8 +++++-
 share/mk/bsd.kmod.mk  |  16 ++++++++++----
 share/mk/bsd.lib.mk   |  52 ++++++++++++++++++++++++++++++++++++++------------
 share/mk/bsd.links.mk |   5 +--
 share/mk/bsd.man.mk   |  43 ++++++++++++++++++++++++++++++++---------
 share/mk/bsd.nls.mk   |  15 ++++++++++---
 share/mk/bsd.prog.mk  |  26 ++++++++++++++++--------
 11 files changed, 158 insertions(+), 60 deletions(-)

diffs (truncated from 513 to 300 lines):

diff -r 92d6c0c3b361 -r 65683b92cb8c share/mk/bsd.doc.mk
--- a/share/mk/bsd.doc.mk       Mon Feb 11 21:13:35 2002 +0000
+++ b/share/mk/bsd.doc.mk       Mon Feb 11 21:14:58 2002 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: bsd.doc.mk,v 1.56 2001/11/28 20:19:08 tv Exp $
+#      $NetBSD: bsd.doc.mk,v 1.57 2002/02/11 21:14:58 mycroft Exp $
 #      @(#)bsd.doc.mk  8.1 (Berkeley) 8/14/93
 
 .include <bsd.init.mk>
@@ -42,13 +42,20 @@
 .for F in Makefile ${FILES:O:u} ${EXTRA}
 _F:=           ${DESTDIR}${DOCDIR}/${DIR}/${F}         # installed path
 
+.if !defined(UPDATE)
+${_F}!         ${F} __docinstall                       # install rule
+.if !defined(BUILD) && !make(all) && !make(${F})
+${_F}!         .MADE                                   # no build at install
+.endif
+.else
 ${_F}:         ${F} __docinstall                       # install rule
-docinstall::   ${_F}
-.PRECIOUS:     ${_F}                                   # keep if install fails
-.PHONY:                ${UPDATE:D:U${_F}}                      # clobber unless UPDATE
 .if !defined(BUILD) && !make(all) && !make(${F})
 ${_F}:         .MADE                                   # no build at install
 .endif
+.endif
+
+docinstall::   ${_F}
+.PRECIOUS:     ${_F}                                   # keep if install fails
 .endfor
 
 .undef _F
diff -r 92d6c0c3b361 -r 65683b92cb8c share/mk/bsd.files.mk
--- a/share/mk/bsd.files.mk     Mon Feb 11 21:13:35 2002 +0000
+++ b/share/mk/bsd.files.mk     Mon Feb 11 21:14:58 2002 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: bsd.files.mk,v 1.17 2001/11/28 20:19:08 tv Exp $
+#      $NetBSD: bsd.files.mk,v 1.18 2002/02/11 21:14:58 mycroft Exp $
 
 .if !target(__fileinstall)
 # This file can be included multiple times.  It clears the definition of
@@ -31,13 +31,20 @@
 _FNAME:=       ${FILESNAME_${F}:U${FILESNAME:U${F:T}}} # name override
 _F:=           ${DESTDIR}${_FDIR}/${_FNAME}            # installed path
 
+.if !defined(UPDATE)
+${_F}!         ${F} __fileinstall                      # install rule
+.if !defined(BUILD) && !make(all) && !make(${F})
+${_F}!         .MADE                                   # no build at install
+.endif
+.else
 ${_F}:         ${F} __fileinstall                      # install rule
-filesinstall:: ${_F}
-.PRECIOUS:     ${_F}                                   # keep if install fails
-.PHONY:                ${UPDATE:D:U${_F}}                      # clobber unless UPDATE
 .if !defined(BUILD) && !make(all) && !make(${F})
 ${_F}:         .MADE                                   # no build at install
 .endif
+.endif
+
+filesinstall:: ${_F}
+.PRECIOUS:     ${_F}                                   # keep if install fails
 .endfor
 
 .undef _FDIR
diff -r 92d6c0c3b361 -r 65683b92cb8c share/mk/bsd.inc.mk
--- a/share/mk/bsd.inc.mk       Mon Feb 11 21:13:35 2002 +0000
+++ b/share/mk/bsd.inc.mk       Mon Feb 11 21:14:58 2002 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: bsd.inc.mk,v 1.21 2001/11/28 20:19:08 tv Exp $
+#      $NetBSD: bsd.inc.mk,v 1.22 2002/02/11 21:14:58 mycroft Exp $
 
 ##### Basic targets
 .PHONY:                incinstall
@@ -20,10 +20,14 @@
 _FNAME:=       ${INCSNAME_${F:C,/,_,g}:U${INCSNAME:U${F}}} # name override
 _F:=           ${DESTDIR}${_FDIR}/${_FNAME}            # installed path
 
+.if !defined(UPDATE)
+${_F}!         ${F} __incinstall                       # install rule
+.else
 ${_F}:         ${F} __incinstall                       # install rule
+.endif
+
 incinstall::   ${_F}
 .PRECIOUS:     ${_F}                                   # keep if install fails
-.PHONY:                ${UPDATE:D:U${_F}}                      # clobber unless UPDATE
 .endfor
 
 .undef _FDIR
diff -r 92d6c0c3b361 -r 65683b92cb8c share/mk/bsd.info.mk
--- a/share/mk/bsd.info.mk      Mon Feb 11 21:13:35 2002 +0000
+++ b/share/mk/bsd.info.mk      Mon Feb 11 21:14:58 2002 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: bsd.info.mk,v 1.24 2001/11/28 20:19:08 tv Exp $
+#      $NetBSD: bsd.info.mk,v 1.25 2002/02/11 21:14:59 mycroft Exp $
 
 .include <bsd.init.mk>
 
@@ -47,13 +47,20 @@
 _FNAME:=       ${INFONAME_${F}:U${INFONAME:U${F:T}}}   # name overrides
 _F:=           ${DESTDIR}${_FDIR}/${_FNAME}            # installed path
 
+.if !defined(UPDATE)
+${_F}!         ${F} __infoinstall                      # install rule
+.if !defined(BUILD) && !make(all) && !make(${F})
+${_F}!         .MADE                                   # no build at install
+.endif
+.else
 ${_F}:         ${F} __infoinstall                      # install rule
-infoinstall::  ${_F}
-.PRECIOUS:     ${_F}                                   # keep if install fails
-.PHONY:                ${UPDATE:D:U${_F}}                      # clobber unless UPDATE
 .if !defined(BUILD) && !make(all) && !make(${F})
 ${_F}:         .MADE                                   # no build at install
 .endif
+.endif
+
+infoinstall::  ${_F}
+.PRECIOUS:     ${_F}                                   # keep if install fails
 .endfor
 
 .undef _FDIR
diff -r 92d6c0c3b361 -r 65683b92cb8c share/mk/bsd.kinc.mk
--- a/share/mk/bsd.kinc.mk      Mon Feb 11 21:13:35 2002 +0000
+++ b/share/mk/bsd.kinc.mk      Mon Feb 11 21:14:58 2002 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: bsd.kinc.mk,v 1.21 2001/11/28 20:19:08 tv Exp $
+#      $NetBSD: bsd.kinc.mk,v 1.22 2002/02/11 21:14:59 mycroft Exp $
 
 # System configuration variables:
 #
@@ -80,10 +80,14 @@
 .for F in ${INCS:O:u} ${DEPINCS:O:u}
 _F:=           ${DESTDIR}${INCSDIR}/${F}               # installed path
 
+.if !defined(UPDATE)
+${_F}!         ${F} __incinstall                       # install rule
+.else
 ${_F}:         ${F} __incinstall                       # install rule
+.endif
+
 incinstall::   ${_F}
 .PRECIOUS:     ${_F}                                   # keep if install fails
-.PHONY:                ${UPDATE:D:U${_F}}                      # clobber unless UPDATE
 .endfor
 
 .undef _F
diff -r 92d6c0c3b361 -r 65683b92cb8c share/mk/bsd.kmod.mk
--- a/share/mk/bsd.kmod.mk      Mon Feb 11 21:13:35 2002 +0000
+++ b/share/mk/bsd.kmod.mk      Mon Feb 11 21:14:58 2002 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: bsd.kmod.mk,v 1.47 2001/12/28 07:49:26 thorpej Exp $
+#      $NetBSD: bsd.kmod.mk,v 1.48 2002/02/11 21:14:59 mycroft Exp $
 
 .include <bsd.init.mk>
 
@@ -43,16 +43,22 @@
 .if !target(kmodinstall)
 _PROG:=                ${DESTDIR}${KMODDIR}/${PROG}            # installed path
 
+.if !defined(UPDATE)
+${_PROG}! ${PROG}                                      # install rule
+.if !defined(BUILD) && !make(all) && !make(${PROG})
+${_PROG}!      .MADE                                   # no build at install
+.endif
+.else
 ${_PROG}: ${PROG}                                      # install rule
+.if !defined(BUILD) && !make(all) && !make(${PROG})
+${_PROG}:      .MADE                                   # no build at install
+.endif
+.endif
        ${INSTALL_FILE} -o ${KMODOWN} -g ${KMODGRP} -m ${KMODMODE} \
                ${.ALLSRC} ${.TARGET}
 
 kmodinstall::  ${_PROG}
 .PRECIOUS:     ${_PROG}                                # keep if install fails
-.PHONY:                ${UPDATE:D:U${_PROG}}                   # clobber unless UPDATE
-.if !defined(BUILD) && !make(all) && !make(${PROG})
-${_PROG}:      .MADE                                   # no build at install
-.endif
 
 .undef _PROG
 .endif # !target(kmodinstall)
diff -r 92d6c0c3b361 -r 65683b92cb8c share/mk/bsd.lib.mk
--- a/share/mk/bsd.lib.mk       Mon Feb 11 21:13:35 2002 +0000
+++ b/share/mk/bsd.lib.mk       Mon Feb 11 21:14:58 2002 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: bsd.lib.mk,v 1.196 2001/12/28 01:40:50 lukem Exp $
+#      $NetBSD: bsd.lib.mk,v 1.197 2002/02/11 21:15:00 mycroft Exp $
 #      @(#)bsd.lib.mk  8.3 (Berkeley) 4/22/94
 
 .include <bsd.init.mk>
@@ -349,6 +349,9 @@
        ${RANLIB} -t ${.TARGET}
        chmod ${LIBMODE} ${.TARGET}
 
+__archivesymlinkpic: .USE
+       ${INSTALL_SYMLINK} ${.ALLSRC} ${.TARGET}
+
 DPSRCS+=       ${SRCS:M*.[ly]:C/\..$/.c/}
 CLEANFILES+=   ${DPSRCS} ${YHEADER:D${SRCS:M*.y:.y=.h}}
 
@@ -419,58 +422,77 @@
 .if ${MKLINKLIB} != "no"
 libinstall:: ${DESTDIR}${LIBDIR}/lib${LIB}.a
 .PRECIOUS: ${DESTDIR}${LIBDIR}/lib${LIB}.a
+
 .if !defined(UPDATE)
-.PHONY: ${DESTDIR}${LIBDIR}/lib${LIB}.a
+.if !defined(BUILD) && !make(all) && !make(lib${LIB}.a)
+${DESTDIR}${LIBDIR}/lib${LIB}.a! .MADE
 .endif
-
+${DESTDIR}${LIBDIR}/lib${LIB}.a! lib${LIB}.a __archiveinstall
+.else
 .if !defined(BUILD) && !make(all) && !make(lib${LIB}.a)
 ${DESTDIR}${LIBDIR}/lib${LIB}.a: .MADE
 .endif
 ${DESTDIR}${LIBDIR}/lib${LIB}.a: lib${LIB}.a __archiveinstall
 .endif
+.endif
 
 .if ${MKPROFILE} != "no"
 libinstall:: ${DESTDIR}${LIBDIR}/lib${LIB}_p.a
 .PRECIOUS: ${DESTDIR}${LIBDIR}/lib${LIB}_p.a
+
 .if !defined(UPDATE)
-.PHONY: ${DESTDIR}${LIBDIR}/lib${LIB}_p.a
+.if !defined(BUILD) && !make(all) && !make(lib${LIB}_p.a)
+${DESTDIR}${LIBDIR}/lib${LIB}_p.a! .MADE
 .endif
-
+${DESTDIR}${LIBDIR}/lib${LIB}_p.a! lib${LIB}_p.a __archiveinstall
+.else
 .if !defined(BUILD) && !make(all) && !make(lib${LIB}_p.a)
 ${DESTDIR}${LIBDIR}/lib${LIB}_p.a: .MADE
 .endif
 ${DESTDIR}${LIBDIR}/lib${LIB}_p.a: lib${LIB}_p.a __archiveinstall
 .endif
+.endif
 
 .if ${MKPIC} != "no" && ${MKPICINSTALL} != "no"
 libinstall:: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a
 .PRECIOUS: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a
+
 .if !defined(UPDATE)
-.PHONY: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a
+.if !defined(BUILD) && !make(all) && !make(lib${LIB}_pic.a)
+${DESTDIR}${LIBDIR}/lib${LIB}_pic.a! .MADE
 .endif
-
+.if ${MKPICLIB} == "no"
+${DESTDIR}${LIBDIR}/lib${LIB}_pic.a! lib${LIB}.a __archivesymlinkpic
+.else
+${DESTDIR}${LIBDIR}/lib${LIB}_pic.a! lib${LIB}_pic.a __archiveinstall
+.endif
+.else
 .if !defined(BUILD) && !make(all) && !make(lib${LIB}_pic.a)
 ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a: .MADE
 .endif
 .if ${MKPICLIB} == "no"
-${DESTDIR}${LIBDIR}/lib${LIB}_pic.a:
-       ${INSTALL_SYMLINK} lib${LIB}.a ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a
+${DESTDIR}${LIBDIR}/lib${LIB}_pic.a: lib${LIB}.a __archivesymlinkpic
 .else
 ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a: lib${LIB}_pic.a __archiveinstall
 .endif
 .endif
+.endif
 
 .if ${MKPIC} != "no" && defined(SHLIB_FULLVERSION)
 libinstall:: ${DESTDIR}${_LIBSODIR}/lib${LIB}.so.${SHLIB_FULLVERSION}
 .PRECIOUS: ${DESTDIR}${_LIBSODIR}/lib${LIB}.so.${SHLIB_FULLVERSION}
+
 .if !defined(UPDATE)
-.PHONY: ${DESTDIR}${_LIBSODIR}/lib${LIB}.so.${SHLIB_FULLVERSION}
+.if !defined(BUILD) && !make(all) && !make(lib${LIB}.so.${SHLIB_FULLVERSION})
+${DESTDIR}${_LIBSODIR}/lib${LIB}.so.${SHLIB_FULLVERSION}! .MADE
 .endif
-
+${DESTDIR}${_LIBSODIR}/lib${LIB}.so.${SHLIB_FULLVERSION}! lib${LIB}.so.${SHLIB_FULLVERSION}
+.else
 .if !defined(BUILD) && !make(all) && !make(lib${LIB}.so.${SHLIB_FULLVERSION})
 ${DESTDIR}${_LIBSODIR}/lib${LIB}.so.${SHLIB_FULLVERSION}: .MADE
 .endif
 ${DESTDIR}${_LIBSODIR}/lib${LIB}.so.${SHLIB_FULLVERSION}: lib${LIB}.so.${SHLIB_FULLVERSION}
+.endif
        ${INSTALL_FILE} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
                ${.ALLSRC} ${.TARGET}
 .if ${_LIBSODIR} != ${LIBDIR}
@@ -501,14 +523,18 @@
 .if ${MKLINT} != "no" && ${MKLINKLIB} != "no" && !empty(LOBJS)
 libinstall:: ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln
 .PRECIOUS: ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln
+
 .if !defined(UPDATE)
-.PHONY: ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln
+.if !defined(BUILD) && !make(all) && !make(llib-l${LIB}.ln)



Home | Main Index | Thread Index | Old Index