[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.1.1.1 and 1.56

version 1.1.1.1, 1993/03/21 09:45:37 version 1.56, 1996/10/18 02:34:47
Line 1 
Line 1 
   #       $NetBSD$
 #       @(#)bsd.prog.mk 5.26 (Berkeley) 6/25/91  #       @(#)bsd.prog.mk 5.26 (Berkeley) 6/25/91
   
 .if exists(${.CURDIR}/../Makefile.inc)  .if exists(${.CURDIR}/../Makefile.inc)
 .include "${.CURDIR}/../Makefile.inc"  .include "${.CURDIR}/../Makefile.inc"
 .endif  .endif
   
 .SUFFIXES: .out .o .c .y .l .s .8 .7 .6 .5 .4 .3 .2 .1 .0  .include <bsd.own.mk>
   
 .8.0 .7.0 .6.0 .5.0 .4.0 .3.0 .2.0 .1.0:  .SUFFIXES: .out .o .c .cc .C .y .l .s .8 .7 .6 .5 .4 .3 .2 .1 .0
         nroff -mandoc ${.IMPSRC} > ${.TARGET}  
   
 CFLAGS+=${COPTS}  CFLAGS+=        ${COPTS}
   
 STRIP?= -s  LIBCRT0?=       ${DESTDIR}/usr/lib/crt0.o
   LIBC?=          ${DESTDIR}/usr/lib/libc.a
 BINGRP?=        bin  LIBCOMPAT?=     ${DESTDIR}/usr/lib/libcompat.a
 BINOWN?=        bin  LIBCRYPT?=      ${DESTDIR}/usr/lib/libcrypt.a
 BINMODE?=       555  LIBCURSES?=     ${DESTDIR}/usr/lib/libcurses.a
   LIBDBM?=        ${DESTDIR}/usr/lib/libdbm.a
 LIBC?=          /usr/lib/libc.a  LIBDES?=        ${DESTDIR}/usr/lib/libdes.a
 LIBCOMPAT?=     /usr/lib/libcompat.a  LIBEDIT?=       ${DESTDIR}/usr/lib/libedit.a
 LIBCURSES?=     /usr/lib/libcurses.a  LIBGCC?=        ${DESTDIR}/usr/lib/libgcc.a
 LIBDBM?=        /usr/lib/libdbm.a  LIBKDB?=        ${DESTDIR}/usr/lib/libkdb.a
 LIBDES?=        /usr/lib/libdes.a  LIBKRB?=        ${DESTDIR}/usr/lib/libkrb.a
 LIBL?=          /usr/lib/libl.a  LIBKVM?=        ${DESTDIR}/usr/lib/libkvm.a
 LIBKDB?=        /usr/lib/libkdb.a  LIBL?=          ${DESTDIR}/usr/lib/libl.a
 LIBKRB?=        /usr/lib/libkrb.a  LIBM?=          ${DESTDIR}/usr/lib/libm.a
 LIBM?=          /usr/lib/libm.a  LIBMP?=         ${DESTDIR}/usr/lib/libmp.a
 LIBMP?=         /usr/lib/libmp.a  LIBPC?=         ${DESTDIR}/usr/lib/libpc.a
 LIBPC?=         /usr/lib/libpc.a  LIBPLOT?=       ${DESTDIR}/usr/lib/libplot.a
 LIBPLOT?=       /usr/lib/libplot.a  LIBRESOLV?=     ${DESTDIR}/usr/lib/libresolv.a
 LIBRESOLV?=     /usr/lib/libresolv.a  LIBRPCSVC?=     ${DESTDIR}/usr/lib/librpcsvc.a
 LIBRPC?=        /usr/lib/sunrpc.a  LIBSKEY?=       ${DESTDIR}/usr/lib/libskey.a
 LIBTERM?=       /usr/lib/libterm.a  LIBTERMCAP?=    ${DESTDIR}/usr/lib/libtermcap.a
 LIBUTIL?=       /usr/lib/libutil.a  LIBUTIL?=       ${DESTDIR}/usr/lib/libutil.a
   LIBY?=          ${DESTDIR}/usr/lib/liby.a
   
 .if defined(SHAREDSTRINGS)  .if defined(SHAREDSTRINGS)
 CLEANFILES+=strings  CLEANFILES+=strings
Line 40  CLEANFILES+=strings
Line 41  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
   
   .cc.o:
           ${CXX} -E ${CXXFLAGS} ${.IMPSRC} | xstr -c -
           @mv -f x.c x.cc
           @${CXX} ${CXXFLAGS} -c x.cc -o ${.TARGET}
           @rm -f x.cc
   
   .C.o:
           ${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
   .if !empty(SRCS:N*.h:N*.sh)
   OBJS+=  ${SRCS:N*.h:N*.sh:R:S/$/.o/g}
   LOBJS+= ${LSRCS:.c=.ln} ${SRCS:M*.c:.c=.ln}
   .endif
   
 ${PROG}: ${OBJS} ${LIBC} ${DPADD}  .if defined(OBJS) && !empty(OBJS)
         ${CC} ${LDFLAGS} -o ${.TARGET} ${OBJS} ${LDADD}  .if defined(DESTDIR)
   
 .else defined(PROG)  ${PROG}: ${LIBCRT0} ${OBJS} ${LIBC} ${DPADD}
           ${CC} ${LDFLAGS} ${LDSTATIC} -o ${.TARGET} -nostdlib -L${DESTDIR}/usr/lib ${LIBCRT0} ${OBJS} ${LDADD} -lgcc -lc -lgcc
   
 SRCS= ${PROG}.c  .else
   
 ${PROG}: ${SRCS} ${LIBC} ${DPADD}  ${PROG}: ${LIBCRT0} ${OBJS} ${LIBC} ${DPADD}
         ${CC} ${CFLAGS} -o ${.TARGET} ${.CURDIR}/${SRCS} ${LDADD}          ${CC} ${LDFLAGS} ${LDSTATIC} -o ${.TARGET} ${OBJS} ${LDADD}
   
 MKDEP=  -p  .endif  # defined(DESTDIR)
   .endif  # defined(OBJS) && !empty(OBJS)
   
 .endif  .if     !defined(MAN)
   MAN=    ${PROG}.1
 .if     !defined(MAN1) && !defined(MAN2) && !defined(MAN3) && \  .endif  # !defined(MAN)
         !defined(MAN4) && !defined(MAN5) && !defined(MAN6) && \  .endif  # defined(PROG)
         !defined(MAN7) && !defined(MAN8) && !defined(NOMAN)  
 MAN1=   ${PROG}.0  
 .endif  
 .endif  
 MANALL= ${MAN1} ${MAN2} ${MAN3} ${MAN4} ${MAN5} ${MAN6} ${MAN7} ${MAN8}  
   
 _PROGSUBDIR: .USE  
 .if defined(SUBDIR) && !empty(SUBDIR)  
         @for entry in ${SUBDIR}; do \  
                 (echo "===> $$entry"; \  
                 if test -d ${.CURDIR}/$${entry}.${MACHINE}; then \  
                         cd ${.CURDIR}/$${entry}.${MACHINE}; \  
                 else \  
                         cd ${.CURDIR}/$${entry}; \  
                 fi; \  
                 ${MAKE} ${.TARGET:S/realinstall/install/:S/.depend/depend/}); \  
         done  
 .endif  
   
 .MAIN: all  .MAIN: all
 all: ${PROG} ${MANALL} _PROGSUBDIR  all: ${PROG} _SUBDIRUSE
   
 .if !target(clean)  .if !target(clean)
 clean: _PROGSUBDIR  clean: _SUBDIRUSE
         rm -f a.out [Ee]rrs mklog core ${PROG} ${OBJS} ${CLEANFILES}          rm -f a.out [Ee]rrs mklog core *.core \
               ${PROG} ${OBJS} ${LOBJS} ${CLEANFILES}
 .endif  .endif
   
 .if !target(cleandir)  cleandir: _SUBDIRUSE clean
 cleandir: _PROGSUBDIR  
         rm -f a.out [Ee]rrs mklog core ${PROG} ${OBJS} ${CLEANFILES}  
         rm -f .depend ${MANALL}  
 .endif  
   
 # some of the rules involve .h sources, so remove them from mkdep line  
 .if !target(depend)  
 depend: .depend _PROGSUBDIR  
 .depend: ${SRCS}  
 .if defined(PROG)  
         mkdep ${MKDEP} ${CFLAGS:M-[ID]*} ${.ALLSRC:M*.c}  
 .endif  
 .endif  
   
 .if !target(install)  .if !target(install)
 .if !target(beforeinstall)  .if !target(beforeinstall)
Line 113  beforeinstall:
Line 101  beforeinstall:
 afterinstall:  afterinstall:
 .endif  .endif
   
 realinstall: _PROGSUBDIR  .if !target(realinstall)
   realinstall:
 .if defined(PROG)  .if defined(PROG)
         install ${STRIP} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \          ${INSTALL} ${COPY} ${STRIP} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
             ${PROG} ${DESTDIR}${BINDIR}              ${PROG} ${DESTDIR}${BINDIR}
 .endif  .endif
 .if defined(HIDEGAME)  .if defined(HIDEGAME)
         (cd ${DESTDIR}/usr/games; rm -f ${PROG}; ln -s dm ${PROG}; \          (cd ${DESTDIR}/usr/games; rm -f ${PROG}; ln -s dm ${PROG})
             chown games.bin ${PROG})  
 .endif  .endif
   .endif
   
   install: maninstall _SUBDIRUSE
 .if defined(LINKS) && !empty(LINKS)  .if defined(LINKS) && !empty(LINKS)
         @set ${LINKS}; \          @set ${LINKS}; \
         while test $$# -ge 2; do \          while test $$# -ge 2; do \
Line 135  realinstall: _PROGSUBDIR
Line 126  realinstall: _PROGSUBDIR
         done; true          done; true
 .endif  .endif
   
 install: maninstall  
 maninstall: afterinstall  maninstall: afterinstall
 afterinstall: realinstall  afterinstall: realinstall
 realinstall: beforeinstall  realinstall: beforeinstall
 .endif  .endif
   
 .if !target(lint)  .if !target(lint)
 lint: ${SRCS} _PROGSUBDIR  lint: ${LOBJS}
 .if defined(PROG)  .if defined(LOBJS) && !empty(LOBJS)
         @${LINT} ${LINTFLAGS} ${CFLAGS} ${.ALLSRC} | more 2>&1          @${LINT} ${LINTFLAGS} ${LDFLAGS:M-L*} ${LOBJS} ${LDADD}
 .endif  .endif
 .endif  .endif
   
 .if !target(obj)  .if !defined(NOMAN)
 .if defined(NOOBJ)  .include <bsd.man.mk>
 obj: _PROGSUBDIR  
 .else  
 obj: _PROGSUBDIR  
         @cd ${.CURDIR}; rm -rf obj; \  
         here=`pwd`; dest=/usr/obj/`echo $$here | sed 's,/usr/src/,,'`; \  
         echo "$$here -> $$dest"; ln -s $$dest obj; \  
         if test -d /usr/obj -a ! -d $$dest; then \  
                 mkdir -p $$dest; \  
         else \  
                 true; \  
         fi;  
 .endif  
 .endif  .endif
   
 .if !target(tags)  .if !defined(NONLS)
 tags: ${SRCS} _PROGSUBDIR  .include <bsd.nls.mk>
 .if defined(PROG)  
         -cd ${.CURDIR}; ctags -f /dev/stdout ${.ALLSRC} | \  
             sed "s;\${.CURDIR}/;;" > tags  
 .endif  
 .endif  .endif
   
 .if !defined(NOMAN)  .include <bsd.obj.mk>
 .include <bsd.man.mk>  .include <bsd.dep.mk>
 .endif  .include <bsd.subdir.mk>
   .include <bsd.sys.mk>

Legend:
Removed from v.1.1.1.1  
changed lines
  Added in v.1.56

CVSweb <webmaster@jp.NetBSD.org>