[BACK]Return to bsd.prog.mk CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / share / mk

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/share/mk/bsd.prog.mk between version 1.27 and 1.131

version 1.27, 1993/08/15 20:59:38 version 1.131, 2001/06/01 17:49:33
Line 1 
Line 1 
 #       from: @(#)bsd.prog.mk   5.26 (Berkeley) 6/25/91  #       $NetBSD$
 #       $Id$  #       @(#)bsd.prog.mk 8.2 (Berkeley) 4/2/94
   
   .if !target(__initialized__)
   __initialized__:
 .if exists(${.CURDIR}/../Makefile.inc)  .if exists(${.CURDIR}/../Makefile.inc)
 .include "${.CURDIR}/../Makefile.inc"  .include "${.CURDIR}/../Makefile.inc"
 .endif  .endif
   .include <bsd.own.mk>
   .include <bsd.obj.mk>
   .include <bsd.depall.mk>
   .MAIN:          all
   .endif
   
 .SUFFIXES: .out .o .c .cc .C .y .l .s .8 .7 .6 .5 .4 .3 .2 .1 .0  .PHONY:         cleanprog proginstall scriptsinstall
   realinstall:    proginstall scriptsinstall
   clean cleandir: cleanprog
   
 CFLAGS+=        ${COPTS}  CFLAGS+=        ${COPTS}
   
 LIBCRT0?=       /usr/lib/crt0.o  # ELF platforms depend on crtbegin.o and crtend.o
 LIBC?=          /usr/lib/libc.a  .if ${OBJECT_FMT} == "ELF"
 LIBCOMPAT?=     /usr/lib/libcompat.a  LIBCRTBEGIN?=   ${DESTDIR}/usr/lib/crtbegin.o
 .ifndef EXPORTABLE_SYSTEM  LIBCRTEND?=     ${DESTDIR}/usr/lib/crtend.o
 LIBCRYPT?=      /usr/lib/libcrypt.a  .else
 .endif  LIBCRTBEGIN?=
 LIBCURSES?=     /usr/lib/libcurses.a  LIBCRTEND?=
 LIBDBM?=        /usr/lib/libdbm.a  .endif
 LIBDES?=        /usr/lib/libdes.a  
 LIBL?=          /usr/lib/libl.a  LIBCRT0?=       ${DESTDIR}/usr/lib/crt0.o
 LIBKDB?=        /usr/lib/libkdb.a  
 LIBKRB?=        /usr/lib/libkrb.a  LIBBZ2?=        ${DESTDIR}/usr/lib/libbz2.a
 LIBM?=          /usr/lib/libm.a  LIBC?=          ${DESTDIR}/usr/lib/libc.a
 LIBMP?=         /usr/lib/libmp.a  LIBC_PIC?=      ${DESTDIR}/usr/lib/libc_pic.a
 LIBPC?=         /usr/lib/libpc.a  LIBCDK?=        ${DESTDIR}/usr/lib/libcdk.a
 LIBPLOT?=       /usr/lib/libplot.a  LIBCOM_ERR?=    ${DESTDIR}/usr/lib/libcom_err.a
 LIBRESOLV?=     /usr/lib/libresolv.a  LIBCOMPAT?=     ${DESTDIR}/usr/lib/libcompat.a
 LIBRPC?=        /usr/lib/librpc.a  LIBCRYPT?=      ${DESTDIR}/usr/lib/libcrypt.a
 LIBRPCSVC?=     /usr/lib/librpcsvc.a  LIBCRYPTO?=     ${DESTDIR}/usr/lib/libcrypto.a
 LIBTERM?=       /usr/lib/libterm.a  LIBCRYPTO_RC5?= ${DESTDIR}/usr/lib/libcrypto_rc5.a
 LIBUTIL?=       /usr/lib/libutil.a  LIBCRYPTO_IDEA?=${DESTDIR}/usr/lib/libcrypto_idea.a
   LIBCURSES?=     ${DESTDIR}/usr/lib/libcurses.a
   LIBDBM?=        ${DESTDIR}/usr/lib/libdbm.a
   LIBDES?=        ${DESTDIR}/usr/lib/libdes.a
   LIBEDIT?=       ${DESTDIR}/usr/lib/libedit.a
   LIBFORM?=       ${DESTDIR}/usr/lib/libform.a
   LIBGCC?=        ${DESTDIR}/usr/lib/libgcc.a
   LIBGNUMALLOC?=  ${DESTDIR}/usr/lib/libgnumalloc.a
   LIBGSSAPI?=     ${DESTDIR}/usr/lib/libgssapi.a
   LIBHDB?=        ${DESTDIR}/usr/lib/libhdb.a
   LIBINTL?=       ${DESTDIR}/usr/lib/libintl.a
   LIBIPSEC?=      ${DESTDIR}/usr/lib/libipsec.a
   LIBKADM?=       ${DESTDIR}/usr/lib/libkadm.a
   LIBKADM5CLNT?=  ${DESTDIR}/usr/lib/libkadm5clnt.a
   LIBKADM5SRV?=   ${DESTDIR}/usr/lib/libkadm5srv.a
   LIBKAFS?=       ${DESTDIR}/usr/lib/libkafs.a
   LIBKDB?=        ${DESTDIR}/usr/lib/libkdb.a
   LIBKRB?=        ${DESTDIR}/usr/lib/libkrb.a
   LIBKRB5?=       ${DESTDIR}/usr/lib/libkrb5.a
   LIBKSTREAM?=    ${DESTDIR}/usr/lib/libkstream.a
   LIBKVM?=        ${DESTDIR}/usr/lib/libkvm.a
   LIBL?=          ${DESTDIR}/usr/lib/libl.a
   LIBM?=          ${DESTDIR}/usr/lib/libm.a
   LIBMENU?=       ${DESTDIR}/usr/lib/libmenu.a
   LIBOBJC?=       ${DESTDIR}/usr/lib/libobjc.a
   LIBOSSAUDIO?=   ${DESTDIR}/usr/lib/libossaudio.a
   LIBPCAP?=       ${DESTDIR}/usr/lib/libpcap.a
   LIBPOSIX?=      ${DESTDIR}/usr/lib/libposix.a
   LIBRESOLV?=     ${DESTDIR}/usr/lib/libresolv.a
   LIBRMT?=        ${DESTDIR}/usr/lib/librmt.a
   LIBROKEN?=      ${DESTDIR}/usr/lib/libroken.a
   LIBRPCSVC?=     ${DESTDIR}/usr/lib/librpcsvc.a
   LIBSKEY?=       ${DESTDIR}/usr/lib/libskey.a
   LIBSS?=         ${DESTDIR}/usr/lib/libss.a
   LIBSSL?=        ${DESTDIR}/usr/lib/libssl.a
   LIBSL?=         ${DESTDIR}/usr/lib/libsl.a
   LIBTERMCAP?=    ${DESTDIR}/usr/lib/libtermcap.a
   LIBTELNET?=     ${DESTDIR}/usr/lib/libtelnet.a
   LIBUSB?=        ${DESTDIR}/usr/lib/libusb.a
   LIBUTIL?=       ${DESTDIR}/usr/lib/libutil.a
   LIBWRAP?=       ${DESTDIR}/usr/lib/libwrap.a
   LIBY?=          ${DESTDIR}/usr/lib/liby.a
   LIBZ?=          ${DESTDIR}/usr/lib/libz.a
   
 .if defined(SHAREDSTRINGS)  .if defined(SHAREDSTRINGS)
 CLEANFILES+=strings  CLEANFILES+=strings
Line 51  CLEANFILES+=strings
Line 102  CLEANFILES+=strings
         @rm -f x.C          @rm -f x.C
 .endif  .endif
   
 .if defined(PROG)  
 .if defined(SRCS)  
   
 OBJS+=  ${SRCS:N*.h:R:S/$/.o/g}  
   
 .if defined(LDONLY)  .if defined(PROG)
   SRCS?=          ${PROG}.c
   
 ${PROG}: ${LIBCRT0} ${OBJS} ${LIBC} ${DPADD}  DPSRCS+=        ${SRCS:M*.l:.l=.c} ${SRCS:M*.y:.y=.c}
         ${LD} ${LDFLAGS} -o ${.TARGET} ${LIBCRT0} ${OBJS} ${LIBC} ${LDADD}  CLEANFILES+=    ${DPSRCS}
   .if defined(YHEADER)
   CLEANFILES+=    ${SRCS:M*.y:.y=.h}
   .endif
   
 .else defined(LDONLY)  .if !empty(SRCS:N*.h:N*.sh:N*.fth)
   OBJS+=          ${SRCS:N*.h:N*.sh:N*.fth:R:S/$/.o/g}
   LOBJS+=         ${LSRCS:.c=.ln} ${SRCS:M*.c:.c=.ln}
   .endif
   
 ${PROG}: ${LIBCRT0} ${OBJS} ${LIBC} ${DPADD}  .if defined(OBJS) && !empty(OBJS)
         ${CC} ${LDFLAGS} -o ${.TARGET} ${OBJS} ${LDADD}  .NOPATH: ${OBJS}
   .if defined(DESTDIR)
   
   ${PROG}: ${LIBCRT0} ${DPSRCS} ${OBJS} ${LIBC} ${LIBCRTBEGIN} ${LIBCRTEND} ${DPADD}
   .if !commands(${PROG})
           ${CC} ${LDFLAGS} ${LDSTATIC} -o ${.TARGET} -nostdlib -Wl,-rpath-link,${DESTDIR}/usr/lib ${LIBCRT0} ${LIBCRTBEGIN} ${OBJS} ${LDADD} -L${DESTDIR}/usr/lib -lgcc -lc -lgcc ${LIBCRTEND}
 .endif  .endif
   
 .else  .else
   
 SRCS=   ${PROG}.c  ${PROG}: ${LIBCRT0} ${DPSRCS} ${OBJS} ${LIBC} ${LIBCRTBEGIN} ${LIBCRTEND} ${DPADD}
   .if !commands(${PROG})
           ${CC} ${LDFLAGS} ${LDSTATIC} -o ${.TARGET} ${OBJS} ${LDADD}
   .endif
   
 ${PROG}: ${SRCS} ${LIBC} ${DPADD}  .endif  # defined(DESTDIR)
         ${CC} ${LDFLAGS} ${CFLAGS} -o ${.TARGET} ${.CURDIR}/${SRCS} ${LDADD}  .endif  # defined(OBJS) && !empty(OBJS)
   
 MKDEP=  -p  .if !defined(MAN)
   MAN=    ${PROG}.1
   .endif  # !defined(MAN)
   .endif  # defined(PROG)
   
 .endif  realall: ${PROG} ${SCRIPTS}
   
 .if     !defined(MAN1) && !defined(MAN2) && !defined(MAN3) && \  cleanprog:
         !defined(MAN4) && !defined(MAN5) && !defined(MAN6) && \          rm -f a.out [Ee]rrs mklog core *.core \
         !defined(MAN7) && !defined(MAN8)              ${PROG} ${OBJS} ${LOBJS} ${CLEANFILES}
 MAN1=   ${PROG}.0  
 .endif  .if defined(SRCS) && !target(afterdepend)
   afterdepend: .depend
           @(TMP=/tmp/_depend$$$$; \
               sed -e 's/^\([^\.]*\).o[ ]*:/\1.o \1.ln:/' \
                 < .depend > $$TMP; \
               mv $$TMP .depend)
 .endif  .endif
   
 .MAIN: all  .if defined(PROG) && !target(proginstall)
 all: ${PROG}  PROGNAME?=${PROG}
   
 .if !target(clean)  proginstall:: ${DESTDIR}${BINDIR}/${PROGNAME}
 clean:  .PRECIOUS: ${DESTDIR}${BINDIR}/${PROGNAME}
         rm -f a.out [Ee]rrs mklog core ${PROG} ${OBJS} ${CLEANFILES}  .if !defined(UPDATE)
   .PHONY: ${DESTDIR}${BINDIR}/${PROGNAME}
 .endif  .endif
   
 cleandir: clean  __proginstall: .USE
           ${INSTALL} ${RENAME} ${PRESERVE} ${COPY} ${STRIPFLAG} ${INSTPRIV} \
               -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} ${.ALLSRC} ${.TARGET}
   
 .if !target(install)  .if !defined(BUILD) && !make(all) && !make(${PROG})
 .if !target(beforeinstall)  ${DESTDIR}${BINDIR}/${PROGNAME}: .MADE
 beforeinstall:  
 .if defined(DESTDIR) || defined(BINDIR)  
         @install -d -o root -g wheel -m 755 ${DESTDIR}${BINDIR}  
 .endif  
 .endif  .endif
 .if !target(afterinstall)  ${DESTDIR}${BINDIR}/${PROGNAME}: ${PROG} __proginstall
 afterinstall:  
 .endif  .endif
   
 .if !target(realinstall)  .if !target(proginstall)
 realinstall:  proginstall::
 .if defined(PROG)  
         install ${COPY} ${STRIP} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \  
             ${PROG} ${DESTDIR}${BINDIR}  
 .endif  
 .if defined(HIDEGAME)  
         (cd ${DESTDIR}/usr/games; rm -f ${PROG}; ln -s dm ${PROG}; \  
             chown games.bin ${PROG})  
 .endif  
 .endif  .endif
   
 install: maninstall  .if defined(SCRIPTS) && !target(scriptsinstall)
 .if defined(LINKS) && !empty(LINKS)  SCRIPTSDIR?=${BINDIR}
         @set ${LINKS}; \  SCRIPTSOWN?=${BINOWN}
         while test $$# -ge 2; do \  SCRIPTSGRP?=${BINGRP}
                 l=${DESTDIR}$$1; \  SCRIPTSMODE?=${BINMODE}
                 shift; \  
                 t=${DESTDIR}$$1; \  
                 shift; \  
                 echo $$t -\> $$l; \  
                 rm -f $$t; \  
                 ln $$l $$t; \  
         done; true  
 .endif  
   
 maninstall: afterinstall  scriptsinstall:: ${SCRIPTS:@S@${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}@}
 afterinstall: realinstall  .PRECIOUS: ${SCRIPTS:@S@${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}@}
 realinstall: beforeinstall  .if !defined(UPDATE)
   .PHONY: ${SCRIPTS:@S@${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}@}
 .endif  .endif
   
 .if !target(lint)  __scriptinstall: .USE
 lint: ${SRCS}          ${INSTALL} ${RENAME} ${PRESERVE} ${COPY} ${INSTPRIV} \
 .if defined(PROG)              -o ${SCRIPTSOWN_${.ALLSRC:T}:U${SCRIPTSOWN}} \
         @${LINT} ${LINTFLAGS} ${CFLAGS} ${.ALLSRC} | more 2>&1              -g ${SCRIPTSGRP_${.ALLSRC:T}:U${SCRIPTSGRP}} \
               -m ${SCRIPTSMODE_${.ALLSRC:T}:U${SCRIPTSMODE}} \
               ${.ALLSRC} ${.TARGET}
   
   .for S in ${SCRIPTS:O:u}
   .if !defined(BUILD) && !make(all) && !make(${S})
   ${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}: .MADE
 .endif  .endif
   ${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}: ${S} __scriptinstall
   .endfor
 .endif  .endif
   
 .if !defined(NOMAN)  .if !target(scriptsinstall)
 .include <bsd.man.mk>  scriptsinstall::
 .endif  .endif
   
 .include <bsd.obj.mk>  lint: ${LOBJS}
   .if defined(LOBJS) && !empty(LOBJS)
           ${LINT} ${LINTFLAGS} ${LDFLAGS:M-L*} ${LOBJS} ${LDADD}
   .endif
   
   .include <bsd.man.mk>
   .include <bsd.nls.mk>
   .include <bsd.files.mk>
   .include <bsd.inc.mk>
   .include <bsd.links.mk>
 .include <bsd.dep.mk>  .include <bsd.dep.mk>
   .include <bsd.sys.mk>
   
   # Make sure all of the standard targets are defined, even if they do nothing.
   regress:

Legend:
Removed from v.1.27  
changed lines
  Added in v.1.131

CVSweb <webmaster@jp.NetBSD.org>