1#!/bin/sh
2
3suffixes="_all _shared _smart _debug _release"
4/bin/ls -1 */Makefile.fpc | while read d; do
5  packages=`grep "^packages" $d | cut -f 2 -d '='`
6  currpackage=`dirname $d`
7  hasdeps=0
8  for suf in $suffixes; do
9     dep=""
10     for p in $packages; do
11       dep="${dep}${dep:+ }$p$suf"
12     done
13     if [ -n "$dep" ]; then
14       echo "$currpackage$suf: $dep"
15       hasdeps=1
16     fi
17  done
18  [ $hasdeps -eq 1 ] && echo ""
19  done
20