depmaker 550 B

12345678910111213141516171819202122232425262728
  1. cd "$(dirname "$0")"
  2. export TOPDIR=$(realpath ..)
  3. if gmake --help >/dev/null 2>&1; then
  4. export GMAKE=gmake
  5. else
  6. export GMAKE=make
  7. fi
  8. for subdir in */Makefile; do
  9. subdir=${subdir%/*}
  10. case $subdir {
  11. (@(?(e)g|uc|)libc|libpthread|uclibc++) ;;
  12. (*)
  13. typeset -u dnu=${subdir//-/_}
  14. dnu=${dnu//+/X}
  15. print "package-\$(ADK_COMPILE_${dnu}) += $subdir"
  16. ;;
  17. }
  18. cd $subdir
  19. deps=$($GMAKE show=PKG_BUILDDEP)
  20. cd ..
  21. [[ -n $deps ]] || continue
  22. x="${subdir}-compile:"
  23. for dep in $deps; do
  24. x="$x ${dep}-compile"
  25. done
  26. print -r -- $x
  27. done >Depends.mk