Subject: how to make (sic) relinks faster...
To: None <>
From: Luke Mewburn <>
List: current-users
Date: 05/21/1994 12:27:28
I seem to be doing `make' from the top of the src tree a bit, and
when most of the code just needs to get relinked in with the slightly
changed libc, or whatever, I notice that programs with 1 source
file get compiled like:
    cc -o foo .... foo.c
instead of:
    cc -c foo.c
    cc -o foo foo.o
The latter (to me) is preferable, because when the code is just
linking the `cc -o foo foo.o' is much faster than the first method.

The disadvantage, of course, is a few more .o files around; but
that's the tradeoff with speed & space...

Here's my patch to /usr/share/mk/

***	Sat May 21 12:04:03 1994
---	Sat May 21 12:02:47 1994
*** 50,56 ****

  .if defined(PROG)
! .if defined(SRCS)

  OBJS+=  ${SRCS:N*.h:R:S/$/.o/g}

--- 50,58 ----

  .if defined(PROG)
! .if !defined(SRCS)
! SRCS=	${PROG}.c
! .endif

  OBJS+=  ${SRCS:N*.h:R:S/$/.o/g}

*** 63,79 ****

  ${PROG}: ${LIBCRT0} ${OBJS} ${LIBC} ${DPADD}
- .endif
- .else
- SRCS=	${PROG}.c
- ${PROG}: ${LIBCRT0} ${SRCS} ${LIBC} ${DPADD}
- MKDEP=	-p


--- 65,70 ----

``Concealment is never as hard as people think, you          Luke Mewburn
  must understand that. It's action while hiding that's    <>
  the hard part''
        -- Coyote, in Kim Stanley Robinson's `Green Mars'