lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame^] | 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 | |
| 8 | # Creates the necessary Makefiles to build w/ the Makefile.{arch,in} files |
| 9 | |
| 10 | DIRS="ldso libc libcrypt libintl libm libnsl libpthread libresolv librt libutil" |
| 11 | |
| 12 | if [ ! -f Makerules ] ; then |
| 13 | echo "Run this command in top_srcdir" |
| 14 | exit 1 |
| 15 | fi |
| 16 | |
| 17 | if [ -z "${USE_CMD}" ] ; then |
| 18 | USE_CMD="cp" |
| 19 | fi |
| 20 | |
| 21 | RM="rm -f" |
| 22 | ${RM} Makefile |
| 23 | ${USE_CMD} extra/scripts/Makefile.libs.lvl0 Makefile |
| 24 | |
| 25 | #for x in ${DIRS} ; do |
| 26 | # find ./${x} -name Makefile -exec rm -f {} \; |
| 27 | #done |
| 28 | |
| 29 | for x in */Makefile.in ; do |
| 30 | ${RM} `dirname ${x}`/Makefile |
| 31 | ${USE_CMD} extra/scripts/Makefile.libs.lvl1 `dirname ${x}`/Makefile |
| 32 | done |
| 33 | |
| 34 | for x in utils/Makefile.in ; do |
| 35 | ${RM} `dirname ${x}`/Makefile |
| 36 | ${USE_CMD} extra/scripts/Makefile.utils.lvl1 `dirname ${x}`/Makefile |
| 37 | done |
| 38 | |
| 39 | for x in */*/Makefile.in ; do |
| 40 | ${RM} `dirname ${x}`/Makefile |
| 41 | ${USE_CMD} extra/scripts/Makefile.objs.lvl2 `dirname ${x}`/Makefile |
| 42 | done |
| 43 | |
| 44 | # overwrites the earlier ones, we do not add arch specific to libm/arch |
| 45 | for x in ldso/*/Makefile.in libpthread/*/Makefile.in ; do |
| 46 | ${RM} `dirname ${x}`/Makefile |
| 47 | ${USE_CMD} extra/scripts/Makefile.libs.lvl2 `dirname ${x}`/Makefile |
| 48 | done |
| 49 | |
| 50 | for x in */*/*/Makefile.in ; do |
| 51 | ${RM} `dirname ${x}`/Makefile |
| 52 | ${USE_CMD} extra/scripts/Makefile.objs.lvl3 `dirname ${x}`/Makefile |
| 53 | done |
| 54 | |
| 55 | for x in libc/*/*/Makefile.arch ; do |
| 56 | ${RM} `dirname ${x}`/Makefile |
| 57 | ${USE_CMD} extra/scripts/Makefile.arch.lvl3 `dirname ${x}`/Makefile |
| 58 | done |
| 59 | |
| 60 | for x in */*/*/*/Makefile.in ; do |
| 61 | ${RM} `dirname ${x}`/Makefile |
| 62 | ${USE_CMD} extra/scripts/Makefile.objs.lvl4 `dirname ${x}`/Makefile |
| 63 | done |
| 64 | |
| 65 | # we do not add these to libpthread/PTNAME/sysdeps/arch |
| 66 | for x in libc/*/*/*/Makefile.arch ; do |
| 67 | ${RM} `dirname ${x}`/Makefile |
| 68 | ${USE_CMD} extra/scripts/Makefile.arch.lvl4 `dirname ${x}`/Makefile |
| 69 | done |
| 70 | |
| 71 | exit 0 |