blob: 1d94b0d1395997f8d445d0973214dcec3e86d75a [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001#!/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
10DIRS="ldso libc libcrypt libintl libm libnsl libpthread libresolv librt libutil"
11
12if [ ! -f Makerules ] ; then
13 echo "Run this command in top_srcdir"
14 exit 1
15fi
16
17if [ -z "${USE_CMD}" ] ; then
18USE_CMD="cp"
19fi
20
21RM="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
29for x in */Makefile.in ; do
30 ${RM} `dirname ${x}`/Makefile
31 ${USE_CMD} extra/scripts/Makefile.libs.lvl1 `dirname ${x}`/Makefile
32done
33
34for x in utils/Makefile.in ; do
35 ${RM} `dirname ${x}`/Makefile
36 ${USE_CMD} extra/scripts/Makefile.utils.lvl1 `dirname ${x}`/Makefile
37done
38
39for x in */*/Makefile.in ; do
40 ${RM} `dirname ${x}`/Makefile
41 ${USE_CMD} extra/scripts/Makefile.objs.lvl2 `dirname ${x}`/Makefile
42done
43
44# overwrites the earlier ones, we do not add arch specific to libm/arch
45for 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
48done
49
50for x in */*/*/Makefile.in ; do
51 ${RM} `dirname ${x}`/Makefile
52 ${USE_CMD} extra/scripts/Makefile.objs.lvl3 `dirname ${x}`/Makefile
53done
54
55for x in libc/*/*/Makefile.arch ; do
56 ${RM} `dirname ${x}`/Makefile
57 ${USE_CMD} extra/scripts/Makefile.arch.lvl3 `dirname ${x}`/Makefile
58done
59
60for x in */*/*/*/Makefile.in ; do
61 ${RM} `dirname ${x}`/Makefile
62 ${USE_CMD} extra/scripts/Makefile.objs.lvl4 `dirname ${x}`/Makefile
63done
64
65# we do not add these to libpthread/PTNAME/sysdeps/arch
66for x in libc/*/*/*/Makefile.arch ; do
67 ${RM} `dirname ${x}`/Makefile
68 ${USE_CMD} extra/scripts/Makefile.arch.lvl4 `dirname ${x}`/Makefile
69done
70
71exit 0