create_makefiles.sh 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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 */*/Makefile.in ; do
  27. ${RM} $(dirname ${x})/Makefile
  28. ${USE_CMD} extra/scripts/Makefile.objs.lvl2 $(dirname ${x})/Makefile
  29. done
  30. # overwrites the earlier ones, we do not add arch specific to libm/arch
  31. for x in ldso/*/Makefile.in libpthread/*/Makefile.in ; do
  32. ${RM} $(dirname ${x})/Makefile
  33. ${USE_CMD} extra/scripts/Makefile.libs.lvl2 $(dirname ${x})/Makefile
  34. done
  35. for x in */*/*/Makefile.in ; do
  36. ${RM} $(dirname ${x})/Makefile
  37. ${USE_CMD} extra/scripts/Makefile.objs.lvl3 $(dirname ${x})/Makefile
  38. done
  39. for x in libc/*/*/Makefile.arch ; do
  40. ${RM} $(dirname ${x})/Makefile
  41. ${USE_CMD} extra/scripts/Makefile.arch.lvl3 $(dirname ${x})/Makefile
  42. done
  43. for x in */*/*/*/Makefile.in ; do
  44. ${RM} $(dirname ${x})/Makefile
  45. ${USE_CMD} extra/scripts/Makefile.objs.lvl4 $(dirname ${x})/Makefile
  46. done
  47. # we do not add these to libpthread/PTNAME/sysdeps/arch
  48. for x in libc/*/*/*/Makefile.arch ; do
  49. ${RM} $(dirname ${x})/Makefile
  50. ${USE_CMD} extra/scripts/Makefile.arch.lvl4 $(dirname ${x})/Makefile
  51. done
  52. exit 0