| @@ -11,65 +11,71 @@ CHECK_SUBDIRS="gnu/lib gnu/lib/libgcc4 l | | | @@ -11,65 +11,71 @@ CHECK_SUBDIRS="gnu/lib gnu/lib/libgcc4 l |
11 | | | 11 | |
12 | # lib/csu is spsecial | | 12 | # lib/csu is spsecial |
13 | # lib/libm needs to be special -- i387 | | 13 | # lib/libm needs to be special -- i387 |
14 | # gnu/lib/libsupc++ -- fails to get NOPROFILE properly | | 14 | # gnu/lib/libsupc++ -- fails to get NOPROFILE properly |
15 | | | 15 | |
16 | tmpdir=`mktemp -d /var/tmp/build-makefiles-$$.XXXXXX` || exit 1 | | 16 | tmpdir=`mktemp -d /var/tmp/build-makefiles-$$.XXXXXX` || exit 1 |
17 | | | 17 | |
18 | write_if_new() { | | 18 | write_if_new() { |
19 | _file="$1" | | 19 | _file="$1" |
20 | _new="$2" | | 20 | _new="$2" |
21 | } | | 21 | } |
22 | | | 22 | |
23 | for _dir in ${CHECK_SUBDIRS}; do | | 23 | for _dir in ${CHECK_SUBDIRS}; do |
| | | 24 | |
| | | 25 | # set this to true if the needs to be no master subdir Makefile |
| | | 26 | _need_no_subdir=false |
| | | 27 | |
24 | if [ ${_dir} = "lib/csu" ]; then | | 28 | if [ ${_dir} = "lib/csu" ]; then |
25 | _subdirs="i386_elf sparc_elf" | | 29 | _subdirs="i386_elf sparc_elf" |
| | | 30 | _need_no_subdir=true |
26 | else | | 31 | else |
27 | _subdirs=`cd ${srcdir}/${_dir}; ${MAKE} -V SUBDIR` | | 32 | _subdirs=`cd ${srcdir}/${_dir}; ${MAKE} -V SUBDIR` |
28 | fi | | 33 | fi |
29 | | | 34 | |
30 | echo "looking in: $_dir: subdirs $_subdirs" | | 35 | echo "looking in: $_dir: subdirs $_subdirs" |
31 | for _sd in $_subdirs; do | | 36 | for _sd in $_subdirs; do |
32 | # skip lib/csu -- | | 37 | # skip lib/csu -- |
33 | if [ "$_dir" = "lib" -a "$_sd" = "csu" ]; then | | 38 | if [ "$_dir" = "lib" -a "$_sd" = "csu" ]; then |
34 | continue | | 39 | continue |
35 | fi | | 40 | fi |
36 | | | 41 | |
37 | # skip .WAIT -- | | 42 | # skip .WAIT -- |
38 | if [ "$_sd" = ".WAIT" ]; then | | 43 | if [ "$_sd" = ".WAIT" ]; then |
39 | continue | | 44 | continue |
40 | fi | | 45 | fi |
41 | | | 46 | |
42 | # skip a bunch of non-lib subdirs -- | | 47 | # skip a bunch of non-lib subdirs -- |
43 | case "$_dir/$_sd" in | | 48 | case "$_dir" in |
44 | external/bsd/fetch | \ | | 49 | external/bsd/fetch | \ |
45 | external/bsd/file | \ | | 50 | external/bsd/file | \ |
46 | external/bsd/iscsi | \ | | 51 | external/bsd/iscsi | \ |
47 | external/bsd/libarchive | \ | | 52 | external/bsd/libarchive | \ |
48 | crypto/external/bsd/netpgp | \ | | 53 | crypto/external/bsd/netpgp | \ |
49 | crypto/external/bsd/openssh ) | | 54 | crypto/external/bsd/openssh ) |
50 | if [ "$_sd" != "lib" ]; then | | 55 | if [ "$_sd" != "lib" ]; then |
51 | continue; | | 56 | continue; |
52 | fi | | 57 | fi |
| | | 58 | _need_no_subdir=true |
53 | esac | | 59 | esac |
54 | | | 60 | |
55 | _libdplibs="`cd ${srcdir}/${_dir}/${_sd}; ${MAKE} -V LIBDPLIBS | sed 's,\({NETBSDSRCDIR}\),\1/compat,g'`" | | 61 | _libdplibs="`cd ${srcdir}/${_dir}/${_sd}; ${MAKE} -V LIBDPLIBS | sed 's,\({NETBSDSRCDIR}\),\1/compat,g'`" |
56 | echo "creating stuff for subdir: $_sd" | | 62 | echo "creating stuff for subdir: $_sd" |
57 | echo " - libdplibs = ${_libdplibs}" | | 63 | echo " - libdplibs = ${_libdplibs}" |
58 | mkdir -p ${rwsrcdir}/compat/${_dir}/${_sd} | | 64 | mkdir -p ${rwsrcdir}/compat/${_dir}/${_sd} |
59 | ( | | 65 | ( |
60 | echo -n '# $Net' | | 66 | echo -n '# $Net' |
61 | echo 'BSD$' | | 67 | echo 'BSD$' |
62 | echo '# Generated from: $NetBSD: build-makefiles,v 1.6 2009/07/21 00:12:00 mrg Exp $' | sed -e 's/$//g' | | 68 | echo '# Generated from: $NetBSD: build-makefiles,v 1.7 2009/07/21 00:23:02 mrg Exp $' | sed -e 's/\$//g' |
63 | cat <<'EOF' | | 69 | cat <<'EOF' |
64 | | | 70 | |
65 | NOLINT= # defined | | 71 | NOLINT= # defined |
66 | NOMAN= # defined | | 72 | NOMAN= # defined |
67 | NONLS= # defined | | 73 | NONLS= # defined |
68 | NOINFO= # defined | | 74 | NOINFO= # defined |
69 | NOSHARE= # defined | | 75 | NOSHARE= # defined |
70 | EOF | | 76 | EOF |
71 | # XXX various hacks | | 77 | # XXX various hacks |
72 | case "${_sd}" in | | 78 | case "${_sd}" in |
73 | libsupc++4) | | 79 | libsupc++4) |
74 | echo "NOPROFILE= # defined" | | 80 | echo "NOPROFILE= # defined" |
75 | ;; | | 81 | ;; |
| @@ -115,27 +121,27 @@ EOF | | | @@ -115,27 +121,27 @@ EOF |
115 | | | 121 | |
116 | # Resolve pathnames from "real" Makefile, and switch .CURDIR back. | | 122 | # Resolve pathnames from "real" Makefile, and switch .CURDIR back. |
117 | _RESOLVE_VARS= CFLAGS CPPFLAGS DPADD LDADD ARCHDIR COMPATDIR COMPATARCHDIR LIBCDIR RPC_INCS RPC_XDIR LIBEDITDIR MODOBJDIR RUMPTOP | | 123 | _RESOLVE_VARS= CFLAGS CPPFLAGS DPADD LDADD ARCHDIR COMPATDIR COMPATARCHDIR LIBCDIR RPC_INCS RPC_XDIR LIBEDITDIR MODOBJDIR RUMPTOP |
118 | .for var in ${_RESOLVE_VARS} | | 124 | .for var in ${_RESOLVE_VARS} |
119 | ${var}:= ${${var}} | | 125 | ${var}:= ${${var}} |
120 | .endfor | | 126 | .endfor |
121 | | | 127 | |
122 | .CURDIR:= ${_CURDIR} | | 128 | .CURDIR:= ${_CURDIR} |
123 | .undef _CURDIR | | 129 | .undef _CURDIR |
124 | EOF | | 130 | EOF |
125 | ) > ${rwsrcdir}/compat/${_dir}/${_sd}/Makefile | | 131 | ) > ${rwsrcdir}/compat/${_dir}/${_sd}/Makefile |
126 | done | | 132 | done |
127 | | | 133 | |
128 | if [ "${_dir}" != "lib/csu" ]; then | | 134 | if [ "${_need_no_subdir}" != "true" ]; then |
129 | (printf '# $'NetBSD'$\n\n' | | 135 | (printf '# $'NetBSD'$\n\n' |
130 | printf ".include <bsd.own.mk>\n\n" | | 136 | printf ".include <bsd.own.mk>\n\n" |
131 | printf "_CURDIR:= \${.CURDIR}\n\n" | | 137 | printf "_CURDIR:= \${.CURDIR}\n\n" |
132 | printf ".CURDIR:=\${NETBSDSRCDIR}/${_dir}\n\n" | | 138 | printf ".CURDIR:=\${NETBSDSRCDIR}/${_dir}\n\n" |
133 | printf ".include "'"'"\${.CURDIR}/Makefile"'"'"\n\n" | | 139 | printf ".include "'"'"\${.CURDIR}/Makefile"'"'"\n\n" |
134 | printf ".CURDIR:= \${_CURDIR}\n" | | 140 | printf ".CURDIR:= \${_CURDIR}\n" |
135 | ) > ${rwsrcdir}/compat/${_dir}/Makefile | | 141 | ) > ${rwsrcdir}/compat/${_dir}/Makefile |
136 | | | 142 | |
137 | if [ -f "${srcdir}/${_dir}/Makefile.inc" ]; then | | 143 | if [ -f "${srcdir}/${_dir}/Makefile.inc" ]; then |
138 | (printf '# $'NetBSD'$\n\n' | | 144 | (printf '# $'NetBSD'$\n\n' |
139 | printf ".include <bsd.own.mk>\n\n" | | 145 | printf ".include <bsd.own.mk>\n\n" |
140 | printf "_CURDIR:= \${.CURDIR}\n\n" | | 146 | printf "_CURDIR:= \${.CURDIR}\n\n" |
141 | printf ".include "'"'"\${NETBSDSRCDIR}/${_dir}/Makefile.inc"'"'"\n\n" | | 147 | printf ".include "'"'"\${NETBSDSRCDIR}/${_dir}/Makefile.inc"'"'"\n\n" |