1
0

depmaker 701 B

1234567891011121314151617181920212223242526272829303132333435
  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. (( x_cols = (COLUMNS > 10) ? COLUMNS - 2 : 80 ))
  9. typeset -L$x_cols pbar
  10. for dn in */Makefile; do
  11. dn=${dn%/*}
  12. pbar="$dn ..."
  13. print -nu2 "$pbar\r"
  14. case $dn {
  15. (@(?(e)g|uc|)libc|libpthread|uclibc++) ;;
  16. (*)
  17. # dnu: directory name, uppercase, y/-+/_X/
  18. typeset -u dnu=${dn//-/_}
  19. dnu=${dnu//+/X}
  20. print "package-\$(ADK_COMPILE_${dnu}) += $dn"
  21. ;;
  22. }
  23. cd $dn
  24. deps=$($GMAKE show=PKG_BUILDDEP)
  25. cd ..
  26. [[ -n $deps ]] || continue
  27. x="${dn}-compile:"
  28. for dep in $deps; do
  29. x="$x ${dep}-compile"
  30. done
  31. print -r -- $x
  32. done >Depends.mk
  33. pbar=done
  34. print -u2 "$pbar"