[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.5 and 1.116

version 1.5, 1993/04/04 15:30:16 version 1.116, 2000/06/10 14:12:04
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__)
   __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
   
   .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
   .else
   LIBCRTBEGIN?=
   LIBCRTEND?=
   .endif
   
 .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}  
   
 CFLAGS+=${COPTS}  
   
 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
   LIBCOMPAT?=     ${DESTDIR}/usr/lib/libcompat.a
   LIBCRYPT?=      ${DESTDIR}/usr/lib/libcrypt.a
 LIBCRT0?=       /usr/lib/crt0.o  LIBCURSES?=     ${DESTDIR}/usr/lib/libcurses.a
 LIBC?=          /usr/lib/libc.a  LIBDBM?=        ${DESTDIR}/usr/lib/libdbm.a
 LIBCOMPAT?=     /usr/lib/libcompat.a  LIBDES?=        ${DESTDIR}/usr/lib/libdes.a
 LIBCURSES?=     /usr/lib/libcurses.a  LIBEDIT?=       ${DESTDIR}/usr/lib/libedit.a
 LIBDBM?=        /usr/lib/libdbm.a  LIBGCC?=        ${DESTDIR}/usr/lib/libgcc.a
 LIBDES?=        /usr/lib/libdes.a  LIBGNUMALLOC?=  ${DESTDIR}/usr/lib/libgnumalloc.a
 LIBL?=          /usr/lib/libl.a  LIBIPSEC?=      ${DESTDIR}/usr/lib/libipsec.a
 LIBKDB?=        /usr/lib/libkdb.a  LIBKDB?=        ${DESTDIR}/usr/lib/libkdb.a
 LIBKRB?=        /usr/lib/libkrb.a  LIBKRB?=        ${DESTDIR}/usr/lib/libkrb.a
 LIBM?=          /usr/lib/libm.a  LIBKVM?=        ${DESTDIR}/usr/lib/libkvm.a
 LIBMP?=         /usr/lib/libmp.a  LIBL?=          ${DESTDIR}/usr/lib/libl.a
 LIBPC?=         /usr/lib/libpc.a  LIBM?=          ${DESTDIR}/usr/lib/libm.a
 LIBPLOT?=       /usr/lib/libplot.a  LIBMENU?=       ${DESTDIR}/usr/lib/libmenu.a
 LIBRESOLV?=     /usr/lib/libresolv.a  LIBMP?=         ${DESTDIR}/usr/lib/libmp.a
 LIBRPC?=        /usr/lib/librpc.a  LIBNTP?=        ${DESTDIR}/usr/lib/libntp.a
 LIBTERM?=       /usr/lib/libterm.a  LIBOBJC?=       ${DESTDIR}/usr/lib/libobjc.a
 LIBUTIL?=       /usr/lib/libutil.a  LIBPC?=         ${DESTDIR}/usr/lib/libpc.a
   LIBPCAP?=       ${DESTDIR}/usr/lib/libpcap.a
   LIBPLOT?=       ${DESTDIR}/usr/lib/libplot.a
   LIBPOSIX?=      ${DESTDIR}/usr/lib/libposix.a
   LIBRESOLV?=     ${DESTDIR}/usr/lib/libresolv.a
   LIBRPCSVC?=     ${DESTDIR}/usr/lib/librpcsvc.a
   LIBSKEY?=       ${DESTDIR}/usr/lib/libskey.a
   LIBTERMCAP?=    ${DESTDIR}/usr/lib/libtermcap.a
   LIBTELNET?=     ${DESTDIR}/usr/lib/libtelnet.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 42  CLEANFILES+=strings
Line 70  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
 .endif  
   
 .if defined(PROG)  
 .if defined(SRCS)  
   
 OBJS+=  ${SRCS:R:S/$/.o/g}  
   
 .if defined(LDONLY)  .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
   
 ${PROG}: ${LIBCRT0} ${LIBC} ${OBJS} ${DPADD}  
         ${LD} ${LDFLAGS} -o ${.TARGET} ${LIBCRT0} ${OBJS} ${LIBC} ${LDADD}  
   
 .else defined(LDONLY)  .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}
   .endif
   
   .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  .endif
   
 .else defined(PROG)  .if defined(OBJS) && !empty(OBJS)
   .NOPATH: ${OBJS}
   .if defined(DESTDIR)
   
 SRCS= ${PROG}.c  ${PROG}: ${LIBCRT0} ${DPSRCS} ${OBJS} ${LIBC} ${LIBCRTBEGIN} ${LIBCRTEND} ${DPADD}
           ${CC} ${LDFLAGS} ${LDSTATIC} -o ${.TARGET} -nostdlib -L${DESTDIR}/usr/lib -Wl,-rpath-link,${DESTDIR}/usr/lib ${LIBCRT0} ${LIBCRTBEGIN} ${OBJS} ${LDADD} -lgcc -lc -lgcc ${LIBCRTEND}
   
 ${PROG}: ${SRCS} ${LIBC} ${DPADD}  .else
         ${CC} ${CFLAGS} -o ${.TARGET} ${.CURDIR}/${SRCS} ${LDADD}  
   
 MKDEP=  -p  ${PROG}: ${LIBCRT0} ${DPSRCS} ${OBJS} ${LIBC} ${LIBCRTBEGIN} ${LIBCRTEND} ${DPADD}
           ${CC} ${LDFLAGS} ${LDSTATIC} -o ${.TARGET} ${OBJS} ${LDADD}
   
 .endif  .endif  # defined(DESTDIR)
   .endif  # defined(OBJS) && !empty(OBJS)
   
 .if     !defined(MAN1) && !defined(MAN2) && !defined(MAN3) && \  .if !defined(MAN)
         !defined(MAN4) && !defined(MAN5) && !defined(MAN6) && \  MAN=    ${PROG}.1
         !defined(MAN7) && !defined(MAN8) && !defined(NOMAN)  .endif  # !defined(MAN)
 MAN1=   ${PROG}.0  .endif  # defined(PROG)
 .endif  
 .endif  realall: ${PROG} ${SCRIPTS}
 MANALL= ${MAN1} ${MAN2} ${MAN3} ${MAN4} ${MAN5} ${MAN6} ${MAN7} ${MAN8}  
   cleanprog:
           rm -f a.out [Ee]rrs mklog core *.core \
               ${PROG} ${OBJS} ${LOBJS} ${CLEANFILES}
   
 _PROGSUBDIR: .USE  .if defined(SRCS)
 .if defined(SUBDIR) && !empty(SUBDIR)  afterdepend: .depend
         @for entry in ${SUBDIR}; do \          @(TMP=/tmp/_depend$$$$; \
                 (echo "===> $$entry"; \              sed -e 's/^\([^\.]*\).o[ ]*:/\1.o \1.ln:/' \
                 if test -d ${.CURDIR}/$${entry}.${MACHINE}; then \                < .depend > $$TMP; \
                         cd ${.CURDIR}/$${entry}.${MACHINE}; \              mv $$TMP .depend)
                 else \  
                         cd ${.CURDIR}/$${entry}; \  
                 fi; \  
                 ${MAKE} ${.TARGET:S/realinstall/install/:S/.depend/depend/}); \  
         done  
 .endif  .endif
   
 .MAIN: all  .if defined(PROG) && !target(proginstall)
 all: ${PROG} ${MANALL} _PROGSUBDIR  PROGNAME?=${PROG}
   
 .if !target(clean)  proginstall:: ${DESTDIR}${BINDIR}/${PROGNAME}
 clean: _PROGSUBDIR  .PRECIOUS: ${DESTDIR}${BINDIR}/${PROGNAME}
         rm -f a.out [Ee]rrs mklog core ${PROG} ${OBJS} ${CLEANFILES}  .if !defined(UPDATE)
         rm -f .depend ${MANALL}  .PHONY: ${DESTDIR}${BINDIR}/${PROGNAME}
 .endif  .endif
   
 .if !target(cleandir)  __proginstall: .USE
 cleandir: _PROGSUBDIR          ${INSTALL} ${RENAME} ${PRESERVE} ${COPY} ${STRIPFLAG} ${INSTPRIV} \
         rm -f a.out [Ee]rrs mklog core ${PROG} ${OBJS} ${CLEANFILES} ${MANALL}              -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} ${.ALLSRC} ${.TARGET}
         rm -f .depend ${MANALL}  
 .endif  
   
 # some of the rules involve .h sources, so remove them from mkdep line  .if !defined(BUILD) && !make(all) && !make(${PROG})
 .if !target(depend)  ${DESTDIR}${BINDIR}/${PROGNAME}: .MADE
 depend: .depend _PROGSUBDIR  
 .depend: ${SRCS}  
 .if defined(PROG)  
         mkdep ${MKDEP} ${CFLAGS:M-[ID]*} ${.ALLSRC:M*.c}  
 .endif  .endif
   ${DESTDIR}${BINDIR}/${PROGNAME}: ${PROG} __proginstall
 .endif  .endif
   
 .if !target(install)  .if !target(proginstall)
 .if !target(beforeinstall)  proginstall::
 beforeinstall:  
 .endif  
 .if !target(afterinstall)  
 afterinstall:  
 .endif  .endif
   
 realinstall: _PROGSUBDIR  .if defined(SCRIPTS) && !target(scriptsinstall)
 .if defined(PROG)  SCRIPTSDIR?=${BINDIR}
         install -c ${STRIP} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \  SCRIPTSOWN?=${BINOWN}
             ${PROG} ${DESTDIR}${BINDIR}  SCRIPTSGRP?=${BINGRP}
 .endif  SCRIPTSMODE?=${BINMODE}
 .if defined(HIDEGAME)  
         (cd ${DESTDIR}/usr/games; rm -f ${PROG}; ln -s dm ${PROG}; \  
             chown games.bin ${PROG})  
 .endif  
 .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  
 .endif  
   
 install: maninstall  
 maninstall: afterinstall  
 afterinstall: realinstall  
 realinstall: beforeinstall  
 .endif  
   
 .if !target(lint)  scriptsinstall:: ${SCRIPTS:@S@${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}@}
 lint: ${SRCS} _PROGSUBDIR  .PRECIOUS: ${SCRIPTS:@S@${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}@}
 .if defined(PROG)  .if !defined(UPDATE)
         @${LINT} ${LINTFLAGS} ${CFLAGS} ${.ALLSRC} | more 2>&1  .PHONY: ${SCRIPTS:@S@${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}@}
 .endif  
 .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}} \
 obj: _PROGSUBDIR              -m ${SCRIPTSMODE_${.ALLSRC:T}:U${SCRIPTSMODE}} \
         @cd ${.CURDIR}; rm -f obj > /dev/null 2>&1 || true; \              ${.ALLSRC} ${.TARGET}
         here=`pwd`; subdir=`echo $$here | sed 's,^/usr/src/,,'`; \  
         if test $$here != $$subdir ; then \  .for S in ${SCRIPTS}
                 dest=/usr/obj/$$subdir ; \  .if !defined(BUILD) && !make(all) && !make(${S})
                 echo "$$here -> $$dest"; ln -s $$dest obj; \  ${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}: .MADE
                 if test -d /usr/obj -a ! -d $$dest; then \  
                         mkdir -p $$dest; \  
                 else \  
                         true; \  
                 fi; \  
         else \  
                 true ; \  
                 dest=$$here/obj ; \  
                 echo "making $$here/obj" ; \  
                 if test ! -d obj ; then \  
                         mkdir $$here/obj; \  
                 fi ; \  
         fi;  
 .endif  .endif
   ${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}: ${S} __scriptinstall
   .endfor
 .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.
   regress:

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.116

CVSweb <webmaster@jp.NetBSD.org>