[BACK]Return to bsd.lib.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.lib.mk between version 1.24 and 1.47

version 1.24, 1993/08/15 20:42:41 version 1.47, 1994/02/09 23:50:36
Line 5 
Line 5 
 .include "${.CURDIR}/../Makefile.inc"  .include "${.CURDIR}/../Makefile.inc"
 .endif  .endif
   
   .if exists(${.CURDIR}/shlib_version)
   SHLIB_MAJOR != . ${.CURDIR}/shlib_version ; echo $$major
   SHLIB_MINOR != . ${.CURDIR}/shlib_version ; echo $$minor
   .endif
   
 .MAIN: all  .MAIN: all
   
 # prefer .s to a .c, add .po, remove stuff not used in the BSD libraries  # prefer .S to a .c, add .po, remove stuff not used in the BSD libraries
   # .so used for PIC object files
 .SUFFIXES:  .SUFFIXES:
 .SUFFIXES: .out .o .po .s .c .cc .C .f .y .l .0 .1 .2 .3 .4 .5 .6 .7 .8  .SUFFIXES: .out .o .po .so .S .s .c .cc .C .f .y .l
   
 .c.o:  .c.o:
         ${CC} ${CFLAGS} -c ${.IMPSRC}          ${CC} ${CFLAGS} -c ${.IMPSRC}
Line 21 
Line 27 
         @${LD} -X -r ${.TARGET}          @${LD} -X -r ${.TARGET}
         @mv a.out ${.TARGET}          @mv a.out ${.TARGET}
   
   .c.so:
           ${CC} ${PICFLAG} -DPIC ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET}
           @${LD} -x -r ${.TARGET}
           @mv a.out ${.TARGET}
   
 .cc.o .C.o:  .cc.o .C.o:
         ${CXX} ${CXXFLAGS} -c ${.IMPSRC}          ${CXX} ${CXXFLAGS} -c ${.IMPSRC}
         @${LD} -x -r ${.TARGET}          @${LD} -x -r ${.TARGET}
Line 31 
Line 42 
         @${LD} -X -r ${.TARGET}          @${LD} -X -r ${.TARGET}
         @mv a.out ${.TARGET}          @mv a.out ${.TARGET}
   
 .s.o:  .cc.so .C.so:
           ${CXX} ${PICFLAG} -DPIC ${CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET}
           @${LD} -x -r ${.TARGET}
           @mv a.out ${.TARGET}
   
   .S.o .s.o:
         ${CPP} -E ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} | \          ${CPP} -E ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} | \
             ${AS} -o ${.TARGET}              ${AS} -o ${.TARGET}
         @${LD} -x -r ${.TARGET}          @${LD} -x -r ${.TARGET}
         @mv a.out ${.TARGET}          @mv a.out ${.TARGET}
   
 .s.po:  .S.po .s.po:
         ${CPP} -E -DPROF ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} | \          ${CPP} -E -DPROF ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} | \
             ${AS} -o ${.TARGET}              ${AS} -o ${.TARGET}
         @${LD} -X -r ${.TARGET}          @${LD} -X -r ${.TARGET}
         @mv a.out ${.TARGET}          @mv a.out ${.TARGET}
   
   .S.so .s.so:
           ${CPP} -E -DPIC ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} | \
               ${AS} -k -o ${.TARGET}
           @${LD} -x -r ${.TARGET}
           @mv a.out ${.TARGET}
   
 .if !defined(NOPROFILE)  .if !defined(NOPROFILE)
 _LIBS=lib${LIB}.a lib${LIB}_p.a  _LIBS=lib${LIB}.a lib${LIB}_p.a
 .else  .else
 _LIBS=lib${LIB}.a  _LIBS=lib${LIB}.a
 .endif  .endif
   
   .if !defined(NOPIC)
   _LIBS+=lib${LIB}_pic.a
   .if defined(SHLIB_MAJOR) && defined(SHLIB_MINOR)
   _LIBS+=lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR}
   .endif
   .endif
   
   .if !defined(PICFLAG)
   PICFLAG=-fpic
   .endif
   
 all: ${_LIBS} # llib-l${LIB}.ln  all: ${_LIBS} # llib-l${LIB}.ln
   
 OBJS+=  ${SRCS:N*.h:R:S/$/.o/g}  OBJS+=  ${SRCS:N*.h:R:S/$/.o/g}
Line 56  OBJS+= ${SRCS:N*.h:R:S/$/.o/g}
Line 89  OBJS+= ${SRCS:N*.h:R:S/$/.o/g}
 lib${LIB}.a:: ${OBJS}  lib${LIB}.a:: ${OBJS}
         @echo building standard ${LIB} library          @echo building standard ${LIB} library
         @rm -f lib${LIB}.a          @rm -f lib${LIB}.a
         @${AR} cTq lib${LIB}.a `lorder ${OBJS} | tsort` ${LDADD}          @${AR} cq lib${LIB}.a `lorder ${OBJS} | tsort`
         ${RANLIB} lib${LIB}.a          ${RANLIB} lib${LIB}.a
   
 POBJS+= ${OBJS:.o=.po}  POBJS+= ${OBJS:.o=.po}
 lib${LIB}_p.a:: ${POBJS}  lib${LIB}_p.a:: ${POBJS}
         @echo building profiled ${LIB} library          @echo building profiled ${LIB} library
         @rm -f lib${LIB}_p.a          @rm -f lib${LIB}_p.a
         @${AR} cTq lib${LIB}_p.a `lorder ${POBJS} | tsort` ${LDADD}          @${AR} cq lib${LIB}_p.a `lorder ${POBJS} | tsort`
         ${RANLIB} lib${LIB}_p.a          ${RANLIB} lib${LIB}_p.a
   
   SOBJS+= ${OBJS:.o=.so}
   lib${LIB}_pic.a:: ${SOBJS}
           @echo building shared object ${LIB} library
           @rm -f lib${LIB}_pic.a
           @${AR} cq lib${LIB}_pic.a `lorder ${SOBJS} | tsort`
           ${RANLIB} lib${LIB}_pic.a
   
   lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR}: lib${LIB}_pic.a ${DPADD}
           @echo building shared ${LIB} library \(version ${SHLIB_MAJOR}.${SHLIB_MINOR}\)
           @rm -f lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR}
           $(LD) -Bshareable -Bforcearchive \
               -o lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR} lib${LIB}_pic.a ${LDADD}
   
 llib-l${LIB}.ln: ${SRCS}  llib-l${LIB}.ln: ${SRCS}
         ${LINT} -C${LIB} ${CFLAGS} ${.ALLSRC:M*.c}          ${LINT} -C${LIB} ${CFLAGS} ${.ALLSRC:M*.c}
   
Line 74  clean:
Line 120  clean:
         rm -f a.out Errs errs mklog core ${CLEANFILES}          rm -f a.out Errs errs mklog core ${CLEANFILES}
         rm -f ${OBJS}          rm -f ${OBJS}
         rm -f ${POBJS} profiled/*.o          rm -f ${POBJS} profiled/*.o
         rm -f lib${LIB}.a lib${LIB}_p.a llib-l${LIB}.ln          rm -f ${SOBJS} shared/*.o
           rm -f lib${LIB}.a lib${LIB}_p.a lib${LIB}_pic.a llib-l${LIB}.ln
           rm -f lib${LIB}.so.*.*
 .endif  .endif
   
   cleandir: clean
   
   .if defined(SRCS)
 afterdepend:  afterdepend:
         @(TMP=/tmp/_depend$$$$; \          @(TMP=/tmp/_depend$$$$; \
             sed -e 's/^\([^\.]*\).o[ ]*:/\1.o \1.po:/' < .depend > $$TMP; \              sed -e 's/^\([^\.]*\).o[ ]*:/\1.o \1.po \1.so:/' < .depend > $$TMP; \
             mv $$TMP .depend)              mv $$TMP .depend)
   .endif
   
 .if !target(install)  .if !target(install)
 .if !target(beforeinstall)  .if !target(beforeinstall)
 beforeinstall:  beforeinstall:
         @install -d -o root -g wheel -m 755 ${DESTDIR}${LIBDIR}  
 .endif  .endif
   
 realinstall:  realinstall:
Line 99  realinstall:
Line 150  realinstall:
             lib${LIB}_p.a ${DESTDIR}${LIBDIR}              lib${LIB}_p.a ${DESTDIR}${LIBDIR}
         ${RANLIB} -t ${DESTDIR}${LIBDIR}/lib${LIB}_p.a          ${RANLIB} -t ${DESTDIR}${LIBDIR}/lib${LIB}_p.a
 .endif  .endif
   .if !defined(NOPIC)
   #       ranlib lib${LIB}_pic.a
           install ${COPY} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
               lib${LIB}_pic.a ${DESTDIR}${LIBDIR}
           ${RANLIB} -t ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a
   .endif
   .if !defined(NOPIC) && defined(SHLIB_MAJOR) && defined(SHLIB_MINOR)
           install ${COPY} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
               lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR} ${DESTDIR}${LIBDIR}
   .endif
 #       install ${COPY} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \  #       install ${COPY} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
 #           llib-l${LIB}.ln ${DESTDIR}${LINTLIBDIR}  #           llib-l${LIB}.ln ${DESTDIR}${LINTLIBDIR}
 .if defined(LINKS) && !empty(LINKS)  .if defined(LINKS) && !empty(LINKS)
Line 120  afterinstall: realinstall
Line 181  afterinstall: realinstall
 realinstall: beforeinstall  realinstall: beforeinstall
 .endif  .endif
   
 cleandir: clean  
   
 .if !defined(NOMAN)  .if !defined(NOMAN)
 .include <bsd.man.mk>  .include <bsd.man.mk>
 .endif  .endif
   
 .include <bsd.obj.mk>  .include <bsd.obj.mk>
 .include <bsd.dep.mk>  .include <bsd.dep.mk>
 .include <bsd.subdir.mk>  

Legend:
Removed from v.1.24  
changed lines
  Added in v.1.47

CVSweb <webmaster@jp.NetBSD.org>