Home | History | Annotate | Line # | Download | only in mk
      1 #!/bin/sh
      2 # $NetBSD: compare-lib-lists,v 1.3 2019/11/18 16:23:28 christos Exp $
      3 #
      4 # Q+D script to print the library lists for comparison between whats in the
      5 # bsd.prog.mk file and bsd.README (this matches)
      6 #
      7 # Also compare the list of LIB variables we create against the actually
      8 # installed archives (this does *not* match -- yet)
      9 
     10 prog=$(basename "$0")
     11 
     12 RD=/tmp/${prog}.rd.$$
     13 MK=/tmp/${prog}.mk.$$
     14 IN=/tmp/${prog}.in.$$
     15 LB=/tmp/${prog}.lb.$$
     16 
     17 trap "rm -f ${MK} ${RD} ${IN} ${LB}" 0 1 2 3 15
     18 
     19 make -f - all << \EOF > ${MK}
     20 .include <bsd.prog.mk>
     21 
     22 all:
     23 .for l in ${_LIBLIST}
     24 	@echo $l
     25 .endfor
     26 .for l in crt0.o crti.o crti.o crtn.o
     27 	@echo $l
     28 .endfor
     29 .for l in ${_X11LIBLIST}
     30 	@echo $l
     31 .endfor
     32 EOF
     33 
     34 grep '	LIB' bsd.README | \
     35     grep DESTDIR | \
     36     sed -e 's/.*lib\([a-zA-Z0-9_+\-]*\)\.a$/\1/' > ${RD}
     37 
     38 paste ${MK} ${RD}
     39 
     40 echo "------"
     41 
     42 cat << \EOF | make -f - xall | sort > ${IN}
     43 .include <bsd.prog.mk>
     44 
     45 xall:
     46 .for _lib in ${_LIBLIST}
     47 	@echo ${DESTDIR}/usr/lib/lib${_lib:S/xx/++/:S/atf_c/atf-c/}.a
     48 .endfor
     49 .for _lib in ${_X11LIBLIST}
     50 	@echo ${DESTDIR}${X11USRLIBDIR}/lib${_lib}.a
     51 .endfor
     52 EOF
     53 
     54 ls -1 /usr/lib/*.a /usr/X11R7/lib/*.a | \
     55     egrep -v '(_p|_pic|_g)\.a' | sort > ${LB}
     56 
     57 paste ${IN} ${LB}
     58