1*a7fd768aSchristos#!/bin/sh
2*a7fd768aSchristos
3*a7fd768aSchristosBUILD=../../openssl-3.0.8
4*a7fd768aSchristos
5*a7fd768aSchristoscreate() {
6*a7fd768aSchristos	sed -e "s,@proto@,$proto,g" -e "s/@PROTO@/$PROTO/g" -e "/@SRCS@/ {
7*a7fd768aSchristosr $fn.out
8*a7fd768aSchristosd
9*a7fd768aSchristos}" PROTO.in > $fn.inc
10*a7fd768aSchristosrm -f $fn.out
11*a7fd768aSchristos}
12*a7fd768aSchristos
13*a7fd768aSchristosd=
14*a7fd768aSchristosfor i in $(find ${BUILD} -name 'liblegacy-lib-*.d'); do
15*a7fd768aSchristos	nd=$(dirname "$i" | sed -e s,${BUILD}/,,)
16*a7fd768aSchristos	if [ "$nd" != "$d" ]; then
17*a7fd768aSchristos		if [ -n "$d" ]; then
18*a7fd768aSchristos			create
19*a7fd768aSchristos		fi
20*a7fd768aSchristos		fn=$(echo $nd | tr '/' '_')
21*a7fd768aSchristos		proto=$nd
22*a7fd768aSchristos		PROTO=$(echo $fn | tr '[a-z]' '[A-Z]')
23*a7fd768aSchristos		d=$nd
24*a7fd768aSchristos		rm -f $fn.out
25*a7fd768aSchristos	fi
26*a7fd768aSchristos	echo $(basename $i) | \
27*a7fd768aSchristos	    sed -e 's/.*-lib-//' -e 's/\.d/.c \\/' >> $fn.out
28*a7fd768aSchristosdone
29*a7fd768aSchristoscreate
30