[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.20 and 1.47

version 1.20, 1993/07/29 22:04:55 version 1.47, 1994/02/09 23:50:36
Line 1 
Line 1 
 #       @(#)bsd.lib.mk  5.26 (Berkeley) 5/2/91  #       from: @(#)bsd.lib.mk    5.26 (Berkeley) 5/2/91
   #       $Id$
   
 .if exists(${.CURDIR}/../Makefile.inc)  .if exists(${.CURDIR}/../Makefile.inc)
 .include "${.CURDIR}/../Makefile.inc"  .include "${.CURDIR}/../Makefile.inc"
 .endif  .endif
   
 LIBDIR?=        /usr/lib  .if exists(${.CURDIR}/shlib_version)
 LINTLIBDIR?=    /usr/libdata/lint  SHLIB_MAJOR != . ${.CURDIR}/shlib_version ; echo $$major
 LIBGRP?=        bin  SHLIB_MINOR != . ${.CURDIR}/shlib_version ; echo $$minor
 LIBOWN?=        bin  .endif
 LIBMODE?=       444  
   
 STRIP?= -s  
   
 BINGRP?=        bin  
 BINOWN?=        bin  
 BINMODE?=       555  
   
 .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 .8 .7 .6 .5 .4 .3 .2 .1 .0  .SUFFIXES: .out .o .po .so .S .s .c .cc .C .f .y .l
   
 .8.0 .7.0 .6.0 .5.0 .4.0 .3.0 .2.0 .1.0:  
         nroff -mandoc ${.IMPSRC} > ${.TARGET}  
   
 .c.o:  .c.o:
         ${CC} ${CFLAGS} -c ${.IMPSRC}          ${CC} ${CFLAGS} -c ${.IMPSRC}
Line 35  BINMODE?= 555
Line 27  BINMODE?= 555
         @${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 45  BINMODE?= 555
Line 42  BINMODE?= 555
         @${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}
   
 .if !defined(NOMAN)  .S.so .s.so:
 MANALL= ${MAN1} ${MAN2} ${MAN3} ${MAN4} ${MAN5} ${MAN6} ${MAN7} ${MAN8}          ${CPP} -E -DPIC ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} | \
 .endif              ${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
Line 67  _LIBS=lib${LIB}.a lib${LIB}_p.a
Line 71  _LIBS=lib${LIB}.a lib${LIB}_p.a
 _LIBS=lib${LIB}.a  _LIBS=lib${LIB}.a
 .endif  .endif
   
 all: ${_LIBS} ${MANALL}# llib-l${LIB}.ln  .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
   
 OBJS+=  ${SRCS:R:S/$/.o/g}  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 92  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
   
 .if !target(cleandir)  cleandir: clean
 cleandir:  
         rm -f a.out Errs errs mklog core ${CLEANFILES}  
         rm -f ${OBJS}  
         rm -f ${POBJS} profiled/*.o  
         rm -f lib${LIB}.a lib${LIB}_p.a llib-l${LIB}.ln  
         rm -f ${MANALL} ${.CURDIR}/tags .depend  
 .endif  
   
 .if !target(depend)  .if defined(SRCS)
 depend: .depend  afterdepend:
 .depend: ${SRCS}  
         rm -f .depend  
         files="${.ALLSRC:M*.c}"; \  
         if [ "$$files" != "" ]; then \  
           mkdep -a ${MKDEP} ${CFLAGS:M-[ID]*} $$files; \  
         fi  
         files="${.ALLSRC:M*.cc} ${.ALLSRC:M*.C} ${.ALLSRC:M*.cxx}"; \  
         if [ "$$files" != "  " ]; then \  
           mkdep -a ${MKDEP} -+ ${CXXFLAGS:M-[ID]*} $$files; \  
         fi  
         @(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  .endif
   
 .if !target(install)  .if !target(install)
 .if !target(beforeinstall)  .if !target(beforeinstall)
 beforeinstall:  beforeinstall:
         @if [ ! -d "${DESTDIR}${LIBDIR}" ]; then \  
                 /bin/rm -f ${DESTDIR}${LIBDIR} ; \  
                 mkdir -p ${DESTDIR}${LIBDIR} ; \  
                 chown root.wheel ${DESTDIR}${LIBDIR} ; \  
                 chmod 755 ${DESTDIR}${LIBDIR} ; \  
         else \  
                 true ; \  
         fi  
 .endif  .endif
   
 realinstall:  realinstall:
Line 145  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 166  afterinstall: realinstall
Line 181  afterinstall: realinstall
 realinstall: beforeinstall  realinstall: beforeinstall
 .endif  .endif
   
 .if !target(lint)  
 lint:  
 .endif  
   
 .if !target(tags)  
 tags: ${SRCS}  
         -cd ${.CURDIR}; ctags -f /dev/stdout ${.ALLSRC:M*.c} | \  
             sed "s;\${.CURDIR}/;;" > tags  
 .endif  
   
 .if !defined(NOMAN)  .if !defined(NOMAN)
 .include <bsd.man.mk>  .include <bsd.man.mk>
 .endif  .endif
   
 .if !target(obj)  .include <bsd.obj.mk>
 .if defined(NOOBJ)  .include <bsd.dep.mk>
 obj:  
 .else  
 obj:  
         @cd ${.CURDIR}; rm -f obj > /dev/null 2>&1 || true; \  
         here=`pwd`; subdir=`echo $$here | sed 's,^/usr/src/,,'`; \  
         if test $$here != $$subdir ; then \  
                 dest=/usr/obj/$$subdir ; \  
                 echo "$$here -> $$dest"; ln -s $$dest obj; \  
                 if test -d /usr/obj -a ! -d $$dest; then \  
                         mkdir -p $$dest; \  
                 else \  
                         true; \  
                 fi; \  
         else \  
                 true ; \  
                 dest=$$here/obj ; \  
                 if test ! -d obj ; then \  
                         echo "making $$dest" ; \  
                         mkdir $$dest; \  
                 fi; \  
         fi;  
 .endif  
 .endif  

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

CVSweb <webmaster@jp.NetBSD.org>