1
0

depmaker 772 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. unset MAKEFLAGS
  2. export MAKEFLAGS=s
  3. cd "$(dirname "$0")"
  4. export TOPDIR=$(realpath ..)
  5. if gmake --help >/dev/null 2>&1; then
  6. export GMAKE=gmake
  7. else
  8. export GMAKE=make
  9. fi
  10. GMAKE="$GMAKE --no-print-directory"
  11. (( x_cols = (COLUMNS > 10) ? COLUMNS - 2 : 80 ))
  12. typeset -L$x_cols pbar
  13. for dn in */Makefile; do
  14. dn=${dn%/*}
  15. pbar="$dn ..."
  16. print -nu2 "$pbar\r"
  17. case $dn {
  18. (@(?(e)g|uc|)libc|libpthread|uclibc++) ;;
  19. (*)
  20. # dnu: directory name, uppercase, y/-+/_X/
  21. typeset -u dnu=${dn//-/_}
  22. dnu=${dnu//+/X}
  23. print "package-\$(ADK_COMPILE_${dnu}) += $dn"
  24. ;;
  25. }
  26. cd $dn
  27. deps=$($GMAKE show=PKG_BUILDDEP)
  28. cd ..
  29. [[ -n $deps ]] || continue
  30. x="${dn}-compile:"
  31. for dep in $deps; do
  32. x="$x ${dep}-compile"
  33. done
  34. print -r -- $x
  35. done >Depends.mk
  36. pbar=done
  37. print -u2 "$pbar"