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