[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 and 1.125

version, 1993/03/21 09:45:37 version 1.125, 2001/01/14 09:40:35
Line 1 
Line 1 
 #       @(#)bsd.prog.mk 5.26 (Berkeley) 6/25/91  #       $NetBSD$
   #       @(#)bsd.prog.mk 8.2 (Berkeley) 4/2/94
   .if !target(__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
   .PHONY:         cleanprog proginstall scriptsinstall
   realinstall:    proginstall scriptsinstall
   clean cleandir distclean: cleanprog
   CFLAGS+=        ${COPTS}
   # ELF platforms depend on crtbegin.o and crtend.o
   .if ${OBJECT_FMT} == "ELF"
   LIBCRTBEGIN?=   ${DESTDIR}/usr/lib/crtbegin.o
   LIBCRTEND?=     ${DESTDIR}/usr/lib/crtend.o
 .SUFFIXES: .out .o .c .y .l .s .8 .7 .6 .5 .4 .3 .2 .1 .0  LIBCRT0?=       ${DESTDIR}/usr/lib/crt0.o
 .8.0 .7.0 .6.0 .5.0 .4.0 .3.0 .2.0 .1.0:  
         nroff -mandoc ${.IMPSRC} > ${.TARGET}  
 STRIP?= -s  
 BINGRP?=        bin  LIBBZ2?=        ${DESTDIR}/usr/lib/libbz2.a
 BINOWN?=        bin  LIBC?=          ${DESTDIR}/usr/lib/libc.a
 BINMODE?=       555  LIBC_PIC?=      ${DESTDIR}/usr/lib/libc_pic.a
   LIBCDK?=        ${DESTDIR}/usr/lib/libcdk.a
 LIBC?=          /usr/lib/libc.a  LIBCOM_ERR?=    ${DESTDIR}/usr/lib/libcom_err.a
 LIBCOMPAT?=     /usr/lib/libcompat.a  LIBCOMPAT?=     ${DESTDIR}/usr/lib/libcompat.a
 LIBCURSES?=     /usr/lib/libcurses.a  LIBCRYPT?=      ${DESTDIR}/usr/lib/libcrypt.a
 LIBDBM?=        /usr/lib/libdbm.a  LIBCRYPTO?=     ${DESTDIR}/usr/lib/libcrypto.a
 LIBDES?=        /usr/lib/libdes.a  LIBCRYPTO_RC5?= ${DESTDIR}/usr/lib/libcrypto_rc5.a
 LIBL?=          /usr/lib/libl.a  LIBCRYPTO_IDEA?=${DESTDIR}/usr/lib/libcrypto_idea.a
 LIBKDB?=        /usr/lib/libkdb.a  LIBCURSES?=     ${DESTDIR}/usr/lib/libcurses.a
 LIBKRB?=        /usr/lib/libkrb.a  LIBDBM?=        ${DESTDIR}/usr/lib/libdbm.a
 LIBM?=          /usr/lib/libm.a  LIBDES?=        ${DESTDIR}/usr/lib/libdes.a
 LIBMP?=         /usr/lib/libmp.a  LIBEDIT?=       ${DESTDIR}/usr/lib/libedit.a
 LIBPC?=         /usr/lib/libpc.a  LIBFORM?=       ${DESTDIR}/usr/lib/libform.a
 LIBPLOT?=       /usr/lib/libplot.a  LIBGCC?=        ${DESTDIR}/usr/lib/libgcc.a
 LIBRESOLV?=     /usr/lib/libresolv.a  LIBGNUMALLOC?=  ${DESTDIR}/usr/lib/libgnumalloc.a
 LIBRPC?=        /usr/lib/sunrpc.a  LIBGSSAPI?=     ${DESTDIR}/usr/lib/libgssapi.a
 LIBTERM?=       /usr/lib/libterm.a  LIBHDB?=        ${DESTDIR}/usr/lib/libhdb.a
 LIBUTIL?=       /usr/lib/libutil.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/liblss.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 40  CLEANFILES+=strings
Line 88  CLEANFILES+=strings
         ${CC} -E ${CFLAGS} ${.IMPSRC} | xstr -c -          ${CC} -E ${CFLAGS} ${.IMPSRC} | xstr -c -
         @${CC} ${CFLAGS} -c x.c -o ${.TARGET}          @${CC} ${CFLAGS} -c x.c -o ${.TARGET}
         @rm -f x.c          @rm -f x.c
           ${CXX} -E ${CXXFLAGS} ${.IMPSRC} | xstr -c -
           @mv -f x.c x.cc
           @${CXX} ${CXXFLAGS} -c x.cc -o ${.TARGET}
           @rm -f x.cc
           ${CXX} -E ${CXXFLAGS} ${.IMPSRC} | xstr -c -
           @mv -f x.c x.C
           @${CXX} ${CXXFLAGS} -c x.C -o ${.TARGET}
           @rm -f x.C
 .endif  .endif
 .if defined(PROG)  
 .if defined(SRCS)  
 OBJS+=  ${SRCS:R:S/$/.o/g}  .if defined(PROG)
   SRCS?=          ${PROG}.c
 ${PROG}: ${OBJS} ${LIBC} ${DPADD}  DPSRCS+=        ${SRCS:M*.l:.l=.c} ${SRCS:M*.y:.y=.c}
         ${CC} ${LDFLAGS} -o ${.TARGET} ${OBJS} ${LDADD}  CLEANFILES+=    ${DPSRCS}
   .if defined(YHEADER)
   CLEANFILES+=    ${SRCS:M*.y:.y=.h}
 .else defined(PROG)  .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}
 SRCS= ${PROG}.c  .if defined(OBJS) && !empty(OBJS)
   .if defined(DESTDIR)
         ${CC} ${CFLAGS} -o ${.TARGET} ${.CURDIR}/${SRCS} ${LDADD}  .if !target(${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}
 MKDEP=  -p  .else
   .if !target(${PROG})
           ${CC} ${LDFLAGS} ${LDSTATIC} -o ${.TARGET} ${OBJS} ${LDADD}
 .endif  .endif
 .if     !defined(MAN1) && !defined(MAN2) && !defined(MAN3) && \  .endif  # defined(DESTDIR)
         !defined(MAN4) && !defined(MAN5) && !defined(MAN6) && \  .endif  # defined(OBJS) && !empty(OBJS)
         !defined(MAN7) && !defined(MAN8) && !defined(NOMAN)  
 MAN1=   ${PROG}.0  
 MANALL= ${MAN1} ${MAN2} ${MAN3} ${MAN4} ${MAN5} ${MAN6} ${MAN7} ${MAN8}  
 _PROGSUBDIR: .USE  .if !defined(MAN)
 .if defined(SUBDIR) && !empty(SUBDIR)  MAN=    ${PROG}.1
         @for entry in ${SUBDIR}; do \  .endif  # !defined(MAN)
                 (echo "===> $$entry"; \  .endif  # defined(PROG)
                 if test -d ${.CURDIR}/$${entry}.${MACHINE}; then \  
                         cd ${.CURDIR}/$${entry}.${MACHINE}; \  
                 else \  
                         cd ${.CURDIR}/$${entry}; \  
                 fi; \  
                 ${MAKE} ${.TARGET:S/realinstall/install/:S/.depend/depend/}); \  
 .MAIN: all  realall: ${PROG} ${SCRIPTS}
 .if !target(clean)  cleanprog:
 clean: _PROGSUBDIR          rm -f a.out [Ee]rrs mklog core *.core \
         rm -f a.out [Ee]rrs mklog core ${PROG} ${OBJS} ${CLEANFILES}              ${PROG} ${OBJS} ${LOBJS} ${CLEANFILES}
 .if !target(cleandir)  .if defined(SRCS)
 cleandir: _PROGSUBDIR  afterdepend: .depend
         rm -f a.out [Ee]rrs mklog core ${PROG} ${OBJS} ${CLEANFILES}          @(TMP=/tmp/_depend$$$$; \
         rm -f .depend ${MANALL}              sed -e 's/^\([^\.]*\).o[ ]*:/\1.o \1.ln:/' \
                 < .depend > $$TMP; \
               mv $$TMP .depend)
 .endif  .endif
 # some of the rules involve .h sources, so remove them from mkdep line  .if defined(PROG) && !target(proginstall)
 .if !target(depend)  PROGNAME?=${PROG}
 depend: .depend _PROGSUBDIR  
 .depend: ${SRCS}  
 .if defined(PROG)  
         mkdep ${MKDEP} ${CFLAGS:M-[ID]*} ${.ALLSRC:M*.c}  
 .if !target(install)  proginstall:: ${DESTDIR}${BINDIR}/${PROGNAME}
 .if !target(beforeinstall)  .PRECIOUS: ${DESTDIR}${BINDIR}/${PROGNAME}
 beforeinstall:  .if !defined(UPDATE)
 .if !target(afterinstall)  
 .endif  .endif
 realinstall: _PROGSUBDIR  __proginstall: .USE
 .if defined(PROG)          ${INSTALL} ${RENAME} ${PRESERVE} ${COPY} ${STRIPFLAG} ${INSTPRIV} \
         install ${STRIP} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \              -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} ${.ALLSRC} ${.TARGET}
             ${PROG} ${DESTDIR}${BINDIR}  
   .if !defined(BUILD) && !make(all) && !make(${PROG})
 .endif  .endif
 .if defined(HIDEGAME)  ${DESTDIR}${BINDIR}/${PROGNAME}: ${PROG} __proginstall
         (cd ${DESTDIR}/usr/games; rm -f ${PROG}; ln -s dm ${PROG}; \  
             chown games.bin ${PROG})  
 .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  
 install: maninstall  
 maninstall: afterinstall  
 afterinstall: realinstall  
 realinstall: beforeinstall  
 .endif  .endif
 .if !target(lint)  .if !target(proginstall)
 lint: ${SRCS} _PROGSUBDIR  proginstall::
 .if defined(PROG)  
         @${LINT} ${LINTFLAGS} ${CFLAGS} ${.ALLSRC} | more 2>&1  
 .endif  .endif
   .if defined(SCRIPTS) && !target(scriptsinstall)
   .if !defined(UPDATE)
 .endif  .endif
 .if !target(obj)  __scriptinstall: .USE
 .if defined(NOOBJ)          ${INSTALL} ${RENAME} ${PRESERVE} ${COPY} ${INSTPRIV} \
 obj: _PROGSUBDIR              -o ${SCRIPTSOWN_${.ALLSRC:T}:U${SCRIPTSOWN}} \
 .else              -g ${SCRIPTSGRP_${.ALLSRC:T}:U${SCRIPTSGRP}} \
         @cd ${.CURDIR}; rm -rf obj; \              ${.ALLSRC} ${.TARGET}
         here=`pwd`; dest=/usr/obj/`echo $$here | sed 's,/usr/src/,,'`; \  
         echo "$$here -> $$dest"; ln -s $$dest obj; \  .for S in ${SCRIPTS}
         if test -d /usr/obj -a ! -d $$dest; then \  .if !defined(BUILD) && !make(all) && !make(${S})
                 mkdir -p $$dest; \  ${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}: .MADE
         else \  
                 true; \  
 .endif  .endif
 .endif  .endif
 .if !target(tags)  .if !target(scriptsinstall)
 tags: ${SRCS} _PROGSUBDIR  scriptsinstall::
 .if defined(PROG)  
         -cd ${.CURDIR}; ctags -f /dev/stdout ${.ALLSRC} | \  
             sed "s;\${.CURDIR}/;;" > tags  
 .endif  .endif
   lint: ${LOBJS}
   .if defined(LOBJS) && !empty(LOBJS)
           ${LINT} ${LINTFLAGS} ${LDFLAGS:M-L*} ${LOBJS} ${LDADD}
 .endif  .endif
 .if !defined(NOMAN)  
 .include <bsd.man.mk>  .include <bsd.man.mk>
 .endif  .include <bsd.nls.mk>
   .include <bsd.files.mk>
   .include <bsd.inc.mk>
   .include <bsd.links.mk>
   .include <bsd.dep.mk>
   .include <bsd.sys.mk>
   # Make sure all of the standard targets are defined, even if they do nothing.

Removed from v.  
changed lines
  Added in v.1.125

CVSweb <webmaster@jp.NetBSD.org>