[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.167 and 1.185

version 1.167, 2003/05/31 20:33:16 version 1.185, 2003/09/13 02:52:05
Line 7 
Line 7 
 .include <bsd.shlib.mk>  .include <bsd.shlib.mk>
 .include <bsd.gcc.mk>  .include <bsd.gcc.mk>
   
   .if defined(PROG_CXX)
   PROG=   ${PROG_CXX}
   .endif
   
 ##### Basic targets  ##### Basic targets
 .PHONY:         cleanextra cleanobjs cleanprog proginstall scriptsinstall  .PHONY:         cleanextra cleanobjs cleanprog proginstall scriptsinstall
 realinstall:    proginstall scriptsinstall  realinstall:    proginstall scriptsinstall
 clean:          cleanprog  clean:          cleanprog
   
   ##### PROG specific flags.
   COPTS+=    ${COPTS.${PROG}}
   CPPFLAGS+=  ${CPPFLAGS.${PROG}}
   CXXFLAGS+=  ${CXXFLAGS.${PROG}}
   LDADD+=     ${LDADD.${PROG}}
   
 ##### 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 49  LIBCRT0= ${DESTDIR}/usr/lib/crt0.o
Line 59  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 be expanded in the following rule  # Note: ${DESTDIR} will be expanded in the following rule
 .MADE: ${LIB${_n}}  .MADE: ${LIB${_n}}
 .endif  .endif
 .endfor  .endfor
 .undef __bsd_prog_mk_system_libs  .undef __bsd_prog_mk_system_libs
   
   ##### Installed X11R6 library definitions
   #     E.g. LIBX11?=${DESTDIR}/usr/X11R6/lib/libX11.a
   #     etc..
   #
   __bsd_prog_mk_x11r6_libs?= \
           dps expat fntstubs fontcache fontconfig fontenc freetype FS \
           GL GLU ICE lbxutil SM X11 Xau Xaw Xdmcp Xext Xfont Xft \
           Xi Xinerama xkbfile Xmu Xmuu Xpm Xrandr Xrender Xss Xt \
           XTrap Xtst Xv Xxf86dga Xxf86misc Xxf86vm
   
   .for _n in ${__bsd_prog_mk_x11r6_libs}
   .ifndef LIB${_n:tu}
   LIB${_n:tu}= ${DESTDIR}/usr/X11R6/lib/lib${_n}.a
   # Note: ${DESTDIR} will be expanded in the following rule
   .MADE: ${LIB${_n:tu}}
   .endif
   .endfor
   .undef __bsd_prog_mk_x11r6_libs
   
 ##### Build and install rules  ##### Build and install rules
 .if defined(SHAREDSTRINGS)  .if defined(SHAREDSTRINGS)
 CLEANFILES+=strings  CLEANFILES+=strings
Line 71  CLEANFILES+=strings
Line 100  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  
   
 .if defined(PROG_CXX)  
 PROG=   ${PROG_CXX}  
 .endif  .endif
   
 .if defined(PROG)  .if defined(PROG)
Line 95  SRCS?=  ${PROG}.cc
Line 114  SRCS?=  ${PROG}.cc
 SRCS?=          ${PROG}.c  SRCS?=          ${PROG}.c
 .endif  .endif
   
 DPSRCS+=        ${SRCS:M*.[ly]:C/\..$/.c/}  DPSRCS+=        ${SRCS:M*.l:.l=.c} ${SRCS:M*.y:.y=.c}
 CLEANFILES+=    ${DPSRCS} ${YHEADER:D${SRCS:M*.y:.y=.h}}  DPSRCS+=        ${YHEADER:D${SRCS:M*.y:.y=.h}}
   CLEANFILES+=    ${SRCS:M*.l:.l=.c} ${SRCS:M*.y:.y=.c}
   CLEANFILES+=    ${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}
Line 117  LIBCRT0= ${DESTDIR}/lib/crt0.o
Line 138  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} \
                 -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 126  _PROGLDOPTS+= -Wl,-rpath-link,${DESTDIR}
Line 147  _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 142  _CCLINK= ${CC}
Line 167  _CCLINK= ${CC}
         echo "source ${__gdbinit}" >> .gdbinit          echo "source ${__gdbinit}" >> .gdbinit
 .endfor  .endfor
   
 .if defined(DESTDIR)  ${OBJS} ${LOBJS}: ${DPSRCS}
   
 ${PROG}: .gdbinit ${LIBCRT0} ${DPSRCS} ${OBJS} ${LIBC} ${LIBCRTBEGIN} ${LIBCRTEND} ${DPADD}  ${PROG}: .gdbinit ${LIBCRT0} ${OBJS} ${LIBC} ${LIBCRTBEGIN} ${LIBCRTEND} ${DPADD}
 .if !commands(${PROG})  .if !commands(${PROG})
   .if defined(DESTDIR)
         ${_CCLINK} ${LDFLAGS} ${LDSTATIC} -o ${.TARGET} -nostdlib ${_PROGLDOPTS} ${LIBCRT0} ${LIBCRTBEGIN} ${OBJS} ${LDADD} -L${_GCC_LIBGCCDIR} -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  
   
 .else  .else
   
 ${PROG}: .gdbinit ${LIBCRT0} ${DPSRCS} ${OBJS} ${LIBC} ${LIBCRTBEGIN} ${LIBCRTEND} ${DPADD}  
 .if !commands(${PROG})  
         ${_CCLINK} ${LDFLAGS} ${LDSTATIC} -o ${.TARGET} ${_PROGLDOPTS} ${OBJS} ${LDADD}          ${_CCLINK} ${LDFLAGS} ${LDSTATIC} -o ${.TARGET} ${_PROGLDOPTS} ${OBJS} ${LDADD}
 .endif  
   
 .endif  # defined(DESTDIR)  .endif  # defined(DESTDIR)
   .endif  # !commands(${PROG})
   
   ${PROG}.ro: ${OBJS} ${DPADD}
           ${LD} -r -dc -o ${.TARGET} ${OBJS}
   
 .endif  # defined(OBJS) && !empty(OBJS)  .endif  # defined(OBJS) && !empty(OBJS)
   
 .if !defined(MAN)  .if !defined(MAN)
Line 181  cleanextra:
Line 205  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 197  __proginstall: .USE
Line 221  __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 231  __scriptinstall: .USE
Line 255  __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 260  lint: ${LOBJS}
Line 284  lint: ${LOBJS}
 .include <bsd.files.mk>  .include <bsd.files.mk>
 .include <bsd.inc.mk>  .include <bsd.inc.mk>
 .include <bsd.links.mk>  .include <bsd.links.mk>
 .include <bsd.dep.mk>  
 .include <bsd.sys.mk>  .include <bsd.sys.mk>
   .include <bsd.dep.mk>
   
 ${TARGETS}:     # ensure existence  ${TARGETS}:     # ensure existence
   

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

CVSweb <webmaster@jp.NetBSD.org>