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

version 1.151, 2002/02/03 21:40:14 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
   
   .ifndef HOSTPROG
   
 .include <bsd.init.mk>  .include <bsd.init.mk>
   .include <bsd.shlib.mk>
   .include <bsd.gcc.mk>
   
 ##### Basic targets  ##### Basic targets
 .PHONY:         cleanextra cleanobjs cleanprog proginstall scriptsinstall  .PHONY:         cleanextra cleanobjs cleanprog proginstall scriptsinstall
Line 12  clean:  cleanprog
Line 16  clean:  cleanprog
 CPPFLAGS+=      ${DESTDIR:D-nostdinc ${CPPFLAG_ISYSTEM} ${DESTDIR}/usr/include}  CPPFLAGS+=      ${DESTDIR:D-nostdinc ${CPPFLAG_ISYSTEM} ${DESTDIR}/usr/include}
 CXXFLAGS+=      ${DESTDIR:D-nostdinc++ ${CPPFLAG_ISYSTEM} ${DESTDIR}/usr/include/g++}  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
 .NOSUFF: ${LIBCRTBEGIN}  LIBCRTBEGIN=    ${DESTDIR}/usr/lib/crti.o ${_GCC_CRTBEGIN}
 LIBCRTEND?=     ${DESTDIR}/usr/lib/crtend.o  .MADE: ${LIBCRTBEGIN}
 .NOSUFF: ${LIBCRTEND}  .endif
   .ifndef LIBCRTEND
   LIBCRTEND=      ${_GCC_CRTEND} ${DESTDIR}/usr/lib/crtn.o
   .MADE: ${LIBCRTEND}
   .endif
 _SHLINKER=      ${SHLINKDIR}/ld.elf_so  _SHLINKER=      ${SHLINKDIR}/ld.elf_so
 .else  .else
 LIBCRTBEGIN?=  LIBCRTBEGIN?=
Line 26  LIBCRTEND?=
Line 37  LIBCRTEND?=
 _SHLINKER=      ${SHLINKDIR}/ld.so  _SHLINKER=      ${SHLINKDIR}/ld.so
 .endif  .endif
   
 LIBCRT0?=       ${DESTDIR}/usr/lib/crt0.o  .ifndef LIBCRT0
 .NOSUFF: ${LIBCRT0}  LIBCRT0=        ${DESTDIR}/usr/lib/crt0.o
   .MADE: ${LIBCRT0}
 LIBBZ2?=        ${DESTDIR}/usr/lib/libbz2.a  .endif
 .NOSUFF: ${LIBBZ2}  
 LIBC?=          ${DESTDIR}/usr/lib/libc.a  ##### Installed system library definitions
 .NOSUFF: ${LIBC}  #     E.g. LIBC?=${DESTDIR}/usr/lib/libc.a
 LIBC_PIC?=      ${DESTDIR}/usr/lib/libc_pic.a  #     etc..
 .NOSUFF: ${LIBC_PIC}  #
 LIBCDK?=        ${DESTDIR}/usr/lib/libcdk.a  __bsd_prog_mk_system_libs?= \
 .NOSUFF: ${LIBCDK}          BZ2 C C_PIC CDK COM_ERR COMPAT CRYPT CRYPTO CRYPTO_IDEA CRYPTO_MDC2 \
 LIBCOM_ERR?=    ${DESTDIR}/usr/lib/libcom_err.a          CRYPTO_RC5 \
 .NOSUFF: ${LIBCOM_ERR}          CURSES DBM DES EDIT FORM GCC GNUMALLOC GSSAPI HDB INTL IPSEC \
 LIBCOMPAT?=     ${DESTDIR}/usr/lib/libcompat.a          KADM KADM5CLNT KADM5SRV KAFS KDB KRB KRB5 KSTREAM KVM L M MENU \
 .NOSUFF: ${LIBCOMPAT}          OBJC OSSAUDIO PCAP PCI PMC POSIX PTHREAD PTHREAD_DBG RESOLV RMT \
 LIBCRYPT?=      ${DESTDIR}/usr/lib/libcrypt.a          ROKEN RPCSVC RT SKEY SS SSL SL TERMCAP TELNET USBHID UTIL WRAP Y Z
 .NOSUFF: ${LIBCRYPT}  
 LIBCRYPTO?=     ${DESTDIR}/usr/lib/libcrypto.a  .for _n in ${__bsd_prog_mk_system_libs}
 .NOSUFF: ${LIBCRYPTO}  .ifndef LIB${_n}
 LIBCRYPTO_RC5?= ${DESTDIR}/usr/lib/libcrypto_rc5.a  LIB${_n}= ${DESTDIR}/usr/lib/lib${_n:tl}.a
 .NOSUFF: ${LIBCRYPTO_RC5}  # XXX - note that ${DESTDIR} will be expanded in the following rule
 LIBCRYPTO_IDEA?=${DESTDIR}/usr/lib/libcrypto_idea.a  .MADE: ${LIB${_n}}
 .NOSUFF: ${LIBCRYPTO_IDEA}  .endif
 LIBCURSES?=     ${DESTDIR}/usr/lib/libcurses.a  .endfor
 .NOSUFF: ${LIBCURSES}  .undef __bsd_prog_mk_system_libs
 LIBDBM?=        ${DESTDIR}/usr/lib/libdbm.a  
 .NOSUFF: ${LIBDBM}  
 LIBDES?=        ${DESTDIR}/usr/lib/libdes.a  
 .NOSUFF: ${LIBDES}  
 LIBEDIT?=       ${DESTDIR}/usr/lib/libedit.a  
 .NOSUFF: ${LIBEDIT}  
 LIBFORM?=       ${DESTDIR}/usr/lib/libform.a  
 .NOSUFF: ${LIBFORM}  
 LIBGCC?=        ${DESTDIR}/usr/lib/libgcc.a  
 .NOSUFF: ${LIBGCC}  
 LIBGNUMALLOC?=  ${DESTDIR}/usr/lib/libgnumalloc.a  
 .NOSUFF: ${LIBGNUMALLOC}  
 LIBGSSAPI?=     ${DESTDIR}/usr/lib/libgssapi.a  
 .NOSUFF: ${LIBGSSAPI}  
 LIBHDB?=        ${DESTDIR}/usr/lib/libhdb.a  
 .NOSUFF: ${LIBHDB}  
 LIBINTL?=       ${DESTDIR}/usr/lib/libintl.a  
 .NOSUFF: ${LIBINTL}  
 LIBIPSEC?=      ${DESTDIR}/usr/lib/libipsec.a  
 .NOSUFF: ${LIBIPSEC}  
 LIBKADM?=       ${DESTDIR}/usr/lib/libkadm.a  
 .NOSUFF: ${LIBKADM}  
 LIBKADM5CLNT?=  ${DESTDIR}/usr/lib/libkadm5clnt.a  
 .NOSUFF: ${LIBKADM5CLNT}  
 LIBKADM5SRV?=   ${DESTDIR}/usr/lib/libkadm5srv.a  
 .NOSUFF: ${LIBKADM5SRV}  
 LIBKAFS?=       ${DESTDIR}/usr/lib/libkafs.a  
 .NOSUFF: ${LIBKAFS}  
 LIBKDB?=        ${DESTDIR}/usr/lib/libkdb.a  
 .NOSUFF: ${LIBKDB}  
 LIBKRB?=        ${DESTDIR}/usr/lib/libkrb.a  
 .NOSUFF: ${LIBKRB}  
 LIBKRB5?=       ${DESTDIR}/usr/lib/libkrb5.a  
 .NOSUFF: ${LIBKRB5}  
 LIBKSTREAM?=    ${DESTDIR}/usr/lib/libkstream.a  
 .NOSUFF: ${LIBKSTREAM}  
 LIBKVM?=        ${DESTDIR}/usr/lib/libkvm.a  
 .NOSUFF: ${LIBKVM}  
 LIBL?=          ${DESTDIR}/usr/lib/libl.a  
 .NOSUFF: ${LIBL}  
 LIBM?=          ${DESTDIR}/usr/lib/libm.a  
 .NOSUFF: ${LIBM}  
 LIBMENU?=       ${DESTDIR}/usr/lib/libmenu.a  
 .NOSUFF: ${LIBMENU}  
 LIBOBJC?=       ${DESTDIR}/usr/lib/libobjc.a  
 .NOSUFF: ${LIBOBJC}  
 LIBOSSAUDIO?=   ${DESTDIR}/usr/lib/libossaudio.a  
 .NOSUFF: ${LIBOSSAUDIO}  
 LIBPCAP?=       ${DESTDIR}/usr/lib/libpcap.a  
 .NOSUFF: ${LIBPCAP}  
 LIBPCI?=        ${DESTDIR}/usr/lib/libpci.a  
 .NOSUFF: ${LIBPCI}  
 LIBPOSIX?=      ${DESTDIR}/usr/lib/libposix.a  
 .NOSUFF: ${LIBPOSIX}  
 LIBRESOLV?=     ${DESTDIR}/usr/lib/libresolv.a  
 .NOSUFF: ${LIBRESOLV}  
 LIBRMT?=        ${DESTDIR}/usr/lib/librmt.a  
 .NOSUFF: ${LIBRMT}  
 LIBROKEN?=      ${DESTDIR}/usr/lib/libroken.a  
 .NOSUFF: ${LIBROKEN}  
 LIBRPCSVC?=     ${DESTDIR}/usr/lib/librpcsvc.a  
 .NOSUFF: ${LIBRPCSVC}  
 LIBSKEY?=       ${DESTDIR}/usr/lib/libskey.a  
 .NOSUFF: ${LIBSKEY}  
 LIBSS?=         ${DESTDIR}/usr/lib/libss.a  
 .NOSUFF: ${LIBSS}  
 LIBSSL?=        ${DESTDIR}/usr/lib/libssl.a  
 .NOSUFF: ${LIBSSL}  
 LIBSL?=         ${DESTDIR}/usr/lib/libsl.a  
 .NOSUFF: ${LIBSL}  
 LIBTERMCAP?=    ${DESTDIR}/usr/lib/libtermcap.a  
 .NOSUFF: ${LIBTERMCAP}  
 LIBTELNET?=     ${DESTDIR}/usr/lib/libtelnet.a  
 .NOSUFF: ${LIBTELNET}  
 LIBUSBHID?=     ${DESTDIR}/usr/lib/libusbhid.a  
 .NOSUFF: ${LIBUSBHID}  
 LIBUTIL?=       ${DESTDIR}/usr/lib/libutil.a  
 .NOSUFF: ${LIBUTIL}  
 LIBWRAP?=       ${DESTDIR}/usr/lib/libwrap.a  
 .NOSUFF: ${LIBWRAP}  
 LIBY?=          ${DESTDIR}/usr/lib/liby.a  
 .NOSUFF: ${LIBY}  
 LIBZ?=          ${DESTDIR}/usr/lib/libz.a  
 .NOSUFF: ${LIBZ}  
   
 ##### Build and install rules  ##### Build and install rules
 .if defined(SHAREDSTRINGS)  .if defined(SHAREDSTRINGS)
Line 181  LOBJS+=  ${LSRCS:.c=.ln} ${SRCS:M*.c:.c=
Line 108  LOBJS+=  ${LSRCS:.c=.ln} ${SRCS:M*.c:.c=
   
 _PROGLDOPTS=  _PROGLDOPTS=
 .if ${SHLINKDIR} != "/usr/libexec"      # XXX: change or remove if ld.so moves  .if ${SHLINKDIR} != "/usr/libexec"      # XXX: change or remove if ld.so moves
   .if ${OBJECT_FMT} == "ELF"
 _PROGLDOPTS+=   -Wl,-dynamic-linker=${_SHLINKER}  _PROGLDOPTS+=   -Wl,-dynamic-linker=${_SHLINKER}
 .endif  .endif
   .if ${OBJECT_FMT} == "a.out"
   LIBCRT0=        ${DESTDIR}/lib/crt0.o
   .endif
   .endif
 .if ${SHLIBDIR} != ${LIBDIR}  .if ${SHLIBDIR} != ${LIBDIR}
 _PROGLDOPTS+=   -Wl,-rpath-link,${DESTDIR}${SHLIBDIR}:${DESTDIR}/usr/lib \  _PROGLDOPTS+=   -Wl,-rpath-link,${DESTDIR}${SHLIBDIR}:${DESTDIR}/usr/lib \
                 -Wl,-rpath,${SHLIBDIR}:/usr/lib \                  -Wl,-rpath,${SHLIBDIR}:/usr/lib \
                 -L${DESTDIR}${SHLIBDIR}                  -L${DESTDIR}${SHLIBDIR}
   .elif ${SHLIBINSTALLDIR} != ${LIBDIR}
   _PROGLDOPTS+=   -Wl,-rpath-link,${DESTDIR}${SHLIBINSTALLDIR}:${DESTDIR}/usr/lib \
                   -L${DESTDIR}${SHLIBINSTALLDIR}
 .endif  .endif
   
 .if defined(PROG_CXX)  .if defined(PROG_CXX)
Line 196  _SUPCXX= -lstdc++ -lm
Line 131  _SUPCXX= -lstdc++ -lm
 _CCLINK=        ${CC}  _CCLINK=        ${CC}
 .endif  .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})
         ${_CCLINK} ${LDFLAGS} ${LDSTATIC} -o ${.TARGET} -nostdlib ${_PROGLDOPTS} ${LIBCRT0} ${LIBCRTBEGIN} ${OBJS} ${LDADD} -L${DESTDIR}/usr/lib ${_SUPCXX} -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})
         ${_CCLINK} ${LDFLAGS} ${LDSTATIC} -o ${.TARGET} ${_PROGLDOPTS} ${OBJS} ${LDADD}          ${_CCLINK} ${LDFLAGS} ${LDSTATIC} -o ${.TARGET} ${_PROGLDOPTS} ${OBJS} ${LDADD}
 .endif  .endif
Line 221  MAN= ${PROG}.1
Line 167  MAN= ${PROG}.1
 realall: ${PROG} ${SCRIPTS}  realall: ${PROG} ${SCRIPTS}
   
 cleanprog: cleanobjs cleanextra  cleanprog: cleanobjs cleanextra
         rm -f a.out [Ee]rrs mklog core *.core ${PROG}          rm -f a.out [Ee]rrs mklog core *.core .gdbinit ${PROG}
   
 cleanobjs:  cleanobjs:
 .if defined(OBJS) && !empty(OBJS)  .if defined(OBJS) && !empty(OBJS)
Line 246  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_FILE} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \          ${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
                 ${STRIPFLAG} ${.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 272  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_FILE} \          ${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 310  lint: ${LOBJS}
Line 264  lint: ${LOBJS}
 .include <bsd.sys.mk>  .include <bsd.sys.mk>
   
 ${TARGETS}:     # ensure existence  ${TARGETS}:     # ensure existence
   
   .endif  # HOSTPROG

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

CVSweb <webmaster@jp.NetBSD.org>