create_makefiles.sh 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. #!/bin/sh
  2. #
  3. # Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org>
  4. #
  5. # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  6. #
  7. # Creates the necessary Makefiles to build w/ the Makefile.{arch,in} files
  8. DIRS="ldso libc libcrypt libintl libm libnsl libpthread libresolv librt libutil"
  9. if [ ! -f Makerules ] ; then
  10. echo "Run this command in top_srcdir"
  11. exit 1
  12. fi
  13. if [ -z "${USE_CMD}" ] ; then
  14. USE_CMD="cp"
  15. fi
  16. RM="rm -f"
  17. ${RM} Makefile
  18. ${USE_CMD} extra/scripts/Makefile.libs.lvl0 Makefile
  19. #for x in ${DIRS} ; do
  20. # find ./${x} -name Makefile -exec rm -f {} \;
  21. #done
  22. for x in */Makefile.in ; do
  23. ${RM} `dirname ${x}`/Makefile
  24. ${USE_CMD} extra/scripts/Makefile.libs.lvl1 `dirname ${x}`/Makefile
  25. done
  26. for x in utils/Makefile.in ; do
  27. ${RM} `dirname ${x}`/Makefile
  28. ${USE_CMD} extra/scripts/Makefile.utils.lvl1 `dirname ${x}`/Makefile
  29. done
  30. for x in */*/Makefile.in ; do
  31. ${RM} `dirname ${x}`/Makefile
  32. ${USE_CMD} extra/scripts/Makefile.objs.lvl2 `dirname ${x}`/Makefile
  33. done
  34. # overwrites the earlier ones, we do not add arch specific to libm/arch
  35. for x in ldso/*/Makefile.in libpthread/*/Makefile.in ; do
  36. ${RM} `dirname ${x}`/Makefile
  37. ${USE_CMD} extra/scripts/Makefile.libs.lvl2 `dirname ${x}`/Makefile
  38. done
  39. for x in */*/*/Makefile.in ; do
  40. ${RM} `dirname ${x}`/Makefile
  41. ${USE_CMD} extra/scripts/Makefile.objs.lvl3 `dirname ${x}`/Makefile
  42. done
  43. for x in libc/*/*/Makefile.arch ; do
  44. ${RM} `dirname ${x}`/Makefile
  45. ${USE_CMD} extra/scripts/Makefile.arch.lvl3 `dirname ${x}`/Makefile
  46. done
  47. for x in */*/*/*/Makefile.in ; do
  48. ${RM} `dirname ${x}`/Makefile
  49. ${USE_CMD} extra/scripts/Makefile.objs.lvl4 `dirname ${x}`/Makefile
  50. done
  51. # we do not add these to libpthread/PTNAME/sysdeps/arch
  52. for x in libc/*/*/*/Makefile.arch ; do
  53. ${RM} `dirname ${x}`/Makefile
  54. ${USE_CMD} extra/scripts/Makefile.arch.lvl4 `dirname ${x}`/Makefile
  55. done
  56. exit 0