fix TLS memory leak with dlopen
[uclibc-ng.git] / extra / scripts / create_makefiles.sh
blob1d94b0d1395997f8d445d0973214dcec3e86d75a
1 #!/bin/sh
3 # Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org>
5 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
8 # Creates the necessary Makefiles to build w/ the Makefile.{arch,in} files
10 DIRS="ldso libc libcrypt libintl libm libnsl libpthread libresolv librt libutil"
12 if [ ! -f Makerules ] ; then
13 echo "Run this command in top_srcdir"
14 exit 1
17 if [ -z "${USE_CMD}" ] ; then
18 USE_CMD="cp"
21 RM="rm -f"
22 ${RM} Makefile
23 ${USE_CMD} extra/scripts/Makefile.libs.lvl0 Makefile
25 #for x in ${DIRS} ; do
26 # find ./${x} -name Makefile -exec rm -f {} \;
27 #done
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
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
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
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
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
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
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
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
71 exit 0