[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.17 and 1.104

version 1.17, 1993/06/04 14:47:21 version 1.104, 1999/09/14 01:31:11
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
   LIBCOMPAT?=     ${DESTDIR}/usr/lib/libcompat.a
 LIBCRT0?=       /usr/lib/crt0.o  LIBCRYPT?=      ${DESTDIR}/usr/lib/libcrypt.a
 LIBC?=          /usr/lib/libc.a  LIBCURSES?=     ${DESTDIR}/usr/lib/libcurses.a
 LIBCOMPAT?=     /usr/lib/libcompat.a  LIBDBM?=        ${DESTDIR}/usr/lib/libdbm.a
 .ifndef EXPORTABLE_SYSTEM  LIBDES?=        ${DESTDIR}/usr/lib/libdes.a
 LIBCRYPT?=      /usr/lib/libcrypt.a  LIBEDIT?=       ${DESTDIR}/usr/lib/libedit.a
 .endif  LIBGCC?=        ${DESTDIR}/usr/lib/libgcc.a
 LIBCURSES?=     /usr/lib/libcurses.a  LIBGNUMALLOC?=  ${DESTDIR}/usr/lib/libgnumalloc.a
 LIBDBM?=        /usr/lib/libdbm.a  LIBIPSEC?=      ${DESTDIR}/usr/lib/libipsec.a
 LIBDES?=        /usr/lib/libdes.a  LIBKDB?=        ${DESTDIR}/usr/lib/libkdb.a
 LIBL?=          /usr/lib/libl.a  LIBKRB?=        ${DESTDIR}/usr/lib/libkrb.a
 LIBKDB?=        /usr/lib/libkdb.a  LIBKVM?=        ${DESTDIR}/usr/lib/libkvm.a
 LIBKRB?=        /usr/lib/libkrb.a  LIBL?=          ${DESTDIR}/usr/lib/libl.a
 LIBM?=          /usr/lib/libm.a  LIBM?=          ${DESTDIR}/usr/lib/libm.a
 LIBMP?=         /usr/lib/libmp.a  LIBMP?=         ${DESTDIR}/usr/lib/libmp.a
 LIBPC?=         /usr/lib/libpc.a  LIBNTP?=        ${DESTDIR}/usr/lib/libntp.a
 LIBPLOT?=       /usr/lib/libplot.a  LIBOBJC?=       ${DESTDIR}/usr/lib/libobjc.a
 LIBRESOLV?=     /usr/lib/libresolv.a  LIBPC?=         ${DESTDIR}/usr/lib/libpc.a
 LIBRPC?=        /usr/lib/librpc.a  LIBPCAP?=       ${DESTDIR}/usr/lib/libpcap.a
 LIBRPCSVC?=     /usr/lib/librpcsvc.a  LIBPLOT?=       ${DESTDIR}/usr/lib/libplot.a
 LIBTERM?=       /usr/lib/libterm.a  LIBPOSIX?=      ${DESTDIR}/usr/lib/libposix.a
 LIBUTIL?=       /usr/lib/libutil.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 45  CLEANFILES+=strings
Line 69  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
 .if defined(PROG)  
 .if defined(SRCS)  
 OBJS+=  ${SRCS:R:S/$/.o/g}  
 .if defined(LDONLY)  
 ${PROG}: ${LIBCRT0} ${LIBC} ${OBJS} ${DPADD}  
         ${LD} ${LDFLAGS} -o ${.TARGET} ${LIBCRT0} ${OBJS} ${LIBC} ${LDADD}  
 .else defined(LDONLY)  
 ${PROG}: ${OBJS} ${LIBC} ${DPADD}  
         ${CC} ${LDFLAGS} -o ${.TARGET} ${OBJS} ${LDADD}  
           ${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
 .else defined(PROG)  
 SRCS= ${PROG}.c  
 ${PROG}: ${SRCS} ${LIBC} ${DPADD}  
         ${CC} ${LDFLAGS} ${CFLAGS} -o ${.TARGET} ${.CURDIR}/${SRCS} ${LDADD}  
 MKDEP=  -p  
 .endif  .if defined(PROG)
   SRCS?=          ${PROG}.c
 .if     !defined(MAN1) && !defined(MAN2) && !defined(MAN3) && \  DPSRCS+=        ${SRCS:M*.l:.l=.c} ${SRCS:M*.y:.y=.c}
         !defined(MAN4) && !defined(MAN5) && !defined(MAN6) && \  CLEANFILES+=    ${DPSRCS}
         !defined(MAN7) && !defined(MAN8)  .if defined(YHEADER)
 MAN1=   ${PROG}.0  CLEANFILES+=    ${SRCS:M*.y:.y=.h}
 .endif  .endif
 .if !defined(NOMAN)  .if !empty(SRCS:N*.h:N*.sh)
 MANALL= ${MAN1} ${MAN2} ${MAN3} ${MAN4} ${MAN5} ${MAN6} ${MAN7} ${MAN8}  OBJS+=          ${SRCS:N*.h:N*.sh:R:S/$/.o/g}
   LOBJS+=         ${LSRCS:.c=.ln} ${SRCS:M*.c:.c=.ln}
 .endif  .endif
 _PROGSUBDIR: .USE  .if defined(OBJS) && !empty(OBJS)
 .if defined(SUBDIR) && !empty(SUBDIR)  .NOPATH: ${OBJS}
         @for entry in ${SUBDIR}; do \  .if defined(DESTDIR)
                 (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/}); \  
 all: ${PROG} ${MANALL} _PROGSUBDIR          ${CC} ${LDFLAGS} ${LDSTATIC} -o ${.TARGET} -nostdlib -L${DESTDIR}/usr/lib ${LIBCRT0} ${LIBCRTBEGIN} ${OBJS} ${LDADD} -lgcc -lc -lgcc ${LIBCRTEND}
 .if !target(clean)  .else
 clean: _PROGSUBDIR  
         rm -f a.out [Ee]rrs mklog core ${PROG} ${OBJS} ${CLEANFILES}  
 .if !target(cleandir)  ${PROG}: ${LIBCRT0} ${DPSRCS} ${OBJS} ${LIBC} ${LIBCRTBEGIN} ${LIBCRTEND} ${DPADD}
 cleandir: _PROGSUBDIR          ${CC} ${LDFLAGS} ${LDSTATIC} -o ${.TARGET} ${OBJS} ${LDADD}
         rm -f a.out [Ee]rrs mklog core ${PROG} ${OBJS} ${CLEANFILES}  
         rm -f .depend ${MANALL}  
 # some of the rules involve .h sources, so remove them from mkdep line  .endif  # defined(DESTDIR)
 .if !target(depend)  .endif  # defined(OBJS) && !empty(OBJS)
 depend: .depend _PROGSUBDIR  
 .depend: ${SRCS}  
 .if defined(PROG)  
         mkdep ${MKDEP} ${CFLAGS:M-[ID+]*} ${.ALLSRC:M*.c}  
 .if !target(install)  .if !defined(MAN)
 .if !target(beforeinstall)  MAN=    ${PROG}.1
 beforeinstall:  .endif  # !defined(MAN)
 .if defined(DESTDIR) || defined(BINDIR)  .endif  # defined(PROG)
         @if [ ! -d "${DESTDIR}${BINDIR}" ]; then \  
                 /bin/rm -f ${DESTDIR}${BINDIR} ; \  all: ${PROG}
                 mkdir -p ${DESTDIR}${BINDIR} ; \  
                 chown root.wheel ${DESTDIR}${BINDIR} ; \  cleanprog:
                 chmod 755 ${DESTDIR}${BINDIR} ; \          rm -f a.out [Ee]rrs mklog core *.core \
         else \              ${PROG} ${OBJS} ${LOBJS} ${CLEANFILES}
                 true ; \  
 .if !target(afterinstall)  
 .if !target(realinstall)  .if defined(SRCS)
 realinstall: _PROGSUBDIR  afterdepend: .depend
 .if defined(PROG)          @(TMP=/tmp/_depend$$$$; \
         install ${COPY} ${STRIP} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \              sed -e 's/^\([^\.]*\).o[ ]*:/\1.o \1.ln:/' \
             ${PROG} ${DESTDIR}${BINDIR}                < .depend > $$TMP; \
 .endif              mv $$TMP .depend)
 .if defined(HIDEGAME)  .endif
         (cd ${DESTDIR}/usr/games; rm -f ${PROG}; ln -s dm ${PROG}; \  
             chown games.bin ${PROG})  .if defined(PROG) && !target(proginstall)
 .endif  PROGNAME?= ${PROG}
 .if defined(LINKS) && !empty(LINKS)  proginstall:: ${DESTDIR}${BINDIR}/${PROGNAME}
         @set ${LINKS}; \  .if !defined(UPDATE)
         while test $$# -ge 2; do \  .PHONY: ${DESTDIR}${BINDIR}/${PROGNAME}
                 l=${DESTDIR}$$1; \  .endif
                 shift; \  .if !defined(BUILD) && !make(all) && !make(${PROG})
                 t=${DESTDIR}$$1; \  ${DESTDIR}${BINDIR}/${PROGNAME}: .MADE
                 shift; \  .endif
                 echo $$t -\> $$l; \  
                 rm -f $$t; \  .PRECIOUS: ${DESTDIR}${BINDIR}/${PROGNAME}
                 ln $$l $$t; \  ${DESTDIR}${BINDIR}/${PROGNAME}: ${PROG}
         done; true          ${INSTALL} ${RENAME} ${PRESERVE} ${COPY} ${STRIPFLAG} ${INSTPRIV} \
               -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} ${.ALLSRC} ${.TARGET}
   .if !target(proginstall)
   .if defined(SCRIPTS) && !target(scriptsinstall)
   .for S in ${SCRIPTS}
   .if defined(SCRIPTSNAME)
   SCRIPTSNAME_${S} ?= ${S:T:R}
 .endif  .endif
   scriptsinstall:: ${DESTDIR}${SCRIPTSDIR_${S}}/${SCRIPTSNAME_${S}}
   .if !defined(UPDATE)
 .endif  .endif
   .if !defined(BUILD) && !make(all) && !make(${S})
 install: maninstall  ${DESTDIR}${SCRIPTSDIR_${S}}/${SCRIPTSNAME_${S}}: .MADE
 maninstall: afterinstall  
 afterinstall: realinstall  
 realinstall: beforeinstall  
 .endif  .endif
 .if !target(lint)  .PRECIOUS: ${DESTDIR}${SCRIPTSDIR_${S}}/${SCRIPTSNAME_${S}}
 .if defined(PROG)          ${INSTALL} ${RENAME} ${PRESERVE} ${COPY} ${INSTPRIV} \
         @${LINT} ${LINTFLAGS} ${CFLAGS} ${.ALLSRC} | more 2>&1              -o ${SCRIPTSOWN_${S}} -g ${SCRIPTSGRP_${S}} -m ${SCRIPTSMODE_${S}} \
 .endif              ${.ALLSRC} ${.TARGET}
 .endif  .endif
 .if !target(obj)  .if !target(scriptsinstall)
 .if defined(NOOBJ)  scriptsinstall::
         @cd ${.CURDIR}; rm -f obj > /dev/null 2>&1 || true; \  
         here=`pwd`; subdir=`echo $$here | sed 's,^/usr/src/,,'`; \  
         if test $$here != $$subdir ; then \  
                 dest=/usr/obj/$$subdir ; \  
                 echo "$$here -> $$dest"; ln -s $$dest obj; \  
                 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 ; \  
 .endif  .endif
 .if !target(tags)  lint: ${LOBJS}
 tags: ${SRCS} _PROGSUBDIR  .if defined(LOBJS) && !empty(LOBJS)
 .if defined(PROG)          ${LINT} ${LINTFLAGS} ${LDFLAGS:M-L*} ${LOBJS} ${LDADD}
         -cd ${.CURDIR}; ctags -f /dev/stdout ${.ALLSRC} | \  
             sed "s;\${.CURDIR}/;;" > tags  
 .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.1.17  
changed lines
  Added in v.1.104

CVSweb <webmaster@jp.NetBSD.org>