xref: /netbsd-src/crypto/external/bsd/openssl/lib/libapps/mkinc (revision f4748aaa01faf324805f9747191535eb6600f82c)
1*f4748aaaSchristos#!/bin/sh
2*f4748aaaSchristos
3*f4748aaaSchristosBUILD=../../openssl-3.0.8
4*f4748aaaSchristos
5*f4748aaaSchristoscreate() {
6*f4748aaaSchristos	sed -e "s,@proto@,$proto,g" -e "s/@PROTO@/$PROTO/g" -e "/@SRCS@/ {
7*f4748aaaSchristosr $fn.out
8*f4748aaaSchristosd
9*f4748aaaSchristos}" PROTO.in > $fn.inc
10*f4748aaaSchristosrm -f $fn.out
11*f4748aaaSchristos}
12*f4748aaaSchristos
13*f4748aaaSchristosd=
14*f4748aaaSchristosfor i in $(find ${BUILD} -name 'libapps-lib-*.d'); do
15*f4748aaaSchristos	nd=$(dirname "$i" | sed -e s,${BUILD}/,,)
16*f4748aaaSchristos	if [ "$nd" != "$d" ]; then
17*f4748aaaSchristos		if [ -n "$d" ]; then
18*f4748aaaSchristos			create
19*f4748aaaSchristos		fi
20*f4748aaaSchristos		fn=$(echo $nd | tr '/' '_')
21*f4748aaaSchristos		proto=$nd
22*f4748aaaSchristos		PROTO=$(echo $fn | tr '[a-z]' '[A-Z]')
23*f4748aaaSchristos		d=$nd
24*f4748aaaSchristos		rm -f $fn.out
25*f4748aaaSchristos	fi
26*f4748aaaSchristos	echo $(basename $i) | \
27*f4748aaaSchristos	    sed -e 's/.*-lib-//' -e 's/\.d/.c \\/' >> $fn.out
28*f4748aaaSchristosdone
29*f4748aaaSchristoscreate
30