[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.132 and 1.167

version 1.132, 2001/08/14 07:02:13 version 1.167, 2003/05/31 20:33:16
Line 1 
Line 1 
 #       $NetBSD$  #       $NetBSD$
 #       @(#)bsd.prog.mk 8.2 (Berkeley) 4/2/94  #       @(#)bsd.prog.mk 8.2 (Berkeley) 4/2/94
   
 .if !target(__initialized__)  .ifndef HOSTPROG
 __initialized__:  
 .if exists(${.CURDIR}/../Makefile.inc)  .include <bsd.init.mk>
 .include "${.CURDIR}/../Makefile.inc"  .include <bsd.shlib.mk>
 .endif  .include <bsd.gcc.mk>
 .include <bsd.own.mk>  
 .include <bsd.obj.mk>  
 .include <bsd.depall.mk>  
 .MAIN:          all  
 .endif  
   
 .PHONY:         cleanprog proginstall scriptsinstall  ##### Basic targets
   .PHONY:         cleanextra cleanobjs cleanprog proginstall scriptsinstall
 realinstall:    proginstall scriptsinstall  realinstall:    proginstall scriptsinstall
 clean:          cleanprog  clean:          cleanprog
   
   ##### Default values
   CPPFLAGS+=      ${DESTDIR:D-nostdinc ${CPPFLAG_ISYSTEM} ${DESTDIR}/usr/include}
   CXXFLAGS+=      ${DESTDIR:D-nostdinc++ ${CPPFLAG_ISYSTEM} ${DESTDIR}/usr/include/g++}
 CFLAGS+=        ${COPTS}  CFLAGS+=        ${COPTS}
   .if ${MACHINE_ARCH} == "sparc64"
   CFLAGS+=        -mcmodel=medlow
   .endif
   
 # ELF platforms depend on crtbegin.o and crtend.o  # ELF platforms depend on crti.o, crtbegin.o, crtend.o, and crtn.o
 .if ${OBJECT_FMT} == "ELF"  .if ${OBJECT_FMT} == "ELF"
 LIBCRTBEGIN?=   ${DESTDIR}/usr/lib/crtbegin.o  .ifndef LIBCRTBEGIN
 LIBCRTEND?=     ${DESTDIR}/usr/lib/crtend.o  LIBCRTBEGIN=    ${DESTDIR}/usr/lib/crti.o ${_GCC_CRTBEGIN}
   .MADE: ${LIBCRTBEGIN}
   .endif
   .ifndef LIBCRTEND
   LIBCRTEND=      ${_GCC_CRTEND} ${DESTDIR}/usr/lib/crtn.o
   .MADE: ${LIBCRTEND}
   .endif
   _SHLINKER=      ${SHLINKDIR}/ld.elf_so
 .else  .else
 LIBCRTBEGIN?=  LIBCRTBEGIN?=
 LIBCRTEND?=  LIBCRTEND?=
   _SHLINKER=      ${SHLINKDIR}/ld.so
 .endif  .endif
   
 LIBCRT0?=       ${DESTDIR}/usr/lib/crt0.o  .ifndef LIBCRT0
   LIBCRT0=        ${DESTDIR}/usr/lib/crt0.o
 LIBBZ2?=        ${DESTDIR}/usr/lib/libbz2.a  .MADE: ${LIBCRT0}
 LIBC?=          ${DESTDIR}/usr/lib/libc.a  .endif
 LIBC_PIC?=      ${DESTDIR}/usr/lib/libc_pic.a  
 LIBCDK?=        ${DESTDIR}/usr/lib/libcdk.a  ##### Installed system library definitions
 LIBCOM_ERR?=    ${DESTDIR}/usr/lib/libcom_err.a  #     E.g. LIBC?=${DESTDIR}/usr/lib/libc.a
 LIBCOMPAT?=     ${DESTDIR}/usr/lib/libcompat.a  #     etc..
 LIBCRYPT?=      ${DESTDIR}/usr/lib/libcrypt.a  #
 LIBCRYPTO?=     ${DESTDIR}/usr/lib/libcrypto.a  __bsd_prog_mk_system_libs?= \
 LIBCRYPTO_RC5?= ${DESTDIR}/usr/lib/libcrypto_rc5.a          BZ2 C C_PIC CDK COM_ERR COMPAT CRYPT CRYPTO CRYPTO_IDEA CRYPTO_MDC2 \
 LIBCRYPTO_IDEA?=${DESTDIR}/usr/lib/libcrypto_idea.a          CRYPTO_RC5 \
 LIBCURSES?=     ${DESTDIR}/usr/lib/libcurses.a          CURSES DBM DES EDIT FORM GCC GNUMALLOC GSSAPI HDB INTL IPSEC \
 LIBDBM?=        ${DESTDIR}/usr/lib/libdbm.a          KADM KADM5CLNT KADM5SRV KAFS KDB KRB KRB5 KSTREAM KVM L M MENU \
 LIBDES?=        ${DESTDIR}/usr/lib/libdes.a          OBJC OSSAUDIO PCAP PCI PMC POSIX PTHREAD PTHREAD_DBG RESOLV RMT \
 LIBEDIT?=       ${DESTDIR}/usr/lib/libedit.a          ROKEN RPCSVC RT SKEY SS SSL SL TERMCAP TELNET USBHID UTIL WRAP Y Z
 LIBFORM?=       ${DESTDIR}/usr/lib/libform.a  
 LIBGCC?=        ${DESTDIR}/usr/lib/libgcc.a  .for _n in ${__bsd_prog_mk_system_libs}
 LIBGNUMALLOC?=  ${DESTDIR}/usr/lib/libgnumalloc.a  .ifndef LIB${_n}
 LIBGSSAPI?=     ${DESTDIR}/usr/lib/libgssapi.a  LIB${_n}= ${DESTDIR}/usr/lib/lib${_n:tl}.a
 LIBHDB?=        ${DESTDIR}/usr/lib/libhdb.a  # XXX - note that ${DESTDIR} will be expanded in the following rule
 LIBINTL?=       ${DESTDIR}/usr/lib/libintl.a  .MADE: ${LIB${_n}}
 LIBIPSEC?=      ${DESTDIR}/usr/lib/libipsec.a  .endif
 LIBKADM?=       ${DESTDIR}/usr/lib/libkadm.a  .endfor
 LIBKADM5CLNT?=  ${DESTDIR}/usr/lib/libkadm5clnt.a  .undef __bsd_prog_mk_system_libs
 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  
   
   ##### Build and install rules
 .if defined(SHAREDSTRINGS)  .if defined(SHAREDSTRINGS)
 CLEANFILES+=strings  CLEANFILES+=strings
 .c.o:  .c.o:
Line 102  CLEANFILES+=strings
Line 84  CLEANFILES+=strings
         @rm -f x.C          @rm -f x.C
 .endif  .endif
   
   .if defined(PROG_CXX)
   PROG=   ${PROG_CXX}
   .endif
   
 .if defined(PROG)  .if defined(PROG)
   .if defined(PROG_CXX)
   SRCS?=          ${PROG}.cc
   .else
 SRCS?=          ${PROG}.c  SRCS?=          ${PROG}.c
   
 DPSRCS+=        ${SRCS:M*.l:.l=.c} ${SRCS:M*.y:.y=.c}  
 CLEANFILES+=    ${DPSRCS}  
 .if defined(YHEADER)  
 CLEANFILES+=    ${SRCS:M*.y:.y=.h}  
 .endif  .endif
   
   DPSRCS+=        ${SRCS:M*.[ly]:C/\..$/.c/}
   CLEANFILES+=    ${DPSRCS} ${YHEADER:D${SRCS:M*.y:.y=.h}}
   
 .if !empty(SRCS:N*.h:N*.sh:N*.fth)  .if !empty(SRCS:N*.h:N*.sh:N*.fth)
 OBJS+=          ${SRCS:N*.h:N*.sh:N*.fth:R:S/$/.o/g}  OBJS+=          ${SRCS:N*.h:N*.sh:N*.fth:R:S/$/.o/g}
 LOBJS+=         ${LSRCS:.c=.ln} ${SRCS:M*.c:.c=.ln}  LOBJS+=         ${LSRCS:.c=.ln} ${SRCS:M*.c:.c=.ln}
 .endif  .endif
   
 .if defined(OBJS) && !empty(OBJS)  .if defined(OBJS) && !empty(OBJS)
 .NOPATH: ${OBJS}  .NOPATH: ${OBJS} ${PROG} ${SRCS:M*.[ly]:C/\..$/.c/} ${YHEADER:D${SRCS:M*.y:.y=.h}}
   
   _PROGLDOPTS=
   .if ${SHLINKDIR} != "/usr/libexec"      # XXX: change or remove if ld.so moves
   .if ${OBJECT_FMT} == "ELF"
   _PROGLDOPTS+=   -Wl,-dynamic-linker=${_SHLINKER}
   .endif
   .if ${OBJECT_FMT} == "a.out"
   LIBCRT0=        ${DESTDIR}/lib/crt0.o
   .endif
   .endif
   .if ${SHLIBDIR} != ${LIBDIR}
   _PROGLDOPTS+=   -Wl,-rpath-link,${DESTDIR}${SHLIBDIR}:${DESTDIR}/usr/lib \
                   -Wl,-rpath,${SHLIBDIR}:/usr/lib \
                   -L${DESTDIR}${SHLIBDIR}
   .elif ${SHLIBINSTALLDIR} != ${LIBDIR}
   _PROGLDOPTS+=   -Wl,-rpath-link,${DESTDIR}${SHLIBINSTALLDIR}:${DESTDIR}/usr/lib \
                   -L${DESTDIR}${SHLIBINSTALLDIR}
   .endif
   
   .if defined(PROG_CXX)
   _CCLINK=        ${CXX}
   _SUPCXX=        -lstdc++ -lm
   .else
   _CCLINK=        ${CC}
   .endif
   
   .gdbinit:
           rm -f .gdbinit
   .if defined(DESTDIR) && !empty(DESTDIR)
           echo "set solib-absolute-prefix ${DESTDIR}" > .gdbinit
   .else
           touch .gdbinit
   .endif
   .for __gdbinit in ${GDBINIT}
           echo "source ${__gdbinit}" >> .gdbinit
   .endfor
   
 .if defined(DESTDIR)  .if defined(DESTDIR)
   
 ${PROG}: ${LIBCRT0} ${DPSRCS} ${OBJS} ${LIBC} ${LIBCRTBEGIN} ${LIBCRTEND} ${DPADD}  ${PROG}: .gdbinit ${LIBCRT0} ${DPSRCS} ${OBJS} ${LIBC} ${LIBCRTBEGIN} ${LIBCRTEND} ${DPADD}
 .if !commands(${PROG})  .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}          ${_CCLINK} ${LDFLAGS} ${LDSTATIC} -o ${.TARGET} -nostdlib ${_PROGLDOPTS} ${LIBCRT0} ${LIBCRTBEGIN} ${OBJS} ${LDADD} -L${_GCC_LIBGCCDIR} -L${DESTDIR}/usr/lib ${_SUPCXX} -lgcc -lc -lgcc ${LIBCRTEND}
 .endif  .endif
   
 .else  .else
   
 ${PROG}: ${LIBCRT0} ${DPSRCS} ${OBJS} ${LIBC} ${LIBCRTBEGIN} ${LIBCRTEND} ${DPADD}  ${PROG}: .gdbinit ${LIBCRT0} ${DPSRCS} ${OBJS} ${LIBC} ${LIBCRTBEGIN} ${LIBCRTEND} ${DPADD}
 .if !commands(${PROG})  .if !commands(${PROG})
         ${CC} ${LDFLAGS} ${LDSTATIC} -o ${.TARGET} ${OBJS} ${LDADD}          ${_CCLINK} ${LDFLAGS} ${LDSTATIC} -o ${.TARGET} ${_PROGLDOPTS} ${OBJS} ${LDADD}
 .endif  .endif
   
 .endif  # defined(DESTDIR)  .endif  # defined(DESTDIR)
Line 143  MAN= ${PROG}.1
Line 166  MAN= ${PROG}.1
   
 realall: ${PROG} ${SCRIPTS}  realall: ${PROG} ${SCRIPTS}
   
 cleanprog:  cleanprog: cleanobjs cleanextra
         rm -f a.out [Ee]rrs mklog core *.core \          rm -f a.out [Ee]rrs mklog core *.core .gdbinit ${PROG}
             ${PROG} ${OBJS} ${LOBJS} ${CLEANFILES}  
   cleanobjs:
   .if defined(OBJS) && !empty(OBJS)
           rm -f ${OBJS} ${LOBJS}
   .endif
   
   cleanextra:
   .if defined(CLEANFILES) && !empty(CLEANFILES)
           rm -f ${CLEANFILES}
   .endif
   
 .if defined(SRCS) && !target(afterdepend)  .if defined(SRCS) && !target(afterdepend)
 afterdepend: .depend  afterdepend: .depend
Line 160  PROGNAME?=${PROG}
Line 192  PROGNAME?=${PROG}
   
 proginstall:: ${DESTDIR}${BINDIR}/${PROGNAME}  proginstall:: ${DESTDIR}${BINDIR}/${PROGNAME}
 .PRECIOUS: ${DESTDIR}${BINDIR}/${PROGNAME}  .PRECIOUS: ${DESTDIR}${BINDIR}/${PROGNAME}
 .if !defined(UPDATE)  
 .PHONY: ${DESTDIR}${BINDIR}/${PROGNAME}  
 .endif  
   
 __proginstall: .USE  __proginstall: .USE
         ${INSTALL} ${RENAME} ${PRESERVE} ${COPY} ${STRIPFLAG} ${INSTPRIV} \          ${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
             -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} ${.ALLSRC} ${.TARGET}                  ${STRIPFLAG} ${SYSPKGTAG} ${.ALLSRC} ${.TARGET}
   
   .if !defined(UPDATE)
   ${DESTDIR}${BINDIR}/${PROGNAME}! ${PROG} __proginstall
 .if !defined(BUILD) && !make(all) && !make(${PROG})  .if !defined(BUILD) && !make(all) && !make(${PROG})
 ${DESTDIR}${BINDIR}/${PROGNAME}: .MADE  ${DESTDIR}${BINDIR}/${PROGNAME}! .MADE
 .endif  .endif
   .else
 ${DESTDIR}${BINDIR}/${PROGNAME}: ${PROG} __proginstall  ${DESTDIR}${BINDIR}/${PROGNAME}: ${PROG} __proginstall
   .if !defined(BUILD) && !make(all) && !make(${PROG})
   ${DESTDIR}${BINDIR}/${PROGNAME}: .MADE
   .endif
   .endif
 .endif  .endif
   
 .if !target(proginstall)  .if !target(proginstall)
Line 186  SCRIPTSMODE?=${BINMODE}
Line 222  SCRIPTSMODE?=${BINMODE}
   
 scriptsinstall:: ${SCRIPTS:@S@${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}@}  scriptsinstall:: ${SCRIPTS:@S@${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}@}
 .PRECIOUS: ${SCRIPTS:@S@${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}@}  .PRECIOUS: ${SCRIPTS:@S@${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}@}
 .if !defined(UPDATE)  
 .PHONY: ${SCRIPTS:@S@${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}@}  
 .endif  
   
 __scriptinstall: .USE  __scriptinstall: .USE
         ${INSTALL} ${RENAME} ${PRESERVE} ${COPY} ${INSTPRIV} \          ${INSTALL_FILE} \
             -o ${SCRIPTSOWN_${.ALLSRC:T}:U${SCRIPTSOWN}} \              -o ${SCRIPTSOWN_${.ALLSRC:T}:U${SCRIPTSOWN}} \
             -g ${SCRIPTSGRP_${.ALLSRC:T}:U${SCRIPTSGRP}} \              -g ${SCRIPTSGRP_${.ALLSRC:T}:U${SCRIPTSGRP}} \
             -m ${SCRIPTSMODE_${.ALLSRC:T}:U${SCRIPTSMODE}} \              -m ${SCRIPTSMODE_${.ALLSRC:T}:U${SCRIPTSMODE}} \
             ${.ALLSRC} ${.TARGET}              ${SYSPKGTAG} ${.ALLSRC} ${.TARGET}
   
 .for S in ${SCRIPTS:O:u}  .for S in ${SCRIPTS:O:u}
   .if !defined(UPDATE)
   ${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}! ${S} __scriptinstall
 .if !defined(BUILD) && !make(all) && !make(${S})  .if !defined(BUILD) && !make(all) && !make(${S})
 ${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}: .MADE  ${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}! .MADE
 .endif  .endif
   .else
 ${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}: ${S} __scriptinstall  ${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}: ${S} __scriptinstall
   .if !defined(BUILD) && !make(all) && !make(${S})
   ${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}: .MADE
   .endif
   .endif
 .endfor  .endfor
 .endif  .endif
   
Line 214  lint: ${LOBJS}
Line 254  lint: ${LOBJS}
         ${LINT} ${LINTFLAGS} ${LDFLAGS:M-L*} ${LOBJS} ${LDADD}          ${LINT} ${LINTFLAGS} ${LDFLAGS:M-L*} ${LOBJS} ${LDADD}
 .endif  .endif
   
   ##### Pull in related .mk logic
 .include <bsd.man.mk>  .include <bsd.man.mk>
 .include <bsd.nls.mk>  .include <bsd.nls.mk>
 .include <bsd.files.mk>  .include <bsd.files.mk>
Line 222  lint: ${LOBJS}
Line 263  lint: ${LOBJS}
 .include <bsd.dep.mk>  .include <bsd.dep.mk>
 .include <bsd.sys.mk>  .include <bsd.sys.mk>
   
 # Make sure all of the standard targets are defined, even if they do nothing.  ${TARGETS}:     # ensure existence
 regress:  
   .endif  # HOSTPROG

Legend:
Removed from v.1.132  
changed lines
  Added in v.1.167

CVSweb <webmaster@jp.NetBSD.org>