[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.163 and 1.177

version 1.163, 2003/01/24 02:06:37 version 1.177, 2003/07/28 08:53:55
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.shlib.mk>
   .include <bsd.gcc.mk>
   
 ##### Basic targets  ##### Basic targets
 .PHONY:         cleanextra cleanobjs cleanprog proginstall scriptsinstall  .PHONY:         cleanextra cleanobjs cleanprog proginstall scriptsinstall
Line 11  clean:  cleanprog
Line 14  clean:  cleanprog
   
 ##### Default values  ##### Default values
 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_ISYSTEMXX} ${DESTDIR}/usr/include/g++}
 CFLAGS+=        ${COPTS}  CFLAGS+=        ${COPTS}
 .if ${MACHINE_ARCH} == "sparc64"  .if ${MACHINE_ARCH} == "sparc64"
 CFLAGS+=        -mcmodel=medlow  CFLAGS+=        -mcmodel=medlow
Line 20  CFLAGS+= -mcmodel=medlow
Line 23  CFLAGS+= -mcmodel=medlow
 # ELF platforms depend on crti.o, crtbegin.o, crtend.o, and crtn.o  # ELF platforms depend on crti.o, crtbegin.o, crtend.o, and crtn.o
 .if ${OBJECT_FMT} == "ELF"  .if ${OBJECT_FMT} == "ELF"
 .ifndef LIBCRTBEGIN  .ifndef LIBCRTBEGIN
 LIBCRTBEGIN=    ${DESTDIR}/usr/lib/crti.o ${DESTDIR}/usr/lib/crtbegin.o  LIBCRTBEGIN=    ${DESTDIR}/usr/lib/crti.o ${_GCC_CRTBEGIN}
 .MADE: ${LIBCRTBEGIN}  .MADE: ${LIBCRTBEGIN}
 .endif  .endif
 .ifndef LIBCRTEND  .ifndef LIBCRTEND
 LIBCRTEND=      ${DESTDIR}/usr/lib/crtend.o ${DESTDIR}/usr/lib/crtn.o  LIBCRTEND=      ${_GCC_CRTEND} ${DESTDIR}/usr/lib/crtn.o
 .MADE: ${LIBCRTEND}  .MADE: ${LIBCRTEND}
 .endif  .endif
 _SHLINKER=      ${SHLINKDIR}/ld.elf_so  _SHLINKER=      ${SHLINKDIR}/ld.elf_so
Line 46  LIBCRT0= ${DESTDIR}/usr/lib/crt0.o
Line 49  LIBCRT0= ${DESTDIR}/usr/lib/crt0.o
 __bsd_prog_mk_system_libs?= \  __bsd_prog_mk_system_libs?= \
         BZ2 C C_PIC CDK COM_ERR COMPAT CRYPT CRYPTO CRYPTO_IDEA CRYPTO_MDC2 \          BZ2 C C_PIC CDK COM_ERR COMPAT CRYPT CRYPTO CRYPTO_IDEA CRYPTO_MDC2 \
         CRYPTO_RC5 \          CRYPTO_RC5 \
         CURSES DBM DES EDIT FORM GCC GNUMALLOC GSSAPI HDB INTL IPSEC \          CURSES DBM DES EDIT EVENT FORM GCC GNUMALLOC GSSAPI HDB INTL IPSEC \
         KADM KADM5CLNT KADM5SRV KAFS KDB KRB KRB5 KSTREAM KVM L M MENU \          KADM KADM5CLNT KADM5SRV KAFS KDB KRB KRB5 KSTREAM KVM L M MENU \
         OBJC OSSAUDIO PCAP PCI PMC POSIX PTHREAD PTHREAD_DBG RESOLV RMT \          OBJC OSSAUDIO PCAP PCI PMC POSIX PTHREAD PTHREAD_DBG RESOLV RMT \
         ROKEN RPCSVC RT SKEY SS SSL SL TERMCAP TELNET USBHID UTIL WRAP Y Z          ROKEN RPCSVC RT SKEY SS SSL SL TERMCAP USBHID UTIL WRAP Y Z
   
 .for _n in ${__bsd_prog_mk_system_libs}  .for _n in ${__bsd_prog_mk_system_libs}
 .ifndef LIB${_n}  .ifndef LIB${_n}
 LIB${_n}= ${DESTDIR}/usr/lib/lib${_n:tl}.a  LIB${_n}= ${DESTDIR}/usr/lib/lib${_n:tl}.a
 # XXX - note that ${DESTDIR} will expanded in the following rule  # XXX - note that ${DESTDIR} will be expanded in the following rule
 .MADE: ${LIB${_n}}  .MADE: ${LIB${_n}}
 .endif  .endif
 .endfor  .endfor
Line 68  CLEANFILES+=strings
Line 71  CLEANFILES+=strings
         @${CC} ${CFLAGS} -c x.c -o ${.TARGET}          @${CC} ${CFLAGS} -c x.c -o ${.TARGET}
         @rm -f x.c          @rm -f x.c
   
 .cc.o:  .cc.o .cpp.o .cxx.o .C.o:
         ${CXX} -E ${CXXFLAGS} ${.IMPSRC} | xstr -c -          ${CXX} -E ${CXXFLAGS} ${.IMPSRC} | xstr -c -
         @mv -f x.c x.cc          @mv -f x.c x.cc
         @${CXX} ${CXXFLAGS} -c x.cc -o ${.TARGET}          @${CXX} ${CXXFLAGS} -c x.cc -o ${.TARGET}
         @rm -f x.cc          @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_CXX)  .if defined(PROG_CXX)
Line 114  LIBCRT0= ${DESTDIR}/lib/crt0.o
Line 111  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 \                  -R${SHLIBDIR} -R/usr/lib \
                 -L${DESTDIR}${SHLIBDIR}                  -L${DESTDIR}${SHLIBDIR}
 .elif ${SHLIBINSTALLDIR} != ${LIBDIR}  .elif ${SHLIBINSTALLDIR} != ${LIBDIR}
 _PROGLDOPTS+=   -Wl,-rpath-link,${DESTDIR}${SHLIBINSTALLDIR}:${DESTDIR}/usr/lib \  _PROGLDOPTS+=   -Wl,-rpath-link,${DESTDIR}${SHLIBINSTALLDIR}:${DESTDIR}/usr/lib \
Line 123  _PROGLDOPTS+= -Wl,-rpath-link,${DESTDIR}
Line 120  _PROGLDOPTS+= -Wl,-rpath-link,${DESTDIR}
   
 .if defined(PROG_CXX)  .if defined(PROG_CXX)
 _CCLINK=        ${CXX}  _CCLINK=        ${CXX}
   .if ${USE_LIBSTDCXX} == "no"
   _SUPCXX=        -lsupc++ -lm
   .else
 _SUPCXX=        -lstdc++ -lm  _SUPCXX=        -lstdc++ -lm
   .endif
 .else  .else
 _CCLINK=        ${CC}  _CCLINK=        ${CC}
 .endif  .endif
Line 143  _CCLINK= ${CC}
Line 144  _CCLINK= ${CC}
   
 ${PROG}: .gdbinit ${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
Line 178  cleanextra:
Line 179  cleanextra:
   
 .if defined(SRCS) && !target(afterdepend)  .if defined(SRCS) && !target(afterdepend)
 afterdepend: .depend  afterdepend: .depend
         @(TMP=/tmp/_depend$$$$; \          @(TMP=/tmp/_depend$$$$; trap 'rm -f $$TMP ; exit 1' 1 2 3 13 15; \
             sed -e 's/^\([^\.]*\).o[ ]*:/\1.o \1.ln:/' \              sed -e 's/^\([^\.]*\).o[ ]*:/\1.o \1.ln:/' \
               < .depend > $$TMP; \                < .depend > $$TMP; \
             mv $$TMP .depend)              mv $$TMP .depend)
Line 194  __proginstall: .USE
Line 195  __proginstall: .USE
         ${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \          ${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
                 ${STRIPFLAG} ${SYSPKGTAG} ${.ALLSRC} ${.TARGET}                  ${STRIPFLAG} ${SYSPKGTAG} ${.ALLSRC} ${.TARGET}
   
 .if !defined(UPDATE)  .if ${MKUPDATE} == "no"
 ${DESTDIR}${BINDIR}/${PROGNAME}! ${PROG} __proginstall  ${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
Line 228  __scriptinstall: .USE
Line 229  __scriptinstall: .USE
             ${SYSPKGTAG} ${.ALLSRC} ${.TARGET}              ${SYSPKGTAG} ${.ALLSRC} ${.TARGET}
   
 .for S in ${SCRIPTS:O:u}  .for S in ${SCRIPTS:O:u}
 .if !defined(UPDATE)  .if ${MKUPDATE} == "no"
 ${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})  .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
Line 261  lint: ${LOBJS}
Line 262  lint: ${LOBJS}
 .include <bsd.sys.mk>  .include <bsd.sys.mk>
   
 ${TARGETS}:     # ensure existence  ${TARGETS}:     # ensure existence
   
   .endif  # HOSTPROG

Legend:
Removed from v.1.163  
changed lines
  Added in v.1.177

CVSweb <webmaster@jp.NetBSD.org>