head 1.160; access; symbols netbsd-10-0-RELEASE:1.146 netbsd-10-0-RC6:1.146 netbsd-10-0-RC5:1.146 netbsd-10-0-RC4:1.146 netbsd-10-0-RC3:1.146 netbsd-10-0-RC2:1.146 netbsd-10-0-RC1:1.146 netbsd-10:1.146.0.2 netbsd-10-base:1.146 netbsd-9-3-RELEASE:1.135 cjep_sun2x-base1:1.140 cjep_sun2x:1.140.0.4 cjep_sun2x-base:1.140 cjep_staticlib_x-base1:1.140 netbsd-9-2-RELEASE:1.135 cjep_staticlib_x:1.140.0.2 cjep_staticlib_x-base:1.140 netbsd-9-1-RELEASE:1.135 phil-wifi-20200421:1.135 phil-wifi-20200411:1.135 is-mlppp:1.135.0.4 is-mlppp-base:1.135 phil-wifi-20200406:1.135 netbsd-8-2-RELEASE:1.128 netbsd-9-0-RELEASE:1.135 netbsd-9-0-RC2:1.135 netbsd-9-0-RC1:1.135 phil-wifi-20191119:1.135 netbsd-9:1.135.0.2 netbsd-9-base:1.135 phil-wifi-20190609:1.135 netbsd-8-1-RELEASE:1.128 netbsd-8-1-RC1:1.128 pgoyette-compat-merge-20190127:1.131.2.1 pgoyette-compat-20190127:1.134 pgoyette-compat-20190118:1.134 pgoyette-compat-1226:1.134 pgoyette-compat-1126:1.134 pgoyette-compat-1020:1.134 pgoyette-compat-0930:1.134 pgoyette-compat-0906:1.134 netbsd-7-2-RELEASE:1.109.2.1 pgoyette-compat-0728:1.133 netbsd-8-0-RELEASE:1.128 phil-wifi:1.133.0.2 phil-wifi-base:1.133 pgoyette-compat-0625:1.133 netbsd-8-0-RC2:1.128 pgoyette-compat-0521:1.133 pgoyette-compat-0502:1.131 pgoyette-compat-0422:1.131 netbsd-8-0-RC1:1.128 pgoyette-compat-0415:1.131 pgoyette-compat-0407:1.131 pgoyette-compat-0330:1.131 pgoyette-compat-0322:1.131 pgoyette-compat-0315:1.131 netbsd-7-1-2-RELEASE:1.109.2.1 pgoyette-compat:1.131.0.2 pgoyette-compat-base:1.131 netbsd-7-1-1-RELEASE:1.109.2.1 matt-nb8-mediatek:1.128.0.6 matt-nb8-mediatek-base:1.128 perseant-stdc-iso10646:1.128.0.4 perseant-stdc-iso10646-base:1.128 netbsd-8:1.128.0.2 netbsd-8-base:1.128 prg-localcount2-base3:1.127 prg-localcount2-base2:1.127 prg-localcount2-base1:1.127 prg-localcount2:1.127.0.2 prg-localcount2-base:1.127 pgoyette-localcount-20170426:1.127 bouyer-socketcan-base1:1.126 pgoyette-localcount-20170320:1.124 netbsd-7-1:1.109.2.1.0.6 netbsd-7-1-RELEASE:1.109.2.1 netbsd-7-1-RC2:1.109.2.1 netbsd-7-nhusb-base-20170116:1.109.2.1 bouyer-socketcan:1.122.0.4 bouyer-socketcan-base:1.122 pgoyette-localcount-20170107:1.122 netbsd-7-1-RC1:1.109.2.1 pgoyette-localcount-20161104:1.122 netbsd-7-0-2-RELEASE:1.109.2.1 localcount-20160914:1.122 netbsd-7-nhusb:1.109.2.1.0.4 netbsd-7-nhusb-base:1.109.2.1 pgoyette-localcount-20160806:1.122 pgoyette-localcount-20160726:1.122 pgoyette-localcount:1.122.0.2 pgoyette-localcount-base:1.122 netbsd-7-0-1-RELEASE:1.109.2.1 netbsd-7-0:1.109.2.1.0.2 netbsd-7-0-RELEASE:1.109.2.1 netbsd-7-0-RC3:1.109.2.1 netbsd-7-0-RC2:1.109.2.1 netbsd-7-0-RC1:1.109.2.1 netbsd-5-2-3-RELEASE:1.78.2.4 netbsd-5-1-5-RELEASE:1.78.2.3 netbsd-6-0-6-RELEASE:1.98.2.1 netbsd-6-1-5-RELEASE:1.98.2.1 netbsd-7:1.109.0.2 netbsd-7-base:1.109 yamt-pagecache-base9:1.105 yamt-pagecache-tag8:1.96.2.3 netbsd-6-1-4-RELEASE:1.98.2.1 netbsd-6-0-5-RELEASE:1.98.2.1 tls-earlyentropy:1.105.0.4 tls-earlyentropy-base:1.109 riastradh-xf86-video-intel-2-7-1-pre-2-21-15:1.105 riastradh-drm2-base3:1.105 netbsd-6-1-3-RELEASE:1.98.2.1 netbsd-6-0-4-RELEASE:1.98.2.1 netbsd-5-2-2-RELEASE:1.78.2.4 netbsd-5-1-4-RELEASE:1.78.2.3 netbsd-6-1-2-RELEASE:1.98.2.1 netbsd-6-0-3-RELEASE:1.98.2.1 netbsd-5-2-1-RELEASE:1.78.2.4 netbsd-5-1-3-RELEASE:1.78.2.3 netbsd-6-1-1-RELEASE:1.98.2.1 riastradh-drm2-base2:1.105 riastradh-drm2-base1:1.105 riastradh-drm2:1.105.0.2 riastradh-drm2-base:1.105 netbsd-6-1:1.98.2.1.0.6 netbsd-6-0-2-RELEASE:1.98.2.1 netbsd-6-1-RELEASE:1.98.2.1 khorben-n900:1.103.0.6 netbsd-6-1-RC4:1.98.2.1 netbsd-6-1-RC3:1.98.2.1 agc-symver:1.103.0.4 agc-symver-base:1.103 netbsd-6-1-RC2:1.98.2.1 netbsd-6-1-RC1:1.98.2.1 yamt-pagecache-base8:1.103 netbsd-5-2:1.78.2.4.0.2 netbsd-6-0-1-RELEASE:1.98.2.1 yamt-pagecache-base7:1.103 netbsd-5-2-RELEASE:1.78.2.4 netbsd-5-2-RC1:1.78.2.4 matt-nb6-plus-nbase:1.98.2.1 yamt-pagecache-base6:1.102 netbsd-6-0:1.98.2.1.0.4 netbsd-6-0-RELEASE:1.98.2.1 netbsd-6-0-RC2:1.98.2.1 tls-maxphys:1.101.0.2 tls-maxphys-base:1.109 matt-nb6-plus:1.98.2.1.0.2 matt-nb6-plus-base:1.98.2.1 netbsd-6-0-RC1:1.98.2.1 yamt-pagecache-base5:1.99 yamt-pagecache-base4:1.99 netbsd-6:1.98.0.2 netbsd-6-base:1.98 netbsd-5-1-2-RELEASE:1.78.2.3 netbsd-5-1-1-RELEASE:1.78.2.3 yamt-pagecache-base3:1.96 yamt-pagecache-base2:1.96 yamt-pagecache:1.96.0.2 yamt-pagecache-base:1.96 cherry-xenmp:1.92.0.2 cherry-xenmp-base:1.92 bouyer-quota2-nbase:1.92 bouyer-quota2:1.91.0.2 bouyer-quota2-base:1.92 matt-mips64-premerge-20101231:1.91 matt-nb5-mips64-premerge-20101231:1.78.2.2.4.1 matt-nb5-pq3:1.78.2.3.0.4 matt-nb5-pq3-base:1.78.2.3 netbsd-5-1:1.78.2.3.0.2 netbsd-5-1-RELEASE:1.78.2.3 netbsd-5-1-RC4:1.78.2.3 matt-nb5-mips64-k15:1.78.2.2.4.1 netbsd-5-1-RC3:1.78.2.3 netbsd-5-1-RC2:1.78.2.3 netbsd-5-1-RC1:1.78.2.3 netbsd-5-0-2-RELEASE:1.78.2.2 matt-nb5-mips64-premerge-20091211:1.78.2.2 matt-premerge-20091211:1.90 matt-nb5-mips64-u2-k2-k4-k7-k8-k9:1.78.2.2 matt-nb4-mips64-k7-u2a-k9b:1.78.2.2 matt-nb5-mips64-u1-k1-k5:1.78.2.2 matt-nb5-mips64:1.78.2.2.0.4 netbsd-5-0-1-RELEASE:1.78.2.2 jym-xensuspend-nbase:1.83 netbsd-5-0:1.78.2.2.0.2 netbsd-5-0-RELEASE:1.78.2.2 netbsd-5-0-RC4:1.78.2.2 netbsd-5-0-RC3:1.78.2.2 netbsd-5-0-RC2:1.78.2.2 jym-xensuspend:1.82.0.2 jym-xensuspend-base:1.83 netbsd-5-0-RC1:1.78.2.2 netbsd-5:1.78.0.2 netbsd-5-base:1.78 matt-mips64-base2:1.78 matt-mips64:1.62.0.6 netbsd-4-0-1-RELEASE:1.59.2.3 wrstuden-revivesa-base-3:1.77 wrstuden-revivesa-base-2:1.77 wrstuden-fixsa-newbase:1.59.2.3 wrstuden-revivesa-base-1:1.71 yamt-pf42-base4:1.71 yamt-pf42-base3:1.71 hpcarm-cleanup-nbase:1.71 yamt-pf42-baseX:1.71 yamt-pf42-base2:1.71 wrstuden-revivesa:1.71.0.4 wrstuden-revivesa-base:1.71 keiichi-mipv6-nbase:1.71 yamt-pf42:1.71.0.2 yamt-pf42-base:1.71 keiichi-mipv6:1.67.0.4 keiichi-mipv6-base:1.71 matt-armv6-nbase:1.69 matt-armv6-prevmlocking:1.62.4.1 wrstuden-fixsa-base-1:1.59.2.3 netbsd-4-0:1.59.2.3.0.2 netbsd-4-0-RELEASE:1.59.2.3 cube-autoconf:1.67.0.2 cube-autoconf-base:1.67 netbsd-4-0-RC5:1.59.2.3 netbsd-4-0-RC4:1.59.2.3 netbsd-4-0-RC3:1.59.2.3 netbsd-4-0-RC2:1.59.2.3 netbsd-4-0-RC1:1.59.2.2 matt-armv6:1.62.0.4 matt-armv6-base:1.67 matt-mips64-base:1.62 hpcarm-cleanup:1.62.0.2 hpcarm-cleanup-base:1.67 netbsd-3-1-1-RELEASE:1.53 netbsd-3-0-3-RELEASE:1.53 wrstuden-fixsa:1.59.2.2.0.2 wrstuden-fixsa-base:1.59.2.3 abandoned-netbsd-4-base:1.57 abandoned-netbsd-4:1.57.0.2 netbsd-3-1:1.53.0.6 netbsd-3-1-RELEASE:1.53 netbsd-3-0-2-RELEASE:1.53 netbsd-3-1-RC4:1.53 netbsd-3-1-RC3:1.53 netbsd-3-1-RC2:1.53 netbsd-3-1-RC1:1.53 netbsd-4:1.59.0.2 netbsd-4-base:1.59 netbsd-3-0-1-RELEASE:1.53 netbsd-3-0:1.53.0.4 netbsd-3-0-RELEASE:1.53 netbsd-3-0-RC6:1.53 netbsd-3-0-RC5:1.53 netbsd-3-0-RC4:1.53 netbsd-3-0-RC3:1.53 netbsd-3-0-RC2:1.53 netbsd-3-0-RC1:1.53 netbsd-2-0-3-RELEASE:1.50 netbsd-2-1:1.50.0.6 netbsd-2-1-RELEASE:1.50 netbsd-2-1-RC6:1.50 netbsd-2-1-RC5:1.50 netbsd-2-1-RC4:1.50 netbsd-2-1-RC3:1.50 netbsd-2-1-RC2:1.50 netbsd-2-1-RC1:1.50 netbsd-2-0-2-RELEASE:1.50 netbsd-3:1.53.0.2 netbsd-3-base:1.53 netbsd-2-0-1-RELEASE:1.50 netbsd-2:1.50.0.4 netbsd-2-base:1.50 netbsd-2-0-RELEASE:1.50 netbsd-2-0-RC5:1.50 netbsd-2-0-RC4:1.50 netbsd-2-0-RC3:1.50 netbsd-2-0-RC2:1.50 netbsd-2-0-RC1:1.50 netbsd-2-0:1.50.0.2 netbsd-2-0-base:1.50 netbsd-1-6-PATCH002-RELEASE:1.12.2.2 netbsd-1-6-PATCH002:1.12.2.2 netbsd-1-6-PATCH002-RC4:1.12.2.2 netbsd-1-6-PATCH002-RC3:1.12 netbsd-1-6-PATCH002-RC2:1.12 netbsd-1-6-PATCH002-RC1:1.12 netbsd-1-6-PATCH001:1.12 netbsd-1-6-PATCH001-RELEASE:1.12 netbsd-1-6-PATCH001-RC3:1.12 netbsd-1-6-PATCH001-RC2:1.12 netbsd-1-6-PATCH001-RC1:1.12 fvdl_fs64_base:1.20 netbsd-1-6-RELEASE:1.12 netbsd-1-6-RC3:1.12 netbsd-1-6-RC2:1.12 netbsd-1-6-RC1:1.12 netbsd-1-6:1.12.0.2 netbsd-1-6-base:1.12; locks; strict; comment @# @; 1.160 date 2023.07.22.18.50.04; author lukem; state Exp; branches; next 1.159; commitid M3mEjZectMFywPxE; 1.159 date 2023.07.21.22.07.59; author lukem; state Exp; branches; next 1.158; commitid 74fkWvm4yGNrEIxE; 1.158 date 2023.07.19.15.40.38; author lukem; state Exp; branches; next 1.157; commitid bFCanGmh77BtzqxE; 1.157 date 2023.07.18.16.59.57; author lukem; state Exp; branches; next 1.156; commitid RmfejxFuWRlK2jxE; 1.156 date 2023.07.05.16.41.12; author lukem; state Exp; branches; next 1.155; commitid zEYZ7EVK6ypemDvE; 1.155 date 2023.06.11.20.34.14; author lukem; state Exp; branches; next 1.154; commitid LRxwdixWRpj0qzsE; 1.154 date 2023.06.11.10.49.43; author lukem; state Exp; branches; next 1.153; commitid j0SCtZ2V7kMtbwsE; 1.153 date 2023.06.11.10.43.51; author lukem; state Exp; branches; next 1.152; commitid dLx41wijlXPs9wsE; 1.152 date 2023.06.05.22.36.17; author lukem; state Exp; branches; next 1.151; commitid L6kHjhqh6VnPhOrE; 1.151 date 2023.06.04.20.08.21; author lukem; state Exp; branches; next 1.150; commitid 4nwhtsMbfMx4vFrE; 1.150 date 2023.06.02.20.48.41; author lukem; state Exp; branches; next 1.149; commitid zosSIgiL3u9TMprE; 1.149 date 2023.05.18.14.22.53; author lukem; state Exp; branches; next 1.148; commitid xcdz3ppPTMa38spE; 1.148 date 2023.05.16.21.39.26; author lukem; state Exp; branches; next 1.147; commitid zapp6iX9R0ZEBepE; 1.147 date 2023.05.16.21.21.38; author lukem; state Exp; branches; next 1.146; commitid IWN0NJ9UsEK6vepE; 1.146 date 2022.10.01.08.55.45; author rillig; state Exp; branches; next 1.145; commitid hSZihXNfxQPfGZVD; 1.145 date 2022.08.22.16.50.25; author brook; state Exp; branches; next 1.144; commitid KPCQWxPV8Ic9BTQD; 1.144 date 2022.08.21.15.01.08; author brook; state Exp; branches; next 1.143; commitid YtripRPmXBPD1LQD; 1.143 date 2022.08.21.07.12.54; author lukem; state Exp; branches; next 1.142; commitid tiWZlSj7S3PWqIQD; 1.142 date 2022.05.28.21.54.56; author andvar; state Exp; branches; next 1.141; commitid SJHTz5xyL7aO2SFD; 1.141 date 2021.12.20.20.33.20; author christos; state Exp; branches; next 1.140; commitid FLr3jqfJSh8nGqlD; 1.140 date 2020.11.10.21.47.40; author kamil; state Exp; branches; next 1.139; commitid cOSRAAXLjROf8ovC; 1.139 date 2020.11.08.14.52.35; author kamil; state Exp; branches; next 1.138; commitid xCWymCS2aKmTP5vC; 1.138 date 2020.10.13.01.59.32; author thorpej; state Exp; branches; next 1.137; commitid LrWhmRlICzwlsGrC; 1.137 date 2020.10.12.21.14.36; author uwe; state Exp; branches; next 1.136; commitid Nq9R9ipX5hoRSErC; 1.136 date 2020.10.12.21.05.54; author uwe; state Exp; branches; next 1.135; commitid hl8PRf856EetPErC; 1.135 date 2019.05.08.14.03.57; author leot; state Exp; branches; next 1.134; commitid t4JD65wSpu7bjpmB; 1.134 date 2018.07.29.20.53.41; author sevan; state Exp; branches; next 1.133; commitid vWdZkF1iJ3c2G4MA; 1.133 date 2018.05.02.07.34.44; author pgoyette; state Exp; branches 1.133.2.1; next 1.132; commitid 88hqTnoMLgIf5HAA; 1.132 date 2018.05.02.07.19.58; author pgoyette; state dead; branches; next 1.131; commitid o3kRuNRzl9360HAA; 1.131 date 2018.02.16.10.05.22; author leot; state Exp; branches 1.131.2.1; next 1.130; commitid UPZgbj9A9X4tk4rA; 1.130 date 2017.12.29.03.05.13; author sevan; state Exp; branches; next 1.129; commitid OhAIu85bA7QXzJkA; 1.129 date 2017.10.21.23.49.28; author sevan; state Exp; branches; next 1.128; commitid 6npJUwajFUukGYbA; 1.128 date 2017.05.21.15.30.20; author riastradh; state Exp; branches; next 1.127; commitid LsvvLq9O8VD1QgSz; 1.127 date 2017.04.22.07.48.33; author plunky; state Exp; branches; next 1.126; commitid 8T9OTIBx8eSodvOz; 1.126 date 2017.04.20.09.47.52; author wiz; state Exp; branches; next 1.125; commitid WVo50O32F5AkWfOz; 1.125 date 2017.04.20.09.29.10; author ozaki-r; state Exp; branches; next 1.124; commitid I4z1bW76wU8VPfOz; 1.124 date 2017.02.20.21.28.48; author christos; state Exp; branches; next 1.123; commitid PfOCawKmK8fnIJGz; 1.123 date 2017.02.16.17.15.26; author rin; state Exp; branches; next 1.122; commitid CpgrhEUF9Mx7rcGz; 1.122 date 2016.01.29.13.51.13; author wiz; state Exp; branches 1.122.2.1 1.122.4.1; next 1.121; commitid aLChxCKlZbtDEPSy; 1.121 date 2015.07.23.08.03.24; author mrg; state Exp; branches; next 1.120; commitid nfGa2DVpEPUUPnuy; 1.120 date 2015.06.07.05.32.38; author pgoyette; state Exp; branches; next 1.119; commitid lkTp8UTtNmUNtsoy; 1.119 date 2015.04.08.05.48.24; author wiz; state Exp; branches; next 1.118; commitid 5XuZ70fTznXTuKgy; 1.118 date 2014.11.30.15.54.34; author uebayasi; state Exp; branches; next 1.117; commitid UyoOFq60nlCWZd0y; 1.117 date 2014.11.16.06.10.55; author uebayasi; state Exp; branches; next 1.116; commitid b6Oo5fl4GtoCdnYx; 1.116 date 2014.11.16.05.45.43; author uebayasi; state Exp; branches; next 1.115; commitid p8k8Et7BjwoY4nYx; 1.115 date 2014.11.13.08.42.35; author apb; state Exp; branches; next 1.114; commitid MNfwqWuxKuk290Yx; 1.114 date 2014.11.08.04.23.00; author snj; state Exp; branches; next 1.113; commitid gqVdeiSWpnCeOkXx; 1.113 date 2014.11.06.06.42.25; author uebayasi; state Exp; branches; next 1.112; commitid McvYw1TyJehlI5Xx; 1.112 date 2014.11.06.03.50.13; author uebayasi; state Exp; branches; next 1.111; commitid dB5w1Lg6vAZfL4Xx; 1.111 date 2014.11.06.03.34.11; author uebayasi; state Exp; branches; next 1.110; commitid 1IGHvAWtBt4KF4Xx; 1.110 date 2014.11.05.08.16.33; author snj; state Exp; branches; next 1.109; commitid ZssnoSekjxcygYWx; 1.109 date 2014.08.07.21.46.43; author apb; state Exp; branches 1.109.2.1; next 1.108; commitid Aqr791SB9McIDtLx; 1.108 date 2014.08.03.09.28.43; author apb; state Exp; branches; next 1.107; commitid 30xFJvICXCVBGTKx; 1.107 date 2014.06.14.12.21.41; author apb; state Exp; branches; next 1.106; commitid LuQSG8vvn0GnfuEx; 1.106 date 2014.05.21.13.12.19; author wiz; state Exp; branches; next 1.105; commitid ObNnCfqtY1cUipBx; 1.105 date 2013.05.29.21.59.51; author wiz; state Exp; branches 1.105.4.1; next 1.104; commitid DQhecqNriUTkHzRw; 1.104 date 2013.05.29.14.47.22; author wiz; state Exp; branches; next 1.103; commitid Nmqp6yF6UUfRixRw; 1.103 date 2012.11.08.15.25.01; author dholland; state Exp; branches; next 1.102; 1.102 date 2012.09.19.23.40.03; author abs; state Exp; branches; next 1.101; 1.101 date 2012.05.25.13.47.30; author wiz; state Exp; branches 1.101.2.1; next 1.100; 1.100 date 2012.05.25.10.47.25; author wiz; state Exp; branches; next 1.99; 1.99 date 2012.02.23.13.34.15; author tsutsui; state Exp; branches; next 1.98; 1.98 date 2012.02.14.21.33.02; author apb; state Exp; branches 1.98.2.1; next 1.97; 1.97 date 2012.01.22.03.53.32; author tsutsui; state Exp; branches; next 1.96; 1.96 date 2011.09.09.18.48.34; author apb; state Exp; branches 1.96.2.1; next 1.95; 1.95 date 2011.09.09.14.01.28; author apb; state Exp; branches; next 1.94; 1.94 date 2011.09.09.13.29.23; author apb; state Exp; branches; next 1.93; 1.93 date 2011.08.06.19.52.49; author jnemeth; state Exp; branches; next 1.92; 1.92 date 2011.01.29.16.56.26; author jym; state Exp; branches; next 1.91; 1.91 date 2010.07.25.07.19.00; author mrg; state Exp; branches 1.91.2.1; next 1.90; 1.90 date 2009.11.30.16.13.22; author uebayasi; state Exp; branches; next 1.89; 1.89 date 2009.10.10.19.05.28; author apb; state Exp; branches; next 1.88; 1.88 date 2009.09.27.18.08.24; author apb; state Exp; branches; next 1.87; 1.87 date 2009.09.27.17.28.38; author apb; state Exp; branches; next 1.86; 1.86 date 2009.09.07.04.14.17; author jnemeth; state Exp; branches; next 1.85; 1.85 date 2009.07.12.14.17.18; author hubertf; state Exp; branches; next 1.84; 1.84 date 2009.07.12.12.15.10; author hubertf; state Exp; branches; next 1.83; 1.83 date 2009.05.01.19.42.18; author snj; state Exp; branches; next 1.82; 1.82 date 2008.12.02.22.28.21; author mrg; state Exp; branches 1.82.2.1; next 1.81; 1.81 date 2008.11.15.11.27.50; author mrg; state Exp; branches; next 1.80; 1.80 date 2008.11.13.20.40.11; author apb; state Exp; branches; next 1.79; 1.79 date 2008.11.09.23.02.28; author mrg; state Exp; branches; next 1.78; 1.78 date 2008.09.24.07.38.04; author apb; state Exp; branches 1.78.2.1; next 1.77; 1.77 date 2008.09.06.23.23.17; author lukem; state Exp; branches; next 1.76; 1.76 date 2008.08.28.07.21.49; author lukem; state Exp; branches; next 1.75; 1.75 date 2008.08.18.05.27.05; author lukem; state Exp; branches; next 1.74; 1.74 date 2008.08.11.08.22.39; author apb; state Exp; branches; next 1.73; 1.73 date 2008.08.05.22.40.33; author apb; state Exp; branches; next 1.72; 1.72 date 2008.08.05.19.43.33; author perry; state Exp; branches; next 1.71; 1.71 date 2008.03.29.05.22.42; author dholland; state Exp; branches 1.71.4.1; next 1.70; 1.70 date 2008.03.28.05.23.44; author dholland; state Exp; branches; next 1.69; 1.69 date 2008.03.18.04.24.38; author lukem; state Exp; branches; next 1.68; 1.68 date 2008.03.08.14.48.57; author reed; state Exp; branches; next 1.67; 1.67 date 2007.11.23.16.19.28; author sborrill; state Exp; branches 1.67.4.1; next 1.66; 1.66 date 2007.09.01.09.32.19; author jnemeth; state Exp; branches; next 1.65; 1.65 date 2007.09.01.08.15.27; author jnemeth; state Exp; branches; next 1.64; 1.64 date 2007.08.30.10.29.02; author jnemeth; state Exp; branches; next 1.63; 1.63 date 2007.08.30.00.35.11; author ad; state Exp; branches; next 1.62; 1.62 date 2007.04.13.19.43.38; author apb; state Exp; branches 1.62.4.1; next 1.61; 1.61 date 2007.03.26.17.35.06; author apb; state Exp; branches; next 1.60; 1.60 date 2007.01.27.11.47.36; author apb; state Exp; branches; next 1.59; 1.59 date 2006.10.08.17.54.30; author apb; state Exp; branches 1.59.2.1; next 1.58; 1.58 date 2006.09.29.19.57.04; author apb; state Exp; branches; next 1.57; 1.57 date 2006.01.29.14.03.59; author apb; state Exp; branches; next 1.56; 1.56 date 2006.01.28.21.34.08; author apb; state Exp; branches; next 1.55; 1.55 date 2006.01.12.21.22.30; author wiz; state Exp; branches; next 1.54; 1.54 date 2006.01.04.15.35.20; author apb; state Exp; branches; next 1.53; 1.53 date 2005.02.15.18.41.18; author reed; state Exp; branches; next 1.52; 1.52 date 2004.10.12.04.07.09; author jmc; state Exp; branches; next 1.51; 1.51 date 2004.06.25.15.04.20; author wiz; state Exp; branches; next 1.50; 1.50 date 2004.03.19.12.34.39; author wiz; state Exp; branches; next 1.49; 1.49 date 2004.02.06.23.22.44; author lukem; state Exp; branches; next 1.48; 1.48 date 2003.12.29.07.10.24; author jmc; state Exp; branches; next 1.47; 1.47 date 2003.12.19.12.06.45; author zuntum; state Exp; branches; next 1.46; 1.46 date 2003.10.26.02.17.46; author lukem; state Exp; branches; next 1.45; 1.45 date 2003.10.25.03.46.09; author lukem; state Exp; branches; next 1.44; 1.44 date 2003.09.29.07.58.01; author lukem; state Exp; branches; next 1.43; 1.43 date 2003.08.19.12.53.30; author martti; state Exp; branches; next 1.42; 1.42 date 2003.08.19.10.00.29; author martti; state Exp; branches; next 1.41; 1.41 date 2003.08.08.01.52.24; author lukem; state Exp; branches; next 1.40; 1.40 date 2003.07.29.10.07.15; author lukem; state Exp; branches; next 1.39; 1.39 date 2003.07.18.16.30.49; author lukem; state Exp; branches; next 1.38; 1.38 date 2003.07.18.08.38.10; author lukem; state Exp; branches; next 1.37; 1.37 date 2003.07.18.02.19.55; author lukem; state Exp; branches; next 1.36; 1.36 date 2003.07.03.05.52.47; author lukem; state Exp; branches; next 1.35; 1.35 date 2003.05.25.12.34.28; author lukem; state Exp; branches; next 1.34; 1.34 date 2003.05.18.11.18.02; author lukem; state Exp; branches; next 1.33; 1.33 date 2003.05.17.08.10.40; author lukem; state Exp; branches; next 1.32; 1.32 date 2003.05.10.07.15.53; author lukem; state Exp; branches; next 1.31; 1.31 date 2003.05.10.07.12.37; author lukem; state Exp; branches; next 1.30; 1.30 date 2003.05.08.14.42.05; author lukem; state Exp; branches; next 1.29; 1.29 date 2003.02.08.10.00.33; author lukem; state Exp; branches; next 1.28; 1.28 date 2003.02.02.12.37.41; author lukem; state Exp; branches; next 1.27; 1.27 date 2003.01.30.02.52.41; author lukem; state Exp; branches; next 1.26; 1.26 date 2003.01.29.22.50.08; author lukem; state Exp; branches; next 1.25; 1.25 date 2003.01.26.13.15.18; author lukem; state Exp; branches; next 1.24; 1.24 date 2003.01.26.06.19.13; author lukem; state Exp; branches; next 1.23; 1.23 date 2003.01.26.05.34.32; author lukem; state Exp; branches; next 1.22; 1.22 date 2003.01.23.16.24.08; author lukem; state Exp; branches; next 1.21; 1.21 date 2003.01.04.12.55.32; author lukem; state Exp; branches; next 1.20; 1.20 date 2002.12.25.00.58.00; author lukem; state Exp; branches; next 1.19; 1.19 date 2002.12.08.22.14.01; author lukem; state Exp; branches; next 1.18; 1.18 date 2002.12.08.08.42.51; author lukem; state Exp; branches; next 1.17; 1.17 date 2002.11.25.19.18.44; author wiz; state Exp; branches; next 1.16; 1.16 date 2002.10.20.15.48.40; author lukem; state Exp; branches; next 1.15; 1.15 date 2002.09.21.05.26.42; author lukem; state Exp; branches; next 1.14; 1.14 date 2002.09.17.16.35.39; author fredb; state Exp; branches; next 1.13; 1.13 date 2002.07.22.09.49.05; author wiz; state Exp; branches; next 1.12; 1.12 date 2002.05.13.01.44.34; author lukem; state Exp; branches 1.12.2.1; next 1.11; 1.11 date 2002.05.03.08.59.13; author lukem; state Exp; branches; next 1.10; 1.10 date 2002.05.02.22.14.12; author sommerfeld; state Exp; branches; next 1.9; 1.9 date 2002.03.14.18.33.05; author thorpej; state Exp; branches; next 1.8; 1.8 date 2002.03.05.01.15.51; author lukem; state Exp; branches; next 1.7; 1.7 date 2002.03.04.02.10.02; author lukem; state Exp; branches; next 1.6; 1.6 date 2001.11.25.18.40.34; author thorpej; state Exp; branches; next 1.5; 1.5 date 2001.11.15.16.20.37; author tv; state Exp; branches; next 1.4; 1.4 date 2001.11.14.22.29.23; author tv; state Exp; branches; next 1.3; 1.3 date 2001.11.12.23.16.18; author tv; state Exp; branches; next 1.2; 1.2 date 2001.11.08.21.29.06; author wiz; state Exp; branches; next 1.1; 1.1 date 2001.11.01.16.34.21; author tv; state Exp; branches; next ; 1.133.2.1 date 2019.06.10.21.41.01; author christos; state Exp; branches; next 1.133.2.2; commitid jtc8rnCzWiEEHGqB; 1.133.2.2 date 2020.04.21.18.41.02; author martin; state dead; branches; next 1.133.2.3; commitid 86tA4aEmdr3VCh5C; 1.133.2.3 date 2020.04.21.19.37.29; author martin; state Exp; branches; next ; commitid x6IB64bYH9UmWh5C; 1.131.2.1 date 2018.09.06.06.51.31; author pgoyette; state Exp; branches; next ; commitid HCi1bXD317XIK0RA; 1.122.2.1 date 2017.03.20.06.51.32; author pgoyette; state Exp; branches; next 1.122.2.2; commitid jjw7cAwgyKq7RfKz; 1.122.2.2 date 2017.04.26.02.52.13; author pgoyette; state Exp; branches; next ; commitid ojV02aOSdzvBqZOz; 1.122.4.1 date 2017.04.21.16.50.41; author bouyer; state Exp; branches; next ; commitid dUG7nkTKALCadqOz; 1.109.2.1 date 2014.11.14.14.58.27; author martin; state Exp; branches; next ; commitid Hpu5xAPRIrrzcaYx; 1.105.4.1 date 2014.08.10.07.27.15; author tls; state Exp; branches; next ; commitid b558mMeUyhF6NMLx; 1.101.2.1 date 2012.11.20.02.57.26; author tls; state Exp; branches; next 1.101.2.2; 1.101.2.2 date 2013.06.23.06.26.12; author tls; state Exp; branches; next 1.101.2.3; commitid OnlO1cBgtQRcIHUw; 1.101.2.3 date 2014.08.19.23.45.10; author tls; state Exp; branches; next ; commitid jTnpym9Qu0o4R1Nx; 1.98.2.1 date 2012.03.02.16.48.10; author riz; state Exp; branches; next ; 1.96.2.1 date 2012.04.17.00.01.34; author yamt; state Exp; branches; next 1.96.2.2; 1.96.2.2 date 2012.10.30.18.46.03; author yamt; state Exp; branches; next 1.96.2.3; 1.96.2.3 date 2013.01.16.05.25.52; author yamt; state Exp; branches; next 1.96.2.4; 1.96.2.4 date 2014.05.22.13.23.26; author yamt; state Exp; branches; next ; commitid PKIuZeaQ0guJkxBx; 1.91.2.1 date 2011.02.08.16.18.26; author bouyer; state Exp; branches; next ; 1.82.2.1 date 2009.05.13.19.15.48; author jym; state Exp; branches; next ; 1.78.2.1 date 2008.11.15.22.05.11; author snj; state Exp; branches; next 1.78.2.2; 1.78.2.2 date 2008.11.15.22.10.33; author snj; state Exp; branches 1.78.2.2.4.1; next 1.78.2.3; 1.78.2.3 date 2009.05.11.19.40.22; author bouyer; state Exp; branches; next 1.78.2.4; 1.78.2.4 date 2011.03.08.17.47.59; author riz; state Exp; branches; next ; 1.78.2.2.4.1 date 2010.04.21.05.15.01; author matt; state Exp; branches; next ; 1.71.4.1 date 2008.09.18.04.27.23; author wrstuden; state Exp; branches; next ; 1.67.4.1 date 2008.03.24.07.14.28; author keiichi; state Exp; branches; next ; 1.62.4.1 date 2007.11.06.23.07.09; author matt; state Exp; branches; next 1.62.4.2; 1.62.4.2 date 2008.01.09.01.19.18; author matt; state Exp; branches; next 1.62.4.3; 1.62.4.3 date 2008.03.23.00.12.06; author matt; state Exp; branches; next ; 1.59.2.1 date 2007.04.16.19.46.55; author bouyer; state Exp; branches; next 1.59.2.2; 1.59.2.2 date 2007.04.16.19.52.26; author bouyer; state Exp; branches 1.59.2.2.2.1; next 1.59.2.3; 1.59.2.3 date 2007.09.29.11.10.56; author xtraeme; state Exp; branches; next ; 1.59.2.2.2.1 date 2007.09.30.20.27.36; author wrstuden; state Exp; branches; next ; 1.12.2.1 date 2003.12.18.08.25.06; author tron; state Exp; branches; next 1.12.2.2; 1.12.2.2 date 2003.12.24.04.52.17; author jmc; state Exp; branches; next ; desc @@ 1.160 log @BUILDING: list known mk.conf vars. tweak section headers List known supported and obsolete mk.conf(5) variables, so that searches in this document at least find them. This partially reverts my revision 1.144 on 2023-06-12 which completely removed the duplication with mk.conf(5). Remove quote characters from some section headings; it makes it harder to search for a section by known name when rendering in markup variations that use smart quotes. @ text @BUILDING(8) System Manager's Manual BUILDING(8) NAME BUILDING - Procedure for building NetBSD from source code REQUIREMENTS NetBSD is designed to be buildable on most POSIX-compliant host systems. The basic build procedure is the same whether compiling natively (on the same NetBSD architecture) or cross compiling (on another architecture or OS). This source tree contains the build.sh shell script which supports both native and cross builds of NetBSD. This source tree contains a special subtree, "tools", which uses the host system to create a build toolchain for the target architecture. The host system must have at least C and C++ compilers in order to create the toolchain (make(1) is not required); all other tools (including make(1) as nbmake) are created as part of the NetBSD build process. (See the Environment variables section below if you need to override or manually select your compilers.) Note: Within this document, cross-references to manual pages are to the NetBSD manual pages, not the host system manual pages. The mdoc(7) source to the NetBSD manual pages can be found within the source tree, and these and can be formatted with mandoc(1) or nroff(1) if those are available on the host system. The NetBSD manual pages are also available at https://man.netbsd.org FILES Source tree layout BUILDING This document (in plaintext). Generated from doc/BUILDING.mdoc. Makefile The main Makefile for NetBSD; should only be run for native builds with an appropriately up-to-date version of NetBSD make(1). Intended for expert use with knowledge of its shortcomings, it has been superseded by the build.sh shell script as the recommended means for building NetBSD. UPDATING Special notes for updating from an earlier revision of NetBSD. It is important to read this file before every build of an updated source tree. build.sh Bourne-compatible shell script used for building the host build tools and the NetBSD system from scratch. Can be used for both native and cross builds, and should be used instead of make(1) as it performs additional checks to prevent common issues going undetected, such as building with an outdated version of make(1). crypto/dist/, dist/, gnu/dist/ Sources imported verbatim from third parties, without mangling the existing build structure. Other source trees in bin through usr.sbin use the NetBSD make(1) "reachover" Makefile semantics when building these programs for a native host. distrib/, etc/ Sources for items used when making a full release snapshot, such as files installed in DESTDIR/etc on the destination system, boot media, and release notes. doc/BUILDING.mdoc The source to this document, in mdoc(7) format. Used to generate BUILDING. external/, sys/external/ Sources and build infrastructure for components imported (mostly) unchanged from upstream maintainers, sorted by applicable license. This is (slowly) replacing the crypto/dist, dist, and gnu/dist directories. external/mit/xorg/ "Reachover" build structure for modular Xorg; the source is in X11SRCDIR. mk.conf Optional source tree specific mk.conf(5), used (if present) instead of /etc/mk.conf unless MAKECONF is defined. Note: Not part of the NetBSD source repository. regress/, tests/ Regression test harness. Can be cross-compiled, but only run natively. tests/ uses the atf(7) test framework; regress/ contains older tests that have not yet been migrated to atf(7). sys/ NetBSD kernel sources. tools/ "Reachover" build structure for the host build tools. This has a special method of determining out-of-date status. tools/compat/README Special notes for cross-hosting a NetBSD build on non- NetBSD platforms. Other directories including bin/ ... usr.sbin/ Sources to the NetBSD userland (non-kernel) programs. If any of these directories are missing, they will be skipped during the build. Build tree layout The NetBSD build tree is described in hier(7) (whose mdoc(7) source is in share/man/man7/hier.7), and the release layout is described in release(7) (whose mdoc(7) source is in share/man/man7/release.7). CONFIGURATION Environment variables Several environment variables control the behaviour of NetBSD builds. HOST_CC Path name to C compiler used to create the toolchain. Default: "cc". HOST_CFLAGS Flags passed to the host C compiler. Default: "-O". HOST_CPPFLAGS Flags passed to the host C/C++ pre-processor. Default: Unset. HOST_CXX Path name to C++ compiler used to create the toolchain. Default: Unset, but defaults to "c++" where required. HOST_CXXFLAGS Flags passed to the host C++ compiler. Default: Unset. HOST_SH Path name to a shell available on the host system and suitable for use during the build. The NetBSD build system requires a modern Bourne-like shell with POSIX- compliant features, and also requires support for the "local" keyword to declare local variables in shell functions (which is a widely-implemented but non- standardised feature). Depending on the host system, a suitable shell may be /bin/sh, /usr/xpg4/bin/sh, /bin/ksh (provided it is a variant of ksh that supports the "local" keyword, such as ksh88, but not ksh93), or /usr/local/bin/bash. Most parts of the build require HOST_SH to be an absolute path; however, build.sh allows it to be a simple command name, which will be converted to an absolute path by searching the PATH. Default: "sh". INSTALLBOOT_UBOOT_PATHS A colon-separated list of search paths used by installboot(8) to find U-Boot packages. Default: Unset. MACHINE Machine type, e.g., "macppc". Default: Unset. MACHINE_ARCH Machine architecture, e.g., "powerpc". Default: Unset. MAKE Path name to invoke make(1) as. Default: "make". MAKECONF The name of the make(1) configuration file. See make variables and mk.conf(5). Note: Only settable in the process environment. Default: "/etc/mk.conf", although build.sh will set the default to the full path to mk.conf if the latter is present in the same directory as build.sh. MAKEFLAGS Flags to invoke make(1) with. Note: build.sh ignores the value of MAKEFLAGS passed in the environment, but allows MAKEFLAGS to be set via the -V option. Default: "-X" on systems with a small ARG_MAX (Cygwin, Darwin, FreeBSD); otherwise unset. MAKEOBJDIR Directory to use as the .OBJDIR for the current directory. The value is subjected to variable expansion by make(1). Typical usage is to set this variable to a value involving the use of `${.CURDIR:S...}' or `${.CURDIR:C...}', to derive the value of .OBJDIR from the value of .CURDIR. Used only if MAKEOBJDIRPREFIX is not defined. Note: MAKEOBJDIR can be provided only in the environment or via the -O flag of build.sh; it cannot usefully be set inside a Makefile, including in mk.conf(5) or MAKECONF. Default: Unset. MAKEOBJDIRPREFIX Top level directory of the object directory tree. The value is subjected to variable expansion by make(1). build.sh will create the ${MAKEOBJDIRPREFIX} directory if necessary, but if make(1) is used without build.sh, then rules in will abort the build if the ${MAKEOBJDIRPREFIX} directory does not exist. If the value is defined and valid, then ${MAKEOBJDIRPREFIX}/${.CURDIR} is used as the .OBJDIR for the current directory. The current directory may be read only. Note: MAKEOBJDIRPREFIX can be provided only in the environment or via the -M flag of build.sh; it cannot usefully be set inside a Makefile, including in mk.conf(5) or MAKECONF. Default: Unset. TMPDIR Top-level directory to store temporary directories used by build.sh before paths to other directories such as .OBJDIR can be determined. Note: Must support execution of binaries. I.e., without mount(8)'s -o noexec option. Default: "/tmp". make variables Variables that control the behavior of NetBSD builds are documented in mk.conf(5) (whose mdoc(7) source is in share/man/man5/mk.conf.5). Unless otherwise specified, these variables may be set in either the process environment or the make(1) configuration file mk.conf(5) specified by MAKECONF. Note: Variables set in the environment, either directly or via build.sh options to set specific values in the nbmake-MACHINE wrapper script do not override variables set in the mk.conf(5) file. To allow variables in mk.conf(5) to be overridden by the environment or build.sh options, define the variables using the "?=" make(1) variable assignment operator. For example, MAKEVERBOSE?=1 The supported mk.conf(5) make variables are: BSDOBJDIR, BSDSRCDIR, BUILD, BUILDID, BUILDINFO, BUILDSEED, CDEXTRA, CONFIGOPTS, COPTS, CPUFLAGS, DESTDIR, EXTERNAL_TOOLCHAIN, INSTALLBOOT_BOARDS, INSTALLWORLDDIR, KERNARCHDIR, KERNCONFDIR, KERNEL_DIR, KERNOBJDIR, KERNSRCDIR, LOCALTIME, MAKEVERBOSE, MKAMDGPUFIRMWARE, MKARGON2, MKARZERO, MKATF, MKBINUTILS, MKBSDGREP, MKBSDTAR, MKCATPAGES, MKCLEANSRC, MKCLEANVERIFY, MKCOMPAT, MKCOMPATMODULES, MKCOMPATTESTS, MKCOMPATX11, MKCOMPLEX, MKCROSSGDB, MKCTF, MKCVS, MKCXX, MKDEBUG, MKDEBUGKERNEL, MKDEBUGLIB, MKDEBUGTOOLS, MKDEPINCLUDES, MKDOC, MKDTB, MKDTC, MKDTRACE, MKDYNAMICROOT, MKFIRMWARE, MKGCC, MKGCCCMDS, MKGDB, MKGROFF, MKGROFFHTMLDOC, MKHESIOD, MKHOSTOBJ, MKHTML, MKIEEEFP, MKINET6, MKINFO, MKIPFILTER, MKISCSI, MKKERBEROS, MKKMOD, MKKYUA, MKLDAP, MKLIBCSANITIZER, MKLIBCXX, MKLIBSTDCXX, MKLINKLIB, MKLINT, MKLLVM, MKLLVMRT, MKLVM, MKMAKEMANDB, MKMAN, MKMANDOC, MKMANZ, MKMDNS, MKNLS, MKNOUVEAUFIRMWARE, MKNPF, MKNSD, MKOBJ, MKOBJDIRS, MKPAM, MKPCC, MKPF, MKPIC, MKPICINSTALL, MKPICLIB, MKPIE, MKPIGZGZIP, MKPOSTFIX, MKPROFILE, MKRADEONFIRMWARE, MKRELRO, MKREPRO, MKREPRO_TIMESTAMP, MKRUMP, MKSANITIZER, MKSHARE, MKSKEY, MKSLJIT, MKSOFTFLOAT, MKSTATICLIB, MKSTATICPIE, MKSTRIPIDENT, MKSTRIPSYM, MKTEGRAFIRMWARE, MKTPM, MKUNBOUND, MKUNPRIVED, MKUPDATE, MKX11, MKX11FONTS, MKX11MOTIF, MKXORG_SERVER, MKYP, MKZFS, NETBSDSRCDIR, NETBSD_OFFICIAL_RELEASE, NOCLEANDIR, NODISTRIBDIRS, NOINCLUDES, OBJMACHINE, RELEASEDIR, RUMPUSER_THREADS, RUMP_CURLWP, RUMP_DEBUG, RUMP_DIAGNOSTIC, RUMP_KTRACE, RUMP_LOCKDEBUG, RUMP_LOCKS_UP, RUMP_NBCOMPAT, RUMP_VIRTIF, RUMP_VNODE_LOCKDEBUG, TOOLCHAIN_MISSING, TOOLDIR, USETOOLS, USE_FORT, USE_HESIOD, USE_INET6, USE_JEMALLOC, USE_KERBEROS, USE_LDAP, USE_LIBCSANITIZER, USE_PAM, USE_PIGZGZIP, USE_SANITIZER, USE_SKEY, USE_SSP, USE_XZ_SETS, USE_YP, X11MOTIFPATH, X11SRCDIR. The obsolete mk.conf(5) make variables are: EXTSRCSRCDIR, MKBFD, MKCRYPTO, MKEXTSRC, MKKDEBUG, MKKERBEROS4, MKLLD, MKLLDB, MKMCLINKER, MKPERFUSE, MKTOOLSDEBUG, NBUILDJOBS, SHAREDSTRINGS, USE_COMBINE, USE_NEW_TOOLCHAIN. BUILDING make command line options This is not a summary of all the options available to make(1); only the options used most frequently with NetBSD builds are listed here. -j njob Run up to njob make(1) subjobs in parallel. Makefiles should use .WAIT or have explicit dependencies as necessary to enforce build ordering. -m dir Specify the default directory for searching for system Makefile segments, mainly the files. When building any full NetBSD source tree, this should be set to the "share/mk" directory in the source tree. This is set automatically when building from the top level, or when using build.sh. -n Show the commands that would have been executed, but do not actually execute them. This will still cause recursion to take place. -V var Show make(1)'s idea of the value of var. Does not build any targets. var=value Set the variable var to value, overriding any setting specified by the process environment, the MAKECONF configuration file, or the system Makefile segments. make targets These default targets may be built by running make(1) in any subtree of the NetBSD source code. It is recommended that none of these be used from the top level Makefile; as a specific exception, "make obj" and "make cleandir" are useful in that context. all Build programs, libraries, and preformatted documentation. clean Remove program and library object code files. cleandir Same as clean, but also remove preformatted documentation, dependency files generated by "make depend", and any other files known to be created at build time. depend Create dependency files (.depend) containing more detailed information about the dependencies of source code on header files. Allows programs to be recompiled automatically when a dependency changes. dependall Does a "make depend" immediately followed by a "make all". This improves cache locality of the build since both passes read the source files in their entirety. distclean Synonym for cleandir. includes Build and install system header files. Typically needed before any system libraries or programs can be built. install Install programs, libraries, and documentation into DESTDIR. Few files will be installed to DESTDIR/dev, DESTDIR/etc, DESTDIR/root or DESTDIR/var in order to prevent user supplied configuration data from being overwritten. lint Run lint(1) against the C source code, where appropriate, and generate system-installed lint libraries. obj Create object directories to be used for built files, instead of building directly in the source tree. tags Create ctags(1) searchable function lists usable by the ex(1) and vi(1) text editors. make targets for the top level Additional make(1) targets are usable specifically from the top source level to facilitate building the entire NetBSD source tree. build Build the entire NetBSD system (except the kernel). This orders portions of the source tree such that prerequisites will be built in the proper order. distribution Do a "make build", and then install a full distribution (which does not include a kernel) into DESTDIR, including files in DESTDIR/dev, DESTDIR/etc, DESTDIR/root and DESTDIR/var. buildworld As per "make distribution", except that it ensures that DESTDIR is not the root directory. installworld Install the distribution from DESTDIR to INSTALLWORLDDIR, which defaults to the root directory. Ensures that INSTALLWORLDDIR is not the root directory if cross compiling. The INSTALLSETS environment variable may be set to a space- separated list of distribution sets to be installed. By default, all sets except "etc" and "xetc" are installed, so most files in INSTALLWORLDDIR/etc will not be installed or modified. Note: Before performing this operation with INSTALLWORLDDIR=/, it is highly recommended that you upgrade your kernel and reboot. After performing this operation, it is recommended that you use etcupdate(8) to update files in INSTALLWORLDDIR/etc, and postinstall(8) to check for or fix inconsistencies. sets Create distribution sets from DESTDIR into RELEASEDIR/RELEASEMACHINEDIR/binary/sets. Should be run after "make distribution", as "make build" alone does not install all of the required files. sourcesets Create source sets of the source tree into RELEASEDIR/source/sets. syspkgs Create syspkgs from DESTDIR into RELEASEDIR/RELEASEMACHINEDIR/binary/syspkgs. Should be run after "make distribution", as "make build" alone does not install all of the required files. release Do a "make distribution", build kernels, distribution media, and install sets (this as per "make sets"), and then package the system into a standard release layout as described by release(7). This requires that RELEASEDIR be set (see above). iso-image Create a NetBSD installation CD-ROM image in the RELEASEDIR/images directory. The CD-ROM file system will have a layout as described in release(7). For most machine types, the CD-ROM will be bootable, and will automatically run the sysinst(8) menu-based installation program, which can be used to install or upgrade a NetBSD system. Bootable CD-ROMs also contain tools that may be useful in repairing a damaged NetBSD installation. Before "make iso-image" is attempted, RELEASEDIR must be populated by "make release" or equivalent. Note: Other, smaller, CD-ROM images may be created in the RELEASEDIR/RELEASEMACHINEDIR/installation/cdrom directory by "make release". These smaller images usually contain the same tools as the larger images in RELEASEDIR/images, but do not contain additional content such as the distribution sets. Note: The mac68k port still uses an older method of creating CD-ROM images. This requires the mkisofs(1) utility, which is not part of NetBSD, but which can be installed from pkgsrc/sysutils/cdrtools. iso-image-source Create a NetBSD installation CD-ROM image in the RELEASEDIR/images directory. The CD-ROM file system will have a layout as described in release(7). It will have top level directories for the machine type and source. For most machine types, the CD-ROM will be bootable, and will automatically run the sysinst(8) menu-based installation program, which can be used to install or upgrade a NetBSD system. Bootable CD-ROMs also contain tools that may be useful in repairing a damaged NetBSD installation. Before "make iso-image-source" is attempted, RELEASEDIR must be populated by "make sourcesets release" or equivalent. Note: Other, smaller, CD-ROM images may be created in the RELEASEDIR/RELEASEMACHINEDIR/installation/cdrom directory by "make release". These smaller images usually contain the same tools as the larger images in RELEASEDIR/images, but do not contain additional content such as the distribution sets. Note: The mac68k port still uses an older method of creating CD-ROM images. This requires the mkisofs(1) utility, which is not part of NetBSD, but which can be installed from pkgsrc/sysutils/cdrtools. install-image Create a bootable NetBSD installation disk image in the RELEASEDIR/images directory. The installation disk image is suitable for copying to bootable USB flash memory sticks, etc., for machines which are able to boot from such devices. The file system in the bootable disk image will have a layout as described in release(7). The installation image is bootable, and will automatically run the sysinst(8) menu-based installation program, which can be used to install or upgrade a NetBSD system. The image also contains tools that may be useful in repairing a damaged NetBSD installation. Before "make install-image" is attempted, RELEASEDIR must be populated by "make release" or equivalent. The build must have been performed with MKUNPRIVED=yes because "make install-image" relies on information in DESTDIR/METALOG. live-image Create NetBSD live images in the RELEASEDIR/images directory. The live image contains all necessary files to boot NetBSD up to multi-user mode, including all files which should be extracted during installation, NetBSD disklabel, bootloaders, etc. The live image is suitable for use as a disk image in virtual machine environments such as QEMU, and also useful to boot NetBSD from a USB flash memory stick on a real machine, without the need for installation. Before "make live-image" is attempted, RELEASEDIR must be populated by "make release" or equivalent. The build must have been performed with MKUNPRIVED=yes because "make install-image" relies on information in DESTDIR/METALOG. regression-tests Can only be run after building the regression tests in the directory "regress". Runs those compiled regression tests on the local host. Note: Most tests are now managed instead using atf(7); this target should probably run those as well but currently does not. The build.sh script This script file is a shell script designed to build the entire NetBSD system on any host with a suitable modern shell and some common utilities. The required shell features are described under the HOST_SH variable. If a host system's default shell does support the required features, then we suggest that you explicitly specify a suitable shell using a command like /path/to/suitable/shell build.sh [options] The above command will usually enable build.sh to automatically set HOST_SH=/path/to/suitable/shell, but if that fails, then the following set of commands may be used instead: HOST_SH=/path/to/suitable/shell export HOST_SH ${HOST_SH} build.sh [options] If build.sh detects that it is being executed under an unsuitable shell, it attempts to exec a suitable shell instead, or shows an error message. If HOST_SH is not set explicitly, then build.sh sets a default using heuristics dependent on the host platform, or from the shell under which build.sh is executed (if that can be determined), or using the first copy of sh found in PATH. All cross-compile builds, and most native builds, of the entire system should make use of build.sh rather than just running "make". This way, the make(1) program will be bootstrapped properly, in case the host system has an older or incompatible "make" program. When compiling the entire system via build.sh, many make(1) variables are set for you in order to help encapsulate the build process. In the list of options below, variables that are automatically set by build.sh are noted where applicable. The following operations are supported by build.sh: build Build the system as per "make build". Before the main part of the build commences, this command runs the obj operation (unless the -o option is given), "make cleandir" (unless the -u option is given), and the tools operation. distribution Build a full distribution as per "make distribution". This command first runs the build operation. release Build a full release as per "make release". This command first runs the distribution operation. help Show a help message, and exit. makewrapper Create the nbmake-MACHINE wrapper script. This operation is automatically performed for any of the other operations. cleandir Perform "make cleandir". obj Perform "make obj". tools Build and install the host tools from src/tools. This command will first run "make obj" and "make cleandir" in the tools subdirectory unless the -o or -u options (respectively) are given. install=idir Install the contents of DESTDIR to idir, using "make installworld". Note: Files that are part of the "etc" or "xetc" sets will not be installed, unless overridden by the INSTALLSETS environment variable. kernel=kconf Build a new kernel. The kconf argument is the name of a configuration file suitable for use by config(1). If kconf does not contain any `/' characters, the configuration file is expected to be found in the KERNCONFDIR directory, which is typically sys/arch/MACHINE/conf. The new kernel will be built in a subdirectory of KERNOBJDIR, which is typically sys/arch/MACHINE/compile or an associated object directory. This command does not imply the tools command; run the tools command first unless it is certain that the tools already exist and are up to date. This command will run "make cleandir" on the kernel in question first unless the -u option is given. kernel.gdb=kconf Build a new kernel with debug information. Similar to the above kernel=kconf operation, but creates a netbsd.gdb file alongside of the kernel netbsd, which contains a full symbol table and can be used for debugging (for example with a cross-gdb built by MKCROSSGDB). kernels This command will build all kernels defined in port specific release build procedure. This command internally calls the kernel=kconf operation for each found kernel configuration file. modules This command will build kernel modules and install them into DESTDIR. releasekernel=kconf Install a gzip(1)ed copy of the kernel previously built by kernel=kconf into RELEASEDIR/RELEASEMACHINEDIR/binary/kernel, usually as netbsd-kconf.gz, although the "netbsd" prefix is determined from the "config" directives in kconf. sets Perform "make sets". sourcesets Perform "make sourcesets". syspkgs Perform "make syspkgs". iso-image Perform "make iso-image". iso-image-source Perform "make iso-image-source". install-image Perform "make install-image". live-image Perform "make live-image". list-arch Show a list of valid MACHINE and MACHINE_ARCH settings, the default MACHINE_ARCH for each MACHINE, and aliases for MACHINE/MACHINE_ARCH pairs, and then exits. The -m or -a options (or both) may be used to specify glob patterns that will be used to narrow the list of results; for example, "build.sh -m 'evb*' -a '*arm*' list-arch" will list all known MACHINE/MACHINE_ARCH values in which either MACHINE or ALIAS matches the pattern `evb*', and MACHINE_ARCH matches the pattern `*arm*'. The following command line options alter the behaviour of the build.sh operations described above: -a arch Set the value of MACHINE_ARCH to arch. See the -m option for more information. -B buildid Set the value of BUILDID to buildid. This will also append the build identifier to the name of the nbmake-MACHINE wrapper script so that the resulting name is of the form "nbmake-MACHINE-BUILDID". -C cdextras Append cdextras to the CDEXTRA variable, which is a space- separated list of files or directories that will be added to the CD-ROM image that may be create by the "iso-image" or "iso-image-source" operations. Files will be added to the root of the CD-ROM image, whereas directories will be copied recursively. If relative paths are specified, they will be converted to absolute paths before being used. Multiple paths may be specified via multiple -C options, or via a single option whose argument contains multiple space-separated paths. -c compiler Select the compiler for the toolchain to build NetBSD and for inclusion in the NetBSD distribution. Supported choices: clang gcc [default] The compiler used to build the toolchain can be different; see HOST_CC and HOST_CXX. -D dest Set the value of DESTDIR to dest. If a relative path is specified, it will be converted to an absolute path before being used. -E Set `expert' mode. This overrides various sanity checks, and allows: DESTDIR does not have to be set to a non-root path for builds, and MKUNPRIVED=yes does not have to be set when building as a non-root user. Note: It is highly recommended that you know what you are doing when you use this option. -h Show a help message, and exit. -j njob Run up to njob make(1) subjobs in parallel; passed through to make(1). If you see failures for reasons other than running out of memory while using build.sh with -j, please save complete build logs so the failures can be analyzed. To achieve the fastest builds, -j values between (1 + the number of CPUs) and (2 * the number of CPUs) are recommended. Use lower values on machines with limited memory or I/O bandwidth. -M obj Set MAKEOBJDIRPREFIX to obj. Unsets MAKEOBJDIR. See "-O obj" for more information. For instance, if the source directory is /usr/src, a setting of "-M /usr/obj" will place build-time files under /usr/obj/usr/src/bin, /usr/obj/usr/src/lib, /usr/obj/usr/src/usr.bin, and so forth. If a relative path is specified, it will be converted to an absolute path before being used. build.sh imposes the restriction that the argument to the -M option must not begin with a "$" (dollar sign) character; otherwise it would be too difficult to determine whether the value is an absolute or a relative path. If the directory does not already exist, build.sh will create it. -m mach Set the value of MACHINE to mach, unless the mach argument is an alias that refers to a MACHINE/MACHINE_ARCH pair, in which case both MACHINE and MACHINE_ARCH are set from the alias. Such aliases are interpreted entirely by build.sh; they are not used by any other part of the build system. The MACHINE_ARCH setting implied by mach will override any value of MACHINE_ARCH in the process environment, but will not override a value set by the -a option. All cross builds require -m, but if unset on a NetBSD host, the host's value of MACHINE will be detected and used automatically. See the list-arch operation for a way to get a list of valid MACHINE and MACHINE_ARCH settings. -N noiselevel Set the "noisyness" level of the build, by setting MAKEVERBOSE to noiselevel. -n Show the commands that would be executed by build.sh, but do not make any changes. This is similar in concept to "make -n". -O obj Create an appropriate transform macro for MAKEOBJDIR that will place the built object files under obj. Unsets MAKEOBJDIRPREFIX. For instance, a setting of "-O /usr/obj" will place build-time files under /usr/obj/bin, /usr/obj/lib, /usr/obj/usr.bin, and so forth. If a relative path is specified, it will be converted to an absolute path before being used. build.sh imposes the restriction that the argument to the -O option must not contain a "$" (dollar sign) character. If the directory does not already exist, build.sh will create it. In normal use, exactly one of the -M or -O options should be specified. If neither -M nor -O is specified, then a default object directory will be chosen according to rules in . Relying on this default is not recommended because it is determined by complex rules that are influenced by the values of several variables and by the location of the source directory. Note: Placing the obj directory location outside of the default source tree hierarchy makes it easier to manually clear out old files in the event the "make cleandir" operation is unable to do so. (See CAVEATS below.) Note: The use of one of -M or -O is the only means of building multiple machine architecture userlands from the same source tree without cleaning between builds (in which case, one would specify distinct obj locations for each). -o Set the value of MKOBJDIRS to "no". Otherwise, it will be automatically set to "yes". This default is opposite to the behaviour when not using build.sh. -P Set the value of MKREPRO and MKREPRO_TIMESTAMP to the latest source CVS timestamp for reproducible builds. -R rel Set the value of RELEASEDIR to rel. If a relative path is specified, it will be converted to an absolute path before being used. -r Remove the contents of DESTDIR and TOOLDIR before building (provides a clean starting point). This will skip deleting DESTDIR if building on a native system to the root directory. -S seed Change the value of BUILDSEED to seed. This should rarely be necessary. -T tools Set the value of TOOLDIR to tools. If a relative path is specified, it will be converted to an absolute path before being used. If set, the bootstrap "make" will only be rebuilt if the source files for make(1) have changed. -U Set MKUNPRIVED=yes. -u Set MKUPDATE=yes. -V var=[value] Set the environment variable var to an optional value. This is propagated to the nbmake-MACHINE wrapper script. -w wrapper Create the nbmake-MACHINE wrapper script (see below) in a custom location, specified by wrapper. This allows, for instance, to place the wrapper script in PATH automatically. Note: wrapper is the full name of the file, not just a directory name. If a relative path is specified, it will be converted to an absolute path before being used. -X x11src Set the value of X11SRCDIR to x11src. If a relative path is specified, it will be converted to an absolute path before being used. -x Set MKX11=yes. -Z var Unset ("zap") the environment variable var. This is propagated to the nbmake-MACHINE wrapper script. -? Show a help message, and exit. The nbmake-MACHINE wrapper script If using the build.sh script to build NetBSD, a nbmake-MACHINE wrapper script will be created in TOOLDIR/bin upon the first build to assist in building subtrees on a cross-compile host. The nbmake-MACHINE wrapper script can be invoked in lieu of make(1), and will instead call the up-to-date version of "nbmake" installed into TOOLDIR/bin with several key variables pre-set, including MACHINE, MACHINE_ARCH, and TOOLDIR. nbmake-MACHINE will also set variables specified with -V, and unset variables specified with -Z. Note that by default these variables will not override mk.conf(5); see make variables for more details. This wrapper script can be symlinked into a directory listed in PATH, or called with an absolute path. EXAMPLES 1. % ./build.sh [OPTIONS] tools kernel=GENERIC Build a new toolchain, and use the new toolchain to configure and build a new GENERIC kernel. 2. % ./build.sh [OPTIONS] -U distribution Using unprivileged mode, build a complete distribution to a DESTDIR directory that build.sh selects (and will show). 3. # ./build.sh [OPTIONS] -U install=/ As root, install to / the distribution that was built by example 2. Even though this is run as root, -U is required so that the permissions stored in DESTDIR/METALOG are correctly applied to the files as they're copied to /. 4. % ./build.sh [OPTIONS] -U -u release Using unprivileged mode, build a complete release to DESTDIR and RELEASEDIR directories that build.sh selects (and will show). MKUPDATE=yes (-u) is set to prevent the "make cleandir", so that if this is run after example 2, it doesn't need to redo that portion of the release build. SEE ALSO config(1), ctags(1), ex(1), gzip(1), lint(1), make(1), mandoc(1), mkisofs(1), nroff(1), vi(1), mk.conf(5), atf(7), hier(7), mdoc(7), release(7), etcupdate(8), installboot(8), mount(8), postinstall(8), sysinst(8), pkgsrc/sysutils/cdrtools Note: The NetBSD manual pages are also available at https://man.netbsd.org HISTORY The build.sh based build scheme was introduced for NetBSD 1.6 as USE_NEW_TOOLCHAIN, and re-worked to TOOLCHAIN_MISSING after that. CAVEATS After significant updates to third-party components in the source tree, the "make cleandir" operation may be insufficient to clean out old files in object directories. Instead, one may have to manually remove the files. Consult the UPDATING file for notices concerning this. NetBSD July 21, 2023 NetBSD @ 1.159 log @BUILDING: clarify environ vs mk.conf behaviour Document that variables set in the environment or the nbmake-MACHINE wrapper script don't override variable assignments in mk.conf(5), and that using ?= in mk.conf allows environment / nbmake-MACHINE variables to override mk.conf. Consistently refer to "nbmake-MACHINE wrapper script". @ text @d172 1 a172 1 MAKECONF The name of the make(1) configuration file. See "make" d232 1 a232 1 "make" variables d249 38 d288 1 a288 1 "make" command line options d314 1 a314 1 "make" targets d356 1 a356 1 "make" targets for the top level d508 1 a508 1 The "build.sh" script d822 1 a822 1 The "nbmake-MACHINE" wrapper script d832 2 a833 2 default these variables will not override mk.conf(5); see "make" variables for more details. @ 1.158 log @BUILDING: consistency fix @ text @d240 9 d522 2 a523 2 makewrapper Create the nbmake-MACHINE wrapper. This operation is automatically performed for any of the other operations. d613 2 a614 2 build identifier to the name of the "make" wrapper script so that the resulting name is of the form d761 1 a761 1 propagated to the nbmake wrapper. d764 3 a766 3 Create the nbmake wrapper script (see below) in a custom location, specified by wrapper. This allows, for instance, to place the wrapper in PATH automatically. d780 1 a780 1 to the nbmake wrapper. d785 11 a795 9 If using the build.sh script to build NetBSD, a nbmake-MACHINE script will be created in TOOLDIR/bin upon the first build to assist in building subtrees on a cross-compile host. nbmake-MACHINE can be invoked in lieu of make(1), and will instead call the up-to-date version of "nbmake" installed into TOOLDIR/bin with several key variables pre-set, including MACHINE, MACHINE_ARCH, and TOOLDIR. nbmake-MACHINE will also set variables specified with -V, and unset variables specified with -Z. d797 2 a798 2 This script can be symlinked into a directory listed in PATH, or called with an absolute path. d845 1 a845 1 NetBSD July 18, 2023 NetBSD @ 1.157 log @build.sh: use mk.conf (if present) as MAKECONF Set MAKECONF to mk.conf in the same directory as build.sh (i.e., the top of the source tree) if mk.conf is present. This means unprivileged users can benefit from mk.conf(5) semantics without write privileges to /etc/mk.conf, and also simplifies per-source-directory configuration. Fail early if $MAKECONF is empty, since build.sh will fail anyway after rebuilding nbmake. Ensure that the computed MAKECONF isn't empty, and then always set MAKECONF in the makewrapper (nbmake-$MACHINE). Improve some formatting consistency in BUILDING.mdoc, (even if BUILDING is generated without markup). @ text @d68 1 a68 1 external, sys/external @ 1.156 log @BUILDING: wording tweaks @ text @d12 3 d18 4 a21 3 toolchain (make is not required); all other tools are created as part of the NetBSD build process. (See the Environment variables section below if you need to override or manually select your compilers.) d78 6 d177 3 a179 1 Default: "/etc/mk.conf". d834 1 a834 1 NetBSD July 5, 2023 NetBSD @ 1.155 log @BUILDING: remove duplication from mk.conf(5) Remove all "make" variables / mk.conf(5) variables already documented in mk.conf(5). The duplication was a maintenance headache, as I've experienced over recent weeks getting the build documentation up to date. Add notes clarifying that manual page references are to the NetBSD manual pages, not to the host manual pages, and how to format from source, or find online at https://man.netbsd.org. Add explicit links to the mdoc(7) in-tree source for mk.conf(5), hier(7), and release(7) because those are directly relevant to the host build information in BUILDING. Note: We don't normally need these notes for native documentation, but BUILDING is intended for users on host systems which might not be NetBSD(-current). Add missing defaults. @ text @d96 1 a96 1 The NetBSD build tree is described in hier(7) (mdoc(7) source in d98 1 a98 1 (mdoc(7) source in share/man/man7/release.7). d221 2 a222 2 Variables control the behavior of NetBSD builds are documented in mk.conf(5) (mdoc(7) source in share/man/man5/mk.conf.5). d822 1 a822 1 NetBSD June 11, 2023 NetBSD @ 1.154 log @BUILDING: update from mk.conf(5). reorder Sync variable entries from mk.conf(5). Merge the "make variables for full builds" section into the previous. Having two separate sections and some entries duplicated was confusing when searching for variables. @ text @d19 7 d61 2 a62 2 This document, in -mdoc troff format; the original copy. Used to generate BUILDING. d96 3 a98 2 The NetBSD build tree is described in hier(7), and the release layout is described in release(7). d106 2 d110 6 d118 2 d122 2 d142 2 d148 2 d152 2 d156 2 d160 2 d167 1 a167 1 Default: "/etc/mk.conf" d175 3 d190 2 d209 2 d221 2 a222 256 Several variables control the behavior of NetBSD builds. Unless otherwise specified, these variables may be set in either the process environment or the make(1) configuration file mk.conf(5) specified by MAKECONF. This list is not comprehensive; all supported variables and their defaults are documented in mk.conf(5). BSDOBJDIR The real path to the object directory tree for the NetBSD source tree. Default: "/usr/obj" BSDSRCDIR The real path to the NetBSD source tree, if NETBSDSRCDIR isn't defined. Default: "/usr/src" BUILDID Identifier for the build. If set, this should be a short string that is suitable for use as part of a file or directory name. The identifier will be appended to object directory names, and can be consulted in the make(1) configuration file in order to set additional build parameters, such as compiler flags. It will also be used as part of the kernel version string, which can be shown by "uname -v". Default: Unset. BUILDINFO Optional multi-line string containing information about the build. This will appear in DESTDIR/etc/release, and it will be stored in the buildinfo variable in any kernels that are built. When such kernels are booted, the sysctl(7) kern.buildinfo variable will report this value. The string may contain backslash escape sequences, such as "\\" (representing a backslash character) and "\n" (representing a newline). Default: Unset. BUILDSEED g++(1) uses random numbers when compiling C++ code. This variable seeds the g++(1) random number generator using -frandom-seed with this value. By default, it is set to "NetBSD-(majorversion)". Using a fixed value causes C++ binaries to be the same when built from the same sources, resulting in identical (reproducible) builds. Additional information is available in the g++(1) documentation of -frandom-seed. Default: Unset. COPTS Extra options for the C compiler. Should be appended to (e.g., COPTS+=-g), rather than explicitly set. Note: CPUFLAGS, not COPTS, should be used for compiler flags that select CPU-related options. Note: CFLAGS should never be set in mk.conf(5). CPUFLAGS Additional options passed to the compiler/assembler to select CPU instruction set options, CPU tuning options, etc. Note: Such options should not be specified in COPTS, because some parts of the build process need to override CPU-related compiler options. Default: Unset. DESTDIR Directory to contain the built NetBSD system. If set, special options are passed to the compilation tools to prevent their default use of the host system's /usr/include, /usr/lib, and so forth. This pathname must be an absolute path, and should not end with a slash (/) character. (For installation into the system's root directory, set DESTDIR to an empty string, not to "/"). The directory must reside on a file system which supports long file names and hard links. Note: build.sh will provide a default of "destdir.MACHINE" (in the top-level .OBJDIR) unless run in `expert' mode. Default: Empty string if USETOOLS=yes; unset otherwise. EXTERNAL_TOOLCHAIN If defined, this variable indicates the root directory of an external toolchain which will be used to build the tree. For example, if a platform is a TOOLCHAIN_MISSING platform, EXTERNAL_TOOLCHAIN can be used to re-enable the cross-compile framework. If EXTERNAL_TOOLCHAIN is defined, act as MKGCC=no, since the external version of the compiler may not be able to build the library components of the in-tree compiler. This variable should be used in conjunction with an appropriate HAVE_GCC or HAVE_LLVM setting to control the compiler flags. Note: This variable is not yet used in as many places as it should be. Expect the exact semantics of this variable to change in the short term as parts of the cross-compile framework continue to be cleaned up. Default: Unset. INSTALLBOOT_BOARDS A list of evbarm boards to create bootable images for. If corresponding U-Boot packages are installed, bootable images are created as part of a release. See the -o board=name option of installboot(8). INSTALLWORLDDIR Location for the top-level "make installworld" target to install to. If specified, must be an absolute path. Default: "/" MAKEVERBOSE Level of verbosity of status messages. Supported values: 0 No descriptive messages or commands executed by make(1) are shown. 1 Brief messages are shown describing what is being done, but the actual commands executed by make(1) are not shown. 2 Descriptive messages are shown as above (prefixed with a `#'), and ordinary commands performed by make(1) are shown. 3 In addition to the above, all commands performed by make(1) are shown, even if they would ordinarily have been hidden through use of the "@@" prefix in the relevant makefile. 4 In addition to the above, commands executed by make(1) are traced through use of the sh(1) "-x" flag. Default: 2 MKCATPAGES Can be set to "yes" or "no". Indicates whether preformatted plaintext manual pages will be created and installed. Forced to "no" if MKMAN=no or MKSHARE=no. Default: "no" MKCROSSGDB Can be set to "yes" or "no". Create a cross-gdb as a host tool. Default: "no" MKDEBUG Can be set to "yes" or "no". Indicates whether debug information should be generated for all userland binaries. The result is collected as an additional debug.tgz and xdebug.tgz set and installed in DESTDIR/usr/libdata/debug. Forced to "no" if NODEBUG is defined, usually in the Makefile before any make(1) .include directives. Default: "no" MKDEBUGKERNEL Can be set to "yes" or "no". Indicates whether debugging symbols will be built for kernels by default; pretend as if makeoptions DEBUG="-g" is specified in kernel configuration files. This will also put the debug kernel netbsd.gdb in the kernel sets. See options(4) for details. This is useful if a cross-gdb is built as well (see MKCROSSGDB). Default: "no" MKDEBUGLIB Can be set to "yes" or "no". Indicates whether debug libraries (lib*_g.a) will be built and installed. Debug libraries are compiled with "-g -DDEBUG". Forced to "no" if NODEBUGLIB is defined, usually in the Makefile before any make(1) .include directives. Default: "no" MKDEBUGTOOLS Can be set to "yes" or "no". Indicates whether debug information (lib*_g.a) will be included in the build toolchain. Default: "no" MKDOC Can be set to "yes" or "no". Indicates whether system documentation destined for DESTDIR/usr/share/doc will be installed. Forced to "no" if NODOC is defined, usually in the Makefile before any make(1) .include directives. Forced to "no" if MKSHARE=no. Default: "yes" MKHOSTOBJ Can be set to "yes" or "no". If "yes", then for programs intended to be run on the compile host, the name, release, and architecture of the host operating system will be suffixed to the name of the object directory created by "make obj". (This allows multiple host systems to compile NetBSD for a single target architecture.) If "no", then programs built to be run on the compile host will use the same object directory names as programs built to be run on the target architecture. Default: "no" MKHTML Can be set to "yes" or "no". Indicates whether the HTML manual pages are created and installed. Forced to "no" if NOHTML is defined, usually in the Makefile before any make(1) .include directives. Forced to "no" if MKMAN=no or MKSHARE=no. Default: "yes" MKINFO Can be set to "yes" or "no". Indicates whether GNU Info files, used for the documentation for most of the compilation tools, will be built and installed. Forced to "no" if NOINFO is defined, usually in the Makefile before any make(1) .include directives. Forced to "no" if MKSHARE=no. Default: "yes" MKKMOD Can be set to "yes" or "no". Indicates whether kernel modules will be built and installed. Default: "no" on or1k; "yes" on other platforms. MKLINKLIB Can be set to "yes" or "no". Indicates whether all of the shared library infrastructure will be built and installed. If "no", prevents: - installation of the *.a libraries - installation of the *_pic.a libraries on PIC systems - building of *.a libraries on PIC systems - installation of .so symlinks on ELF systems I.e, only install the shared library (and the .so.major symlink on ELF). Forced to "no" if NOLINKLIB is defined, usually in the Makefile before any make(1) .include directives. d224 3 a226 276 If "no", acts as MKLINT=no MKPICINSTALL=no MKPROFILE=no. Default: "yes" MKLINT Can be set to "yes" or "no". Indicates whether lint(1) will be run against portions of the NetBSD source code during the build, and whether lint libraries will be installed into DESTDIR/usr/libdata/lint. Forced to "no" if NOLINT is defined, usually in the Makefile before any make(1) .include directives. Forced to "no" if MKLINKLIB=no. Default: "no" MKMAN Can be set to "yes" or "no". Indicates whether manual pages will be installed. Forced to "no" if NOMAN is defined, usually in the Makefile before any make(1) .include directives. Forced to "no" if MKSHARE=no. If "no", acts as MKCATPAGES=no MKHTML=no. Default: "yes" MKNLS Can be set to "yes" or "no". Indicates whether Native Language System (NLS) locale zone files will be built and installed. Forced to "no" if NONLS is defined, usually in the Makefile before any make(1) .include directives. Forced to "no" if MKSHARE=no. Default: "yes" MKOBJ Can be set to "yes" or "no". Indicates whether object directories will be created when running "make obj". If "no", then all built files will be located inside the regular source tree. Forced to "no" if NOOBJ is defined, usually in the Makefile before any make(1) .include directives. If "no", acts as MKOBJDIRS=no. Note: Setting MKOBJ to "no" is not recommended and may cause problems when updating the tree with cvs(1). Default: "yes" MKOBJDIRS Can be set to "yes" or "no". Indicates whether object directories will be created automatically (via a "make obj" pass) at the start of a build. Forced to "no" if MKOBJ=no. Note: If using build.sh, the default is "yes". This may be set back to "no" by giving build.sh the -o option. Default: "no" MKPIC Can be set to "yes" or "no". Indicates whether shared objects and libraries will be created and installed. If "no", the entire built system will be statically linked. Forced to "no" if NOPIC is defined, usually in the Makefile before any make(1) .include directives. If "no", acts as MKPICLIB=no. Default: "no" on m68000; "yes" on other platforms. MKPICINSTALL Can be set to "yes" or "no". Indicates whether the ar(1) format libraries (lib*_pic.a), used to generate shared libraries, are installed. Forced to "no" if NOPICINSTALL is defined, usually in the Makefile before any make(1) .include directives. Forced to "no" if MKLINKLIB=no. Default: "no" MKPROFILE Can be set to "yes" or "no". Indicates whether profiled libraries (lib*_p.a) will be built and installed. Forced to "no" if NOPROFILE is defined, usually in the Makefile before any make(1) .include directives. Forced to "no" if MKLINKLIB=no. Default: "no" on or1k, riscv32, and riscv64 (due to toolchain problems with profiled code); "yes" on other platforms. MKREPRO Can be set to "yes" or "no". Indicates whether builds are to be reproducible. If "yes", two builds from the same source tree will produce the same build results. Used as the default for MKARZERO. Note: This may be set to "yes" by giving build.sh the -P option. Default: "no" MKREPRO_TIMESTAMP Unix timestamp. When MKREPRO is set, the timestamp of all files in the sets will be set to this value. Note: This may be set automatically to the latest source tree timestamp using cvslatest(1) by giving build.sh the -P option. Default: Unset. MKSHARE Can be set to "yes" or "no". Indicates whether files destined to reside in DESTDIR/usr/share will be built and installed. Forced to "no" if NOSHARE is defined, usually in the Makefile before any make(1) .include directives. If "no", acts as MKCATPAGES=no MKDOC=no MKINFO=no MKHTML=no MKMAN=no MKNLS=no. Default: "yes" MKSTRIPIDENT Can be set to "yes" or "no". Indicates whether RCS IDs, for use with ident(1), should be stripped from program binaries and shared libraries. Default: "no" MKSTRIPSYM Can be set to "yes" or "no". Indicates whether all local symbols should be stripped from shared libraries. If "yes", strip all local symbols from shared libraries; the effect is equivalent to the -x option of ld(1). If "no", strip only temporary local symbols; the effect is equivalent to the -X option of ld(1). Keeping non- temporary local symbols such as static function names is useful on using DTrace for userland libraries and getting a backtrace from a rump kernel loading shared libraries. Default: "yes" MKUNPRIVED Can be set to "yes" or "no". Indicates whether an unprivileged install will occur. The user, group, permissions, and file flags, will not be set on the installed items; instead the information will be appended to a file called METALOG in DESTDIR. The METALOG contents are used during the generation of the distribution tar files to ensure that the appropriate file ownership is stored. This allows a non-root `make install'. Default: "no" MKUPDATE Can be set to "yes" or "no". Indicates whether all install operations intended to write to DESTDIR will compare file timestamps before installing, and skip the install phase if the destination files are up-to-date. For top-level builds this this implies the effects of NOCLEANDIR (i.e., "make cleandir" is avoided). Note: If using build.sh, this may be set by giving the -u option. Default: "no" MKX11 Can be set to "yes" or "no". Indicates whether X11 will be built and installed from X11SRCDIR, and whether the X sets will be created. Note: If "yes", requires MKINET6=yes. Default: "no" NETBSDSRCDIR The path to the top level of the NetBSD sources. Default: Top level of the NetBSD source tree (as determined by the presence of build.sh and tools/) if make(1) is run from within that tree; otherwise BSDSRCDIR will be used. NOCLEANDIR If set, avoids the "make cleandir" phase of a full build. This has the effect of allowing only changed files in a source tree to be recompiled. This can speed up builds when updating only a few files in the tree. See also MKUPDATE. Default: Unset. NODISTRIBDIRS If set, avoids the "make distrib-dirs" phase of a full build. This skips running mtree(8) on DESTDIR, useful on systems where building as an unprivileged user, or where it is known that the system-wide mtree(8) files have not changed. Default: Unset. NOINCLUDES If set, avoids the "make includes" phase of a full build. This has the effect of preventing make(1) from thinking that some programs are out-of-date simply because the system include files have changed. However, this option should not be used when updating the entire NetBSD source tree arbitrarily; it is suggested to use MKUPDATE=yes instead in that case. Default: Unset. RELEASEDIR If set, specifies the directory to which a release(7) layout will be written at the end of a "make release". If specified, must be an absolute path. Note: build.sh will provide a default of "releasedir" (in the top-level .OBJDIR) unless run in `expert' mode. Default: Unset. TOOLCHAIN_MISSING Can be set to "yes" or "no". If not "no", this indicates that the platform "MACHINE_ARCH" being built does not have a working in-tree toolchain. If not "no", acts as MKBINUTILS=no MKGCC=no MKGDB=no. Default: "no" TOOLDIR Directory to hold the host tools, once built. If specified, must be an absolute path. This directory should be unique to a given host system and NetBSD source tree. (However, multiple target architectures may share the same TOOLDIR; the target-architecture-dependent files have unique names.) If unset, a default based on the uname(1) information of the host platform will be created in the .OBJDIR of src. Default: Unset. USETOOLS Can be set to "yes" or "no". Indicates whether the tools specified by TOOLDIR should be used as part of a build in progress. Must be set to "yes" if cross-compiling. Supported values: yes Use the tools from TOOLDIR. no Do not use the tools from TOOLDIR, but refuse to build native compilation tool components that are version-specific for that tool. never Do not use the tools from TOOLDIR, even when building native tool components. This is similar to the traditional NetBSD build method, but does not verify that the compilation tools in use are up-to-date enough in order to build the tree successfully. This may cause build or runtime problems when building the whole NetBSD source tree. Default: "no" when using outside the NetBSD source tree (detected automatically) or if TOOLCHAIN_MISSING=yes; "yes" otherwise. X11SRCDIR Directory containing the modular Xorg source. If specified, must be an absolute path. The main modular Xorg source is found in X11SRCDIR/external/mit. Default: NETBSDSRCDIR/../xsrc, if that exists; otherwise /usr/xsrc. a802 9 OBSOLETE VARIABLES MKKDEBUG Use MKDEBUGKERNEL. NBUILDJOBS Use the build.sh and make(1) option -j instead. USE_NEW_TOOLCHAIN The new toolchain is now the default. To disable, use TOOLCHAIN_MISSING=yes. d804 3 a806 4 ar(1), config(1), ctags(1), cvs(1), cvslatest(1), ex(1), g++(1), gzip(1), ident(1), ld(1), lint(1), make(1), mkisofs(1), sh(1), uname(1), vi(1), options(4), mk.conf(5), atf(7), hier(7), release(7), sysctl(7), etcupdate(8), installboot(8), mount(8), mtree(8), postinstall(8), d809 3 @ 1.153 log @more NBUILDJOBS deprecation The NBUILDJOBS option was deprecated in 2002; there's no need to keep warning about it, remove from params / show-params, and only document as obsolete. @ text @d235 15 a249 2 CPUFLAGS Additional flags to the compiler/assembler to select CPU instruction set options, CPU tuning options, etc. d263 3 a265 2 Note: build.sh will provide a default of destdir.MACHINE (in the top-level .OBJDIR) unless run in `expert' mode. d267 1 a267 2 Default: Empty string if USETOOLS is "yes"; unset otherwise. d291 12 d387 9 a395 9 MKHOSTOBJ Can be set to "yes" or "no". If set to "yes", then for programs intended to be run on the compile host, the name, release, and architecture of the host operating system will be suffixed to the name of the object directory created by "make obj". (This allows multiple host systems to compile NetBSD for a single target.) If set to "no", then programs built to be run on the compile host will use the same object directory names as programs built to be run on the target. d400 1 a400 1 manual pages are created and installed. and installed a419 2 MKKDEBUG Deprecated, use MKDEBUGKERNEL. d421 1 a421 1 modules are built and installed. d427 10 a436 4 installed. If "no", prevents: installation of the *.a libraries, installation of the *_pic.a libraries on PIC systems, building of *.a libraries on PIC systems, or installation of .so symlinks on ELF systems. d482 2 a483 2 set to "no", then all built files will be located inside the regular source tree. d501 3 d546 1 a546 1 This may be set to "yes" by giving build.sh the -P d549 1 a549 1 Default: "no" Can be set to "yes" or "no". d555 3 a557 3 This may be set automatically to the latest source tree timestamp using cvslatest(1) by giving build.sh the -P option. d582 2 a583 2 affect is equivalent to the -x option of ld(1). If "no", strip only temporary local symbols; the affect is d595 2 a596 2 to a file called METALOG in DESTDIR. The contents of METALOG are used during the generation of the d598 2 a599 1 file ownership is stored. d608 5 a612 2 Note: This also has implications on full builds (see next subsection). d616 2 a617 2 MKX11 Can be set to "yes" or "no". Indicates whether X11 is built and installed from X11SRCDIR, and whether the X d631 36 d679 5 a683 4 tree. (However, multiple targets may share the same TOOLDIR; the target-dependent files have unique names.) If unset, a default based on the uname(1) information of the host platform will be created in the .OBJDIR of src. d690 1 a717 71 "make" variables for full builds These variables only affect the top level "Makefile" and do not affect manually building subtrees of the NetBSD source code. INSTALLBOOT_BOARDS A list of boards to create bootable images for. If corresponding U-Boot packages are installed, bootable images are created as part of a release. See the -o board=name option of installboot(8). INSTALLWORLDDIR Location for the "make installworld" target to install to. If specified, must be an absolute path. Default: "/" MKOBJDIRS Can be set to "yes" or "no". Indicates whether object directories will be created automatically (via a "make obj" pass) at the start of a build. Default: "no" If using build.sh, the default is "yes". This may be set back to "no" by giving build.sh the -o option. MKUPDATE Can be set to "yes" or "no". If set, then in addition to the effects described for MKUPDATE=yes above, this implies the effects of NOCLEANDIR (i.e., "make cleandir" is avoided). Default: "no" If using build.sh, this may be set by giving the -u option. NOCLEANDIR If set, avoids the "make cleandir" phase of a full build. This has the effect of allowing only changed files in a source tree to be recompiled. This can speed up builds when updating only a few files in the tree. Default: Unset. See also MKUPDATE. NODISTRIBDIRS If set, avoids the "make distrib-dirs" phase of a full build. This skips running mtree(8) on DESTDIR, useful on systems where building as an unprivileged user, or where it is known that the system-wide mtree files have not changed. Default: Unset. NOINCLUDES If set, avoids the "make includes" phase of a full build. This has the effect of preventing make(1) from thinking that some programs are out-of-date simply because the system include files have changed. However, this option should not be used when updating the entire NetBSD source tree arbitrarily; it is suggested to use MKUPDATE=yes instead in that case. Default: Unset. RELEASEDIR If set, specifies the directory to which a release(7) layout will be written at the end of a "make release". If specified, must be an absolute path. Note: build.sh will provide a default of releasedir (in the top-level .OBJDIR) unless run in `expert' mode. Default: Unset. d1294 2 d1319 1 a1319 1 NetBSD June 10, 2023 NetBSD @ 1.152 log @BUILDING: editorial MKX11=yes wants MKINET6=yes Change the width of the variable lists to 14n (from 15n) so that when the lists are rendered and then left aligned, the column is 16 characters (aka 2 tabs) which makes copypasta to bsd.README easier. @ text @a678 5 NBUILDJOBS Now obsolete. Use the make(1) option -j, instead. See below. Default: Unset. d1291 1 a1291 1 NBUILDJOBS Use the make(1) option -j instead. d1314 1 a1314 1 NetBSD June 5, 2023 NetBSD @ 1.151 log @BUILDING: update from canonical mk.conf(5) Incorporate content and styles updates for mk.conf entries from share/man/man5/mk.conf.5, which is the canonical reference for mk.conf. Add: BSDOBJDIR, BSDSRCDIR, EXTERNAL_TOOLCHAIN, MKDEBUGKERNEL, MKDEBUGTOOLS, MKHTML, MKLINKLIB, MKOBJDIRS, TOOLCHAIN_MISSING, NETBSDSRCDIR It's for further study as to whether we just replace the most of subsection "make" variables with a link to mk.conf(5). Style: - Add more .de macros per mk.conf.5. - Order list items alphabetically. When multiple items are present in a list item, sort within the item first. - More cross-references. @ text @d96 1 a96 1 HOST_CC Path name to C compiler used to create the toolchain. d98 1 a98 1 HOST_CFLAGS Flags passed to the host C compiler. d100 1 a100 1 HOST_CXX Path name to C++ compiler used to create the toolchain. d102 1 a102 1 HOST_CXXFLAGS Flags passed to the host C++ compiler. d104 17 a120 17 HOST_SH Path name to a shell available on the host system and suitable for use during the build. The NetBSD build system requires a modern Bourne-like shell with POSIX- compliant features, and also requires support for the "local" keyword to declare local variables in shell functions (which is a widely-implemented but non- standardised feature). Depending on the host system, a suitable shell may be /bin/sh, /usr/xpg4/bin/sh, /bin/ksh (provided it is a variant of ksh that supports the "local" keyword, such as ksh88, but not ksh93), or /usr/local/bin/bash. Most parts of the build require HOST_SH to be an absolute path; however, build.sh allows it to be a simple command name, which will be converted to an absolute path by searching the PATH. d123 2 a124 2 A colon-separated list of search paths used by installboot(8) to find U-Boot packages. d126 1 a126 1 MACHINE Machine type, e.g., "macppc". d128 1 a128 1 MACHINE_ARCH Machine architecture, e.g., "powerpc". d130 1 a130 1 MAKE Path name to invoke make(1) as. d132 2 a133 2 MAKECONF The name of the make(1) configuration file. See "make" variables and mk.conf(5). d135 1 a135 1 Note: Only settable in the process environment. d137 1 a137 1 Default: "/etc/mk.conf" d139 1 a139 1 MAKEFLAGS Flags to invoke make(1) with. d141 3 a143 3 Note: build.sh ignores the value of MAKEFLAGS passed in the environment, but allows MAKEFLAGS to be set via the -V option. d145 7 a151 7 MAKEOBJDIR Directory to use as the .OBJDIR for the current directory. The value is subjected to variable expansion by make(1). Typical usage is to set this variable to a value involving the use of `${.CURDIR:S...}' or `${.CURDIR:C...}', to derive the value of .OBJDIR from the value of .CURDIR. Used only if MAKEOBJDIRPREFIX is not defined. d153 3 a155 4 Note: MAKEOBJDIR can be provided only in the environment or via the -O flag of build.sh; it cannot usefully be set inside a Makefile, including in mk.conf(5) or MAKECONF. d158 19 a176 19 Top level directory of the object directory tree. The value is subjected to variable expansion by make(1). build.sh will create the ${MAKEOBJDIRPREFIX} directory if necessary, but if make(1) is used without build.sh, then rules in will abort the build if the ${MAKEOBJDIRPREFIX} directory does not exist. If the value is defined and valid, then ${MAKEOBJDIRPREFIX}/${.CURDIR} is used as the .OBJDIR for the current directory. The current directory may be read only. Note: MAKEOBJDIRPREFIX can be provided only in the environment or via the -M flag of build.sh; it cannot usefully be set inside a Makefile, including in mk.conf(5) or MAKECONF. TMPDIR Top-level directory to store temporary directories used by build.sh before paths to other directories such as .OBJDIR can be determined. d178 2 a179 2 Note: Must support execution of binaries. I.e., without mount(8)'s -o noexec option. d181 1 a181 1 Default: "/tmp". d192 2 a193 2 BSDOBJDIR The real path to the object directory tree for the NetBSD source tree. d195 1 a195 1 Default: "/usr/obj" d197 2 a198 2 BSDSRCDIR The real path to the NetBSD source tree, if NETBSDSRCDIR isn't defined. d200 49 a248 49 Default: "/usr/src" BUILDID Identifier for the build. If set, this should be a short string that is suitable for use as part of a file or directory name. The identifier will be appended to object directory names, and can be consulted in the make(1) configuration file in order to set additional build parameters, such as compiler flags. It will also be used as part of the kernel version string, which can be shown by "uname -v". Default: Unset. BUILDINFO Optional multi-line string containing information about the build. This will appear in DESTDIR/etc/release, and it will be stored in the buildinfo variable in any kernels that are built. When such kernels are booted, the sysctl(7) kern.buildinfo variable will report this value. The string may contain backslash escape sequences, such as "\\" (representing a backslash character) and "\n" (representing a newline). Default: Unset. BUILDSEED g++(1) uses random numbers when compiling C++ code. This variable seeds the g++(1) random number generator using -frandom-seed with this value. By default, it is set to "NetBSD-(majorversion)". Using a fixed value causes C++ binaries to be the same when built from the same sources, resulting in identical (reproducible) builds. Additional information is available in the g++(1) documentation of -frandom-seed. Default: Unset. CPUFLAGS Additional flags to the compiler/assembler to select CPU instruction set options, CPU tuning options, etc. Default: Unset. DESTDIR Directory to contain the built NetBSD system. If set, special options are passed to the compilation tools to prevent their default use of the host system's /usr/include, /usr/lib, and so forth. This pathname must be an absolute path, and should not end with a slash (/) character. (For installation into the system's root directory, set DESTDIR to an empty string, not to "/"). The directory must reside on a file system which supports long file names and hard links. d250 2 a251 2 Note: build.sh will provide a default of destdir.MACHINE (in the top-level .OBJDIR) unless run in `expert' mode. d253 2 a254 2 Default: Empty string if USETOOLS is "yes"; unset otherwise. d257 5 a261 5 If defined, this variable indicates the root directory of an external toolchain which will be used to build the tree. For example, if a platform is a TOOLCHAIN_MISSING platform, EXTERNAL_TOOLCHAIN can be used to re-enable the cross-compile framework. d263 3 a265 3 If EXTERNAL_TOOLCHAIN is defined, act as MKGCC=no, since the external version of the compiler may not be able to build the library components of the in-tree compiler. d267 3 a269 3 This variable should be used in conjunction with an appropriate HAVE_GCC or HAVE_LLVM setting to control the compiler flags. d271 4 a274 4 Note: This variable is not yet used in as many places as it should be. Expect the exact semantics of this variable to change in the short term as parts of the cross-compile framework continue to be cleaned up. d276 1 a276 1 Default: Unset. d278 1 a278 2 MAKEVERBOSE Level of verbosity of status messages. Supported values: d280 2 a281 2 0 No descriptive messages or commands executed by make(1) are shown. d283 3 a285 3 1 Brief messages are shown describing what is being done, but the actual commands executed by make(1) are not shown. d287 3 a289 3 2 Descriptive messages are shown as above (prefixed with a `#'), and ordinary commands performed by make(1) are shown. d291 4 a294 4 3 In addition to the above, all commands performed by make(1) are shown, even if they would ordinarily have been hidden through use of the "@@" prefix in the relevant makefile. d296 3 a298 3 4 In addition to the above, commands executed by make(1) are traced through use of the sh(1) "-x" flag. d300 1 a300 1 Default: 2 d302 3 a304 3 MKCATPAGES Can be set to "yes" or "no". Indicates whether preformatted plaintext manual pages will be created and installed. d306 1 a306 1 Forced to "no" if MKMAN=no or MKSHARE=no. d308 1 a308 1 Default: "no" d310 2 a311 2 MKCROSSGDB Can be set to "yes" or "no". Create a cross-gdb as a host tool. d313 1 a313 1 Default: "no" d315 5 a319 5 MKDEBUG Can be set to "yes" or "no". Indicates whether debug information should be generated for all userland binaries. The result is collected as an additional debug.tgz and xdebug.tgz set and installed in DESTDIR/usr/libdata/debug. d321 2 a322 2 Forced to "no" if NODEBUG is defined, usually in the Makefile before any make(1) .include directives. d324 1 a324 1 Default: "no" d326 7 a332 7 MKDEBUGKERNEL Can be set to "yes" or "no". Indicates whether debugging symbols will be built for kernels by default; pretend as if makeoptions DEBUG="-g" is specified in kernel configuration files. This will also put the debug kernel netbsd.gdb in the kernel sets. See options(4) for details. This is useful if a cross-gdb is built as well (see MKCROSSGDB). d334 1 a334 1 Default: "no" d336 3 a338 3 MKDEBUGLIB Can be set to "yes" or "no". Indicates whether debug libraries (lib*_g.a) will be built and installed. Debug libraries are compiled with "-g -DDEBUG". d340 2 a341 2 Forced to "no" if NODEBUGLIB is defined, usually in the Makefile before any make(1) .include directives. d343 1 a343 1 Default: "no" d345 3 a347 3 MKDEBUGTOOLS Can be set to "yes" or "no". Indicates whether debug information (lib*_g.a) will be included in the build toolchain. d349 1 a349 1 Default: "no" d351 3 a353 3 MKDOC Can be set to "yes" or "no". Indicates whether system documentation destined for DESTDIR/usr/share/doc will be installed. d355 2 a356 2 Forced to "no" if NODOC is defined, usually in the Makefile before any make(1) .include directives. d358 1 a358 1 Forced to "no" if MKSHARE=no. d360 1 a360 1 Default: "yes" d362 9 a370 9 MKHOSTOBJ Can be set to "yes" or "no". If set to "yes", then for programs intended to be run on the compile host, the name, release, and architecture of the host operating system will be suffixed to the name of the object directory created by "make obj". (This allows multiple host systems to compile NetBSD for a single target.) If set to "no", then programs built to be run on the compile host will use the same object directory names as programs built to be run on the target. d372 1 a372 1 Default: "no" d374 2 a375 2 MKHTML Can be set to "yes" or "no". Indicates whether the HTML manual pages are created and installed. and installed d377 2 a378 2 Forced to "no" if NOHTML is defined, usually in the Makefile before any make(1) .include directives. d380 1 a380 1 Forced to "no" if MKMAN=no or MKSHARE=no. d382 1 a382 1 Default: "yes" d384 3 a386 3 MKINFO Can be set to "yes" or "no". Indicates whether GNU Info files, used for the documentation for most of the compilation tools, will be built and installed. d388 2 a389 2 Forced to "no" if NOINFO is defined, usually in the Makefile before any make(1) .include directives. d391 1 a391 1 Forced to "no" if MKSHARE=no. d393 1 a393 1 Default: "yes" d395 1 a395 1 MKKDEBUG Deprecated, use MKDEBUGKERNEL. d397 2 a398 2 MKKMOD Can be set to "yes" or "no". Indicates whether kernel modules are built and installed. d400 1 a400 1 Default: "no" on or1k; "yes" on other platforms. d402 6 a407 6 MKLINKLIB Can be set to "yes" or "no". Indicates whether all of the shared library infrastructure will be built and installed. If "no", prevents: installation of the *.a libraries, installation of the *_pic.a libraries on PIC systems, building of *.a libraries on PIC systems, or installation of .so symlinks on ELF systems. d409 2 a410 2 Forced to "no" if NOLINKLIB is defined, usually in the Makefile before any make(1) .include directives. d412 1 a412 1 If "no", acts as MKLINT=no MKPICINSTALL=no MKPROFILE=no. d414 1 a414 1 Default: "yes" d416 4 a419 4 MKLINT Can be set to "yes" or "no". Indicates whether lint(1) will be run against portions of the NetBSD source code during the build, and whether lint libraries will be installed into DESTDIR/usr/libdata/lint. d421 2 a422 2 Forced to "no" if NOLINT is defined, usually in the Makefile before any make(1) .include directives. d424 1 a424 1 Forced to "no" if MKLINKLIB=no. d426 1 a426 1 Default: "no" d428 2 a429 2 MKMAN Can be set to "yes" or "no". Indicates whether manual pages will be installed. d431 2 a432 2 Forced to "no" if NOMAN is defined, usually in the Makefile before any make(1) .include directives. d434 1 a434 1 Forced to "no" if MKSHARE=no. d436 1 a436 1 If "no", acts as MKCATPAGES=no MKHTML=no. d438 1 a438 1 Default: "yes" d440 3 a442 3 MKNLS Can be set to "yes" or "no". Indicates whether Native Language System (NLS) locale zone files will be built and installed. d444 2 a445 2 Forced to "no" if NONLS is defined, usually in the Makefile before any make(1) .include directives. d447 1 a447 1 Forced to "no" if MKSHARE=no. d449 1 a449 1 Default: "yes" d451 4 a454 4 MKOBJ Can be set to "yes" or "no". Indicates whether object directories will be created when running "make obj". If set to "no", then all built files will be located inside the regular source tree. d456 2 a457 2 Forced to "no" if NOOBJ is defined, usually in the Makefile before any make(1) .include directives. d459 1 a459 1 If "no", acts as MKOBJDIRS=no. d461 2 a462 2 Note: Setting MKOBJ to "no" is not recommended and may cause problems when updating the tree with cvs(1). d464 1 a464 1 Default: "yes" d466 3 a468 3 MKOBJDIRS Can be set to "yes" or "no". Indicates whether object directories will be created automatically (via a "make obj" pass) at the start of a build. d470 1 a470 1 Forced to "no" if MKOBJ=no. d472 1 a472 1 Default: "no" d474 3 a476 3 MKPIC Can be set to "yes" or "no". Indicates whether shared objects and libraries will be created and installed. If "no", the entire built system will be statically linked. d478 2 a479 2 Forced to "no" if NOPIC is defined, usually in the Makefile before any make(1) .include directives. d481 1 a481 1 If "no", acts as MKPICLIB=no. d483 1 a483 1 Default: "no" on m68000; "yes" on other platforms. d485 3 a487 3 MKPICINSTALL Can be set to "yes" or "no". Indicates whether the ar(1) format libraries (lib*_pic.a), used to generate shared libraries, are installed. d489 2 a490 2 Forced to "no" if NOPICINSTALL is defined, usually in the Makefile before any make(1) .include directives. d492 1 a492 1 Forced to "no" if MKLINKLIB=no. d494 1 a494 1 Default: "no" d496 2 a497 2 MKPROFILE Can be set to "yes" or "no". Indicates whether profiled libraries (lib*_p.a) will be built and installed. d499 2 a500 2 Forced to "no" if NOPROFILE is defined, usually in the Makefile before any make(1) .include directives. d502 1 a502 1 Forced to "no" if MKLINKLIB=no. d504 3 a506 3 Default: "no" on or1k, riscv32, and riscv64 (due to toolchain problems with profiled code); "yes" on other platforms. d508 3 a510 3 MKREPRO Can be set to "yes" or "no". Indicates whether builds are to be reproducible. If "yes", two builds from the same source tree will produce the same build results. d512 1 a512 1 Used as the default for MKARZERO. d514 2 a515 2 This may be set to "yes" by giving build.sh the -P option. d517 1 a517 1 Default: "no" Can be set to "yes" or "no". d520 2 a521 2 Unix timestamp. When MKREPRO is set, the timestamp of all files in the sets will be set to this value. d523 3 a525 3 This may be set automatically to the latest source tree timestamp using cvslatest(1) by giving build.sh the -P option. d527 1 a527 1 Default: Unset. d529 3 a531 3 MKSHARE Can be set to "yes" or "no". Indicates whether files destined to reside in DESTDIR/usr/share will be built and installed. d533 2 a534 2 Forced to "no" if NOSHARE is defined, usually in the Makefile before any make(1) .include directives. d536 2 a537 2 If "no", acts as MKCATPAGES=no MKDOC=no MKINFO=no MKHTML=no MKMAN=no MKNLS=no. d539 1 a539 1 Default: "yes" d541 3 a543 3 MKSTRIPIDENT Can be set to "yes" or "no". Indicates whether RCS IDs, for use with ident(1), should be stripped from program binaries and shared libraries. d545 1 a545 1 Default: "no" d547 9 a555 10 MKSTRIPSYM Can be set to "yes" or "no". Indicates whether all local symbols should be stripped from shared libraries. If "yes", strip all local symbols from shared libraries; the affect is equivalent to the -x option of ld(1). If "no", strip only temporary local symbols; the affect is equivalent to the -X option of ld(1). Keeping non- temporary local symbols such as static function names is useful on using DTrace for userland libraries and getting a backtrace from a rump kernel loading shared libraries. d557 1 a557 1 Default: "yes" d559 8 a566 8 MKUNPRIVED Can be set to "yes" or "no". Indicates whether an unprivileged install will occur. The user, group, permissions, and file flags, will not be set on the installed items; instead the information will be appended to a file called METALOG in DESTDIR. The contents of METALOG are used during the generation of the distribution tar files to ensure that the appropriate file ownership is stored. d568 1 a568 1 Default: "no" d570 4 a573 4 MKUPDATE Can be set to "yes" or "no". Indicates whether all install operations intended to write to DESTDIR will compare file timestamps before installing, and skip the install phase if the destination files are up-to-date. d575 2 a576 2 Note: This also has implications on full builds (see next subsection). d578 1 a578 1 Default: "no" d580 3 a582 2 MKX11 Can be set to "yes" or "no". Indicates whether X11 is built and installed from X11SRCDIR. d584 1 a584 1 Default: "no" d586 1 a586 1 NETBSDSRCDIR The path to the top level of the NetBSD sources. d588 6 a593 4 Default: Top level of the NetBSD source tree (as determined by the presence of build.sh and tools/) if make(1) is run from within that tree; otherwise BSDSRCDIR will be used. d596 44 a639 46 Can be set to "yes" or "no". If not "no", this indicates that the platform "MACHINE_ARCH" being built does not have a working in-tree toolchain. If not "no", acts as MKBINUTILS=no MKGCC=no MKGDB=no. Default: "no" TOOLDIR Directory to hold the host tools, once built. If specified, must be an absolute path. This directory should be unique to a given host system and NetBSD source tree. (However, multiple targets may share the same TOOLDIR; the target-dependent files have unique names.) If unset, a default based on the uname(1) information of the host platform will be created in the .OBJDIR of src. Default: Unset. USETOOLS Can be set to "yes" or "no". Indicates whether the tools specified by TOOLDIR should be used as part of a build in progress. Must be set to "yes" if cross- compiling. yes Use the tools from TOOLDIR. no Do not use the tools from TOOLDIR, but refuse to build native compilation tool components that are version-specific for that tool. never Do not use the tools from TOOLDIR, even when building native tool components. This is similar to the traditional NetBSD build method, but does not verify that the compilation tools in use are up-to-date enough in order to build the tree successfully. This may cause build or runtime problems when building the whole NetBSD source tree. Default: "no" when using outside the NetBSD source tree (detected automatically) or if TOOLCHAIN_MISSING=yes; "yes" otherwise. X11SRCDIR Directory containing the modular Xorg source. If specified, must be an absolute path. The main modular Xorg source is found in X11SRCDIR/external/mit. d641 2 a642 2 Default: NETBSDSRCDIR/../xsrc, if that exists; otherwise /usr/xsrc. d649 4 a652 4 A list of boards to create bootable images for. If corresponding U-Boot packages are installed, bootable images are created as part of a release. See the -o board=name option of installboot(8). d654 3 a656 2 INSTALLWORLDDIR Location for the "make installworld" target to install to. If specified, must be an absolute path. d658 1 a658 1 Default: "/" d660 3 a662 3 MKOBJDIRS Can be set to "yes" or "no". Indicates whether object directories will be created automatically (via a "make obj" pass) at the start of a build. d664 1 a664 1 Default: "no" d666 2 a667 2 If using build.sh, the default is "yes". This may be set back to "no" by giving build.sh the -o option. d669 4 a672 4 MKUPDATE Can be set to "yes" or "no". If set, then in addition to the effects described for MKUPDATE=yes above, this implies the effects of NOCLEANDIR (i.e., "make cleandir" is avoided). d674 1 a674 1 Default: "no" d676 2 a677 2 If using build.sh, this may be set by giving the -u option. d679 2 a680 2 NBUILDJOBS Now obsolete. Use the make(1) option -j, instead. See below. d682 1 a682 1 Default: Unset. d684 4 a687 4 NOCLEANDIR If set, avoids the "make cleandir" phase of a full build. This has the effect of allowing only changed files in a source tree to be recompiled. This can speed up builds when updating only a few files in the tree. d689 1 a689 1 Default: Unset. d691 1 a691 1 See also MKUPDATE. d693 5 a697 5 NODISTRIBDIRS If set, avoids the "make distrib-dirs" phase of a full build. This skips running mtree(8) on DESTDIR, useful on systems where building as an unprivileged user, or where it is known that the system-wide mtree files have not changed. d699 1 a699 1 Default: Unset. d701 7 a707 7 NOINCLUDES If set, avoids the "make includes" phase of a full build. This has the effect of preventing make(1) from thinking that some programs are out-of-date simply because the system include files have changed. However, this option should not be used when updating the entire NetBSD source tree arbitrarily; it is suggested to use MKUPDATE=yes instead in that case. d709 1 a709 1 Default: Unset. d711 3 a713 3 RELEASEDIR If set, specifies the directory to which a release(7) layout will be written at the end of a "make release". If specified, must be an absolute path. d715 2 a716 2 Note: build.sh will provide a default of releasedir (in the top-level .OBJDIR) unless run in `expert' mode. d718 1 a718 1 Default: Unset. d1319 1 a1319 1 NetBSD June 4, 2023 NetBSD @ 1.150 log @build.sh: MAKECONF and mk.conf(5) improvements Move MAKECONF to the Environment variables section. Add mk.conf(5) cross-references. Make Notes more obvious. Fix mandoc lint. @ text @d21 2 a22 8 doc/BUILDING.mdoc This document (in -mdoc troff format; the original copy). BUILDING This document (in plaintext). tools/compat/README Special notes for cross-hosting a NetBSD build on non- NetBSD platforms. d48 9 d63 3 a65 4 distrib/, etc/ Sources for items used when making a full release snapshot, such as files installed in DESTDIR/etc on the destination system, boot media, and release notes. d67 1 a67 1 tests/, regress/ d79 5 a83 1 bin/ ... usr.sbin/ a87 4 external/mit/xorg/ "Reachover" build structure for modular Xorg; the source is in X11SRCDIR. d96 1 a96 17 HOST_SH Path name to a shell available on the host system and suitable for use during the build. The NetBSD build system requires a modern Bourne-like shell with POSIX- compliant features, and also requires support for the "local" keyword to declare local variables in shell functions (which is a widely-implemented but non- standardised feature). Depending on the host system, a suitable shell may be /bin/sh, /usr/xpg4/bin/sh, /bin/ksh (provided it is a variant of ksh that supports the "local" keyword, such as ksh88, but not ksh93), or /usr/local/bin/bash. Most parts of the build require HOST_SH to be an absolute path; however, build.sh allows it to be a simple command name, which will be converted to an absolute path by searching the PATH. d98 1 a98 1 HOST_CC Path name to C compiler used to create the toolchain. d100 1 a100 1 HOST_CFLAGS Flags passed to the host C compiler. d102 1 a102 1 HOST_CXX Path name to C++ compiler used to create the toolchain. d104 17 a120 1 HOST_CXXFLAGS Flags passed to the host C++ compiler. d123 2 a124 2 A colon-separated list of search paths used by installboot(8) to find U-Boot packages. d126 1 a126 1 MACHINE Machine type, e.g., "macppc". d128 1 a128 1 MACHINE_ARCH Machine architecture, e.g., "powerpc". d130 1 a130 1 MAKE Path name to invoke make(1) as. d132 46 a177 44 MAKECONF The name of the make(1) configuration file. See "make" variables and mk.conf(5). Note: Only settable in the process environment. Default: "/etc/mk.conf" MAKEFLAGS Flags to invoke make(1) with. Note that build.sh ignores the value of MAKEFLAGS passed in the environment, but allows MAKEFLAGS to be set via the -V option. MAKEOBJDIR Directory to use as the .OBJDIR for the current directory. The value is subjected to variable expansion by make(1). Typical usage is to set this variable to a value involving the use of `${.CURDIR:S...}' or `${.CURDIR:C...}', to derive the value of .OBJDIR from the value of .CURDIR. Used only if MAKEOBJDIRPREFIX is not defined. Note: MAKEOBJDIR can be provided only in the environment or via the -O flag of build.sh; it cannot usefully be set inside a Makefile, including in mk.conf(5) or MAKECONF. MAKEOBJDIRPREFIX Top level directory of the object directory tree. The value is subjected to variable expansion by make(1). build.sh will create the ${MAKEOBJDIRPREFIX} directory if necessary, but if make(1) is used without build.sh, then rules in will abort the build if the ${MAKEOBJDIRPREFIX} directory does not exist. If the value is defined and valid, then ${MAKEOBJDIRPREFIX}/${.CURDIR} is used as the .OBJDIR for the current directory. The current directory may be read only. Note: MAKEOBJDIRPREFIX can be provided only in the environment or via the -M flag of build.sh; it cannot usefully be set inside a Makefile, including in mk.conf(5) or MAKECONF. TMPDIR Top-level directory to store temporary directories used by build.sh before paths to other directories such as .OBJDIR can be determined. d179 2 a180 2 Note: Must support execution of binaries. I.e., without mount(8)'s -o noexec option. d182 1 a182 1 Default: "/tmp". d188 126 a313 2 MAKECONF. This list is not comprehensive; all supported variables and their defaults are documented in mk.conf(5). d315 37 a351 8 BUILDID Identifier for the build. If set, this should be a short string that is suitable for use as part of a file or directory name. The identifier will be appended to object directory names, and can be consulted in the make(1) configuration file in order to set additional build parameters, such as compiler flags. It will also be used as part of the kernel version string, which can be shown by "uname -v". d353 20 a372 1 Default: Unset. d374 1 a374 8 BUILDINFO This may be a multi-line string containing information about the build. This will appear in DESTDIR/etc/release, and it will be stored in the buildinfo variable in any kernels that are built. When such kernels are booted, the sysctl(7) kern.buildinfo variable will report this value. The string may contain backslash escape sequences, such as "\\" (representing a backslash character) and "\n" (representing a newline). d376 2 a377 1 Default: Unset. d379 2 a380 8 BUILDSEED GCC uses random numbers when compiling C++ code. This variable seeds the gcc random number generator using the -frandom-seed flag with this value. By default, it is set to NetBSD-(majorversion). Using a fixed value causes C++ binaries to be the same when built from the same sources, resulting in identical (reproducible) builds. Additional information is available in the GCC documentation of -frandom-seed. d382 1 a382 2 CPUFLAGS Additional flags to the compiler/assembler to select CPU instruction set options, CPU tuning options, etc. d384 1 a384 1 Default: Unset. d386 3 a388 8 DESTDIR Directory to contain the built NetBSD system. If set, special options are passed to the compilation tools to prevent their default use of the host system's /usr/include, /usr/lib, and so forth. This pathname must be an absolute path, and should not end with a slash (/) character. (For installation into the system's root directory, set DESTDIR to an empty string, not to "/"). The directory must reside on a file system which supports long file names and hard links. d390 2 a391 1 Default: Empty string if USETOOLS is "yes"; unset otherwise. d393 1 a393 2 Note: build.sh will provide a default of destdir.MACHINE (in the top-level .OBJDIR) unless run in `expert' mode. d395 1 a395 2 MAKEVERBOSE Level of verbosity of status messages. Supported values: d397 1 a397 2 0 No descriptive messages or commands executed by make(1) are shown. d399 2 a400 3 1 Brief messages are shown describing what is being done, but the actual commands executed by make(1) are not shown. d402 1 a402 3 2 Descriptive messages are shown as above (prefixed with a `#'), and ordinary commands performed by make(1) are shown. d404 6 a409 4 3 In addition to the above, all commands performed by make(1) are shown, even if they would ordinarily have been hidden through use of the "@@" prefix in the relevant makefile. d411 2 a412 2 4 In addition to the above, commands executed by make(1) are traced through use of the sh(1) "-x" flag. d414 1 a414 1 Default: 2 d416 1 a416 2 MKCATPAGES Can be set to "yes" or "no". Indicates whether preformatted plaintext manual pages will be created during a build. d418 4 a421 1 Default: "no" d423 2 a424 2 MKCROSSGDB Can be set to "yes" or "no". Create a cross-gdb as a host tool. d426 1 a426 1 Default: "no" d428 1 a428 4 MKDEBUG Can be set to "yes" or "no". Indicates whether debug information should be generated for all userland binaries compiled. The result is collected as an additional debug.tgz and xdebug.tgz set and installed in /usr/libdata/debug. d430 2 a431 1 Default: "no" d433 2 a434 3 MKDEBUGLIB Can be set to "yes" or "no". Indicates whether debug information (see MKDEBUG) should also be generated for all libraries built. d436 1 a436 1 Default: "no" d438 1 a438 3 MKDOC Can be set to "yes" or "no". Indicates whether system documentation destined for DESTDIR/usr/share/doc will be installed during a build. d440 1 a440 1 Default: "yes" d442 3 a444 2 MKHTML Can be set to "yes" or "no". Indicates whether preformatted HTML manual pages will be built and installed d446 2 a447 1 Default: "yes" d449 1 a449 8 MKHOSTOBJ Can be set to "yes" or "no". If set to "yes", then for programs intended to be run on the compile host, the name, release, and architecture of the host operating system will be suffixed to the name of the object directory created by "make obj". (This allows multiple host systems to compile NetBSD for a single target.) If set to "no", then programs built to be run on the compile host will use the same object directory names as programs built to be run on the target. d451 1 a451 1 Default: "no" d453 4 a456 4 MKINFO Can be set to "yes" or "no". Indicates whether GNU Info files will be created and installed during a build. GNU Info files are used for providing documentation by most of the compilation tools. d458 2 a459 1 Default: "yes" d461 1 a461 5 MKKDEBUG Can be set to "yes" or "no". Force generation of full-debug symbol versions of all kernels compiled. Alongside of the netbsd kernel file, an unstripped version netbsd.gdb is created. This is useful if a cross-gdb is built as well (see MKCROSSGDB). d463 2 a464 1 Default: "no" d466 1 a466 2 MKKMOD Can be set to "yes" or "no". Indicates whether kernel modules are built and installed. d468 3 a470 1 Default: "yes" d472 1 a472 4 MKLINT Can be set to "yes" or "no". Indicates whether lint(1) will be run against portions of the NetBSD source code during the build, and whether lint libraries will be installed into DESTDIR/usr/libdata/lint. d474 1 a474 1 Default: "no" d476 3 a478 2 MKMAN Can be set to "yes" or "no". Indicates whether manual pages will be installed during a build. d480 2 a481 1 Default: "yes" d483 1 a483 3 MKNLS Can be set to "yes" or "no". Indicates whether Native Language System locale zone files will be compiled and installed during a build. d485 1 a485 1 Default: "yes" d487 3 a489 4 MKOBJ Can be set to "yes" or "no". Indicates whether object directories will be created when running "make obj". If set to "no", then all built files will be located inside the regular source tree. d491 2 a492 1 Default: "yes" d494 1 a494 2 Note that setting MKOBJ to "no" is not recommended and may cause problems when updating the tree with cvs(1). d496 1 a496 4 MKPIC Can be set to "yes" or "no". Indicates whether shared objects and libraries will be created and installed during a build. If set to "no", the entire built system will be statically linked. d498 2 a499 2 Default: Platform dependent. As of this writing, all platforms except m68000 default to "yes". d501 2 a502 4 MKPICINSTALL Can be set to "yes" or "no". Indicates whether the ar(1) format libraries (lib*_pic.a), used to generate shared libraries, are installed during a build. d504 1 a504 1 Default: "yes" d506 3 a508 3 MKPROFILE Can be set to "yes" or "no". Indicates whether profiled libraries (lib*_p.a) will be built and installed during a build. d510 3 a512 3 Default: "yes"; however, some platforms turn off MKPROFILE by default at times due to toolchain problems with profiled code. d514 1 a514 3 MKREPRO Can be set to "yes" or "no". Create reproducible builds. This enables different switches to make two builds from the same source tree result in the same build results. d516 4 a519 2 Default: "no" This may be set to "yes" by giving build.sh the -P option. d522 15 a536 2 Unix timestamp. When MKREPRO is set, the timestamp of all files in the sets will be set to this value. d538 2 a539 90 Default: Unset. This may be set automatically to the latest source tree timestamp using cvslatest(1) by giving build.sh the -P option. MKSHARE Can be set to "yes" or "no". Indicates whether files destined to reside in DESTDIR/usr/share will be built and installed during a build. If set to "no", then all of MKCATPAGES, MKDOC, MKINFO, MKMAN, and MKNLS will be set to "no" unconditionally. Default: "yes" MKSTRIPIDENT Can be set to "yes" or "no". Indicates whether RCS IDs, for use with ident(1), should be stripped from program binaries and shared libraries. Default: "no" MKSTRIPSYM Can be set to "yes" or "no". Indicates whether all local symbols should be stripped from shared libraries. If "yes", strip all local symbols from shared libraries; the affect is equivalent to the -x option of ld(1). If "no", strip only temporary local symbols; the affect is equivalent to the -X option of ld(1). Keeping non-temporary local symbols such as static function names is useful on using DTrace for userland libraries and getting a backtrace from a rump kernel loading shared libraries. Default: "yes" MKUNPRIVED Can be set to "yes" or "no". Indicates whether an unprivileged install will occur. The user, group, permissions, and file flags, will not be set on the installed items; instead the information will be appended to a file called METALOG in DESTDIR. The contents of METALOG are used during the generation of the distribution tar files to ensure that the appropriate file ownership is stored. Default: "no" MKUPDATE Can be set to "yes" or "no". Indicates whether all install operations intended to write to DESTDIR will compare file timestamps before installing, and skip the install phase if the destination files are up-to-date. This also has implications on full builds (see next subsection). Default: "no" MKX11 Can be set to "yes" or "no". Indicates whether X11 is built from X11SRCDIR. Default: "no" TOOLDIR Directory to hold the host tools, once built. If specified, must be an absolute path. This directory should be unique to a given host system and NetBSD source tree. (However, multiple targets may share the same TOOLDIR; the target- dependent files have unique names.) If unset, a default based on the uname(1) information of the host platform will be created in the .OBJDIR of src. Default: Unset. USETOOLS Indicates whether the tools specified by TOOLDIR should be used as part of a build in progress. Must be set to "yes" if cross-compiling. yes Use the tools from TOOLDIR. no Do not use the tools from TOOLDIR, but refuse to build native compilation tool components that are version- specific for that tool. never Do not use the tools from TOOLDIR, even when building native tool components. This is similar to the traditional NetBSD build method, but does not verify that the compilation tools in use are up-to-date enough in order to build the tree successfully. This may cause build or runtime problems when building the whole NetBSD source tree. Default: "yes", unless TOOLCHAIN_MISSING is set to "yes". USETOOLS is also set to "no" when using outside the NetBSD source tree. X11SRCDIR Directory containing the modular Xorg source. If specified, must be an absolute path. The main modular Xorg source is found in X11SRCDIR/external/mit. d541 104 a644 2 Default: NETBSDSRCDIR/../xsrc, if that exists; otherwise /usr/xsrc. a715 2 Default: Unset. d719 2 d857 6 a862 6 Note that other, smaller, CD-ROM images may be created in the RELEASEDIR/RELEASEMACHINEDIR/installation/cdrom directory by "make release". These smaller images usually contain the same tools as the larger images in RELEASEDIR/images, but do not contain additional content such as the distribution sets. d864 1 a864 1 Note that the mac68k port still uses an older method of d886 6 a891 6 Note that other, smaller, CD-ROM images may be created in the RELEASEDIR/RELEASEMACHINEDIR/installation/cdrom directory by "make release". These smaller images usually contain the same tools as the larger images in RELEASEDIR/images, but do not contain additional content such as the distribution sets. d893 1 a893 1 Note that the mac68k port still uses an older method of d936 5 a940 3 on the local host. Note that most tests are now managed instead using atf(7); this target should probably run those as well but currently does not. d1007 5 a1011 3 installworld". Note that files that are part of the "etc" or "xetc" sets will not be installed, unless overridden by the INSTALLSETS environment variable. d1194 9 a1202 9 Note that placing the obj directory location outside of the default source tree hierarchy makes it easier to manually clear out old files in the event the "make cleandir" operation is unable to do so. (See CAVEATS below.) Note also that use of one of -M or -O is the only means of building multiple machine architecture userlands from the same source tree without cleaning between builds (in which case, one would specify distinct obj locations for each). d1238 5 a1242 4 place the wrapper in PATH automatically. Note that wrapper is the full name of the file, not just a directory name. If a relative path is specified, it will be converted to an absolute path before being used. d1271 1 a1271 1 1. % ./build.sh [options] tools kernel=GENERIC d1276 1 a1276 1 2. % ./build.sh [options] -U distribution d1281 1 a1281 1 3. # ./build.sh [options] -U install=/ d1288 1 a1288 1 4. % ./build.sh [options] -U -u release d1304 5 a1308 2 make(1), mk.conf(5), hier(7), release(7), etcupdate(8), installboot(8), mount(8), postinstall(8), sysinst(8), pkgsrc/sysutils/cdrtools d1320 1 a1320 1 NetBSD May 18, 2023 NetBSD @ 1.149 log @BUILDING: TMPDIR must not be noexec Describe $TMPDIR as used by build.sh, and add a note that it can't be mounted noexec. PR toolchain/44459 @ text @d4 1 a4 1 BUILDING - Procedure for building NetBSD from source code. d130 7 d148 6 a153 4 if MAKEOBJDIRPREFIX is not defined. MAKEOBJDIR can be provided only in the environment or via the -O flag of build.sh; it cannot usefully be set inside a Makefile, including mk.conf or ${MAKECONF}. d164 6 a169 4 be read only. MAKEOBJDIRPREFIX can be provided only in the environment or via the -M flag of build.sh; it cannot usefully be set inside a Makefile, including mk.conf or ${MAKECONF}. d183 3 a185 1 environment or the make(1) configuration file specified by MAKECONF. a236 5 MAKECONF The name of the make(1) configuration file. Only settable in the process environment. Default: "/etc/mk.conf" d1135 2 a1136 2 make(1), hier(7), release(7), etcupdate(8), installboot(8), mount(8), postinstall(8), sysinst(8), pkgsrc/sysutils/cdrtools @ 1.148 log @build.sh, BUILDING: consistency improvements Consistently use "show", instead of sometimes using "display" or "print". Fix mdoc markup (even though BUILDING is raw text). Document help, -P, -? @ text @d160 9 d1127 1 a1127 1 make(1), hier(7), release(7), etcupdate(8), installboot(8), d1140 1 a1140 1 NetBSD May 16, 2023 NetBSD @ 1.147 log @BUILDING: update upstream, regen doc/BUILDING.mdoc is the upstream for BUILDING, so add recent changes in the latter to the former, formatting correctly. Move INSTALLBOOT_UBOOT_PATHS to Environment variables. Move INSTALLBOOT_BOARDS to "make" variables for full builds. Add installboot(8) cross-reference. @ text @d171 1 a171 1 part of the kernel version string, which can be printed by d228 1 a228 1 displayed. d232 1 a232 1 displayed. d235 2 a236 2 make(1) are displayed, even if they would ordinarily have been hidden through use of the "@@" prefix in the d556 1 a556 1 -n Display the commands that would have been executed, but do not d560 1 a560 1 -V var Print make(1)'s idea of the value of var. Does not build any d780 1 a780 1 it attempts to exec a suitable shell instead, or prints an error message. d809 2 d882 2 a883 2 list-arch Prints a list of valid MACHINE and MACHINE_ARCH settings, the default MACHINE_ARCH for each MACHINE, and aliases for d938 1 a938 1 -h Print a help message. d1023 3 d1068 2 d1093 1 a1093 1 directory that build.sh selects (and will display). d1105 1 a1105 1 RELEASEDIR directories that build.sh selects (and will display). d1131 1 a1131 1 NetBSD October 13, 2020 NetBSD @ 1.146 log @fix documentation for MKLINT Since share/mk/bsd.own.mk 1.749 from 2013-08-26, MKLINT defaults to no. @ text @d16 1 a16 1 the NetBSD build process. (See the environment variables section below d120 4 a159 12 INSTALLBOOT_BOARDS A list of boards to create bootable images for. If corresponding U-Boot packages are installed, bootable images are created as part of a release. See the -o "board=" option of installboot(8). INSTALLBOOT_UBOOT_PATHS A colon-separated list of search paths used by installboot to find U-Boot packages; see installboot(8). d469 6 d1111 2 a1112 2 make(1), hier(7), release(7), etcupdate(8), postinstall(8), sysinst(8), pkgsrc/sysutils/cdrtools @ 1.145 log @By default, do not install any bootable images. The previous commit introduced the ability to install a set of bootable images as a normal part of a release build. While this made it easy to install bootable images, the contents of a release build depend on whether or not U-Boot packages are installed in /usr/pkgsrc, which is the default location searched by installboot(8). This commit requires users to explicitly list the bootable images to be installed, which by default is none (i.e., prior behavior). @ text @d322 1 a322 1 Default: "yes" @ 1.144 log @Create bootable images in ${RELEASEDIR}/${RELEASEMACHINEDIR}/binary/gzimg. Release builds for arm platforms create compressed images in ${RELEASEDIR}/${RELEASEMACHINEDIR}/binary/gzimg. However, in some cases, e.g., armv7.img.gz, they are not bootable. Consequently, boot blocks must be manually installed in the images, which is an extra barrier for testing systems or adopting NetBSD. This has prompted creation of external repositories, e.g., armbsd.org, to host a collection of bootable images. However, this does not ease the burden on developers compiling their own systems; for them, manual installation of boot blocks is still required. For arm platforms, etc/etc.evbarm/Makefile.inc contains the commands used to create system images. Because installboot(8) can write boot blocks directly to system images, a loop through possible boards can create a series of bootable images during the normal build process. In the case of many arm platforms, installboot(8) uses U-Boot boot blocks, which are not part of the NetBSD source code. Developers can, however, install as many U-Boot boot blocks as desired, either in the default location of /usr/pkg/share/u-boot or in a set of directories pointed to by the U-Boot search path, the INSTALLBOOT_UBOOT_PATHS environment variable. For each board with an available boot block, a board-specific bootable image will be created in ${RELEASEDIR}/${RELEASEMACHINEDIR}/binary/gzimg. If a boot block is not available, which is the typical situation currently, no additional image will be created. This facility creates opportunities to build bootable images for any number of boards within the scope of a standard release build. However, that is not required and will not occur without the intervention of installing U-Boot boot blocks prior to the build. @ text @d156 7 d166 1 a166 3 installboot(8). If appropriate U-Boot packages are installed, bootable images are created as part of a release. @ 1.143 log @BUILDING: regen for removal of extsrc/ @ text @d156 7 @ 1.142 log @s/knowlege/knowledge/ @ text @a85 3 extsrc/ "Reachover" build structure for externally added programs and libraries; the source is in EXTSRCSRCDIR. a210 7 EXTSRCSRCDIR Directory containing sources of externally added programs and libraries. If specified, must be an absolute path. Default: NETBSDSRCDIR/../extsrc, if that exists; otherwise /usr/extsrc. a256 9 MKDEBUGKERNEL Can be set to "yes" or "no". Force generation of full-debug symbol versions of all kernels compiled. Alongside of the netbsd kernel file, an unstripped version netbsd.gdb is created. This is useful if a cross-gdb is built as well (see MKCROSSGDB). Default: "no" a262 7 MKDEBUGTOOLS Can be set to "yes" or "no". Indicates whether debug information (see MKDEBUG) should also be generated for all tools built. Default: "no" a268 5 MKEXTSRC Can be set to "yes" or "no". Indicates whether extsrc is built from EXTSRCSRCDIR. Default: "no" d292 8 a1049 7 -Y extsrcdir Set the value of EXTSRCSRCDIR to extsrcdir. If a relative path is specified, it will be converted to an absolute path before being used. -y Set MKEXTSRC=yes. @ 1.141 log @Rename: MKKDEBUG -> MKDEBUGKERNEL MKTOOLSDEBUG -> MKDEBUGTOOLS while keeping compatibility with the old names. Add missing documentation. Now all debugging tunables are prefixed with MKDEBUG. @ text @d32 1 a32 1 NetBSD make(1). Intended for expert use with knowlege of @ 1.140 log @Reintroduce the support of MKCATPAGES Requested by @ text @d267 9 d282 7 a322 8 MKKDEBUG Can be set to "yes" or "no". Force generation of full-debug symbol versions of all kernels compiled. Alongside of the netbsd kernel file, an unstripped version netbsd.gdb is created. This is useful if a cross-gdb is built as well (see MKCROSSGDB). Default: "no" @ 1.139 log @Remove the support for MKCATPAGES It was optional since 1999 and disabled by default since 2012. Proposed on tech-userlevel@@. @ text @d250 5 d388 3 a390 2 installed during a build. If set to "no", then all of MKDOC, MKINFO, MKMAN, and MKNLS will be set to "no" unconditionally. @ 1.138 log @Document CPUFLAGS here (it's already documented in share/mk/bsd.README). This will address the initial concern in PR port-alpha/55545. @ text @a249 5 MKCATPAGES Can be set to "yes" or "no". Indicates whether preformatted plaintext manual pages will be created during a build. Default: "no" d383 2 a384 3 installed during a build. If set to "no", then all of MKCATPAGES, MKDOC, MKINFO, MKMAN, and MKNLS will be set to "no" unconditionally. @ 1.137 log @Mention HOST_CFLAGS and HOST_CXXFLAGS. @ text @d195 5 @ 1.136 log @Bump date and regen for BUILDING.mdoc revision 1.127 that introduced build.sh -c option. @ text @d117 2 d121 2 d1131 1 a1131 1 NetBSD July 1, 2020 NetBSD @ 1.135 log @Fix a typo Reported by Tobias Ulmer via netbsd-docs@@ ML, thanks! @ text @d909 11 d1127 1 a1127 1 NetBSD July 29, 2018 NetBSD @ 1.134 log @regen @ text @d209 1 a209 1 Default: NETBSDRCDIR/../extsrc, if that exists; otherwise d464 1 a464 1 Default: NETBSDRCDIR/../xsrc, if that exists; otherwise @ 1.133 log @Re-add files that were accidentally deleted in my previous commit. @ text @d260 1 a260 1 libraries build. d292 3 a294 2 files, used for the documentation for most of the compilation tools, will be created and installed during a build. d1116 1 a1116 1 NetBSD October 21, 2017 NetBSD @ 1.133.2.1 log @Sync with HEAD @ text @d209 1 a209 1 Default: NETBSDSRCDIR/../extsrc, if that exists; otherwise d260 1 a260 1 libraries built. d292 2 a293 3 files will be created and installed during a build. GNU Info files are used for providing documentation by most of the compilation tools. d463 1 a463 1 Default: NETBSDSRCDIR/../xsrc, if that exists; otherwise d1115 1 a1115 1 NetBSD July 29, 2018 NetBSD @ 1.133.2.2 log @Sync with HEAD @ text @@ 1.133.2.3 log @Ooops, restore accidently removed files from merge mishap @ text @@ 1.132 log @Synch with HEAD @ text @@ 1.131 log @regen @ text @@ 1.131.2.1 log @Sync with HEAD Resolve a couple of conflicts (result of the uimin/uimax changes) @ text @d260 1 a260 1 libraries built. d292 2 a293 3 files will be created and installed during a build. GNU Info files are used for providing documentation by most of the compilation tools. d1115 1 a1115 1 NetBSD July 29, 2018 NetBSD @ 1.130 log @regen @ text @d880 1 a880 1 "build.sh -m 'evm*' -a '*arm*' list-arch" will list all @ 1.129 log @regen @ text @d343 2 a344 1 Default: "yes" @ 1.128 log @regen @ text @d32 3 a34 2 NetBSD make(1). (For building from out-of-date systems or on a non-native host, see the build.sh shell script.) d43 3 a45 2 instead of make(1) for any source tree that is updated and recompiled regularly. d343 1 a343 2 Default: Platform dependent. As of this writing, all platforms except sh3 default to "yes". d1114 1 a1114 1 NetBSD April 13, 2017 NetBSD @ 1.127 log @regen @ text @a248 8 MKCRYPTO Can be set to "yes" or "no". Indicates whether cryptographic code will be included in a build; provided for the benefit of countries that do not allow strong cryptography. Will not affect use of the standard low-security password encryption system, crypt(3). Default: "yes" @ 1.126 log @regen using regen target in doc. @ text @d720 5 a724 6 RELEASEDIR/RELEASEMACHINEDIR/installation/installimage directory. The installation disk image is suitable for copying to bootable USB flash memory sticks, etc., for machines which are able to boot from such devices. The file system in the bootable disk image will have a layout as described in release(7). @ 1.125 log @Introduce MKSTRIPSYM build option If it's yes, all local symbols of shared libraries are stripped (default). If it's no, only temporary local symbols are stripped; for example, symbols of static functions are kept. Keeping such symbols is useful on using DTrace for userland libraries and getting a backtrace from a rump server loading modules (shared libraries). Proposed and discussed on tech-kern and tech-toolchain @ text @d12 3 a14 3 This source tree contains a special subtree, ``tools'', which uses the host system to create a build toolchain for the target architecture. The host system must have at least C and C++ compilers in order to create the d48 3 a50 3 in bin through usr.sbin use the NetBSD make(1) ``reachover'' Makefile semantics when building these programs for a native host. d71 1 a71 1 tools/ ``Reachover'' build structure for the host build tools. d81 1 a81 1 ``Reachover'' build structure for modular Xorg; the source d84 2 a85 2 extsrc/ ``Reachover'' build structure for externally added programs and libraries; the source is in EXTSRCSRCDIR. d99 1 a99 1 ``local'' keyword to declare local variables in shell d105 2 a106 2 variant of ksh that supports the ``local'' keyword, such as ksh88, but not ksh93), or /usr/local/bin/bash. d117 1 a117 1 MACHINE Machine type, e.g., ``macppc''. d119 1 a119 1 MACHINE_ARCH Machine architecture, e.g., ``powerpc''. d165 1 a165 1 ``uname -v''. d174 3 a176 3 may contain backslash escape sequences, such as ``\\'' (representing a backslash character) and ``\n'' (representing a newline). d195 2 a196 2 an empty string, not to ``/''). The directory must reside on a file system which supports long file names and hard links. d198 1 a198 2 Default: Empty string if USETOOLS is ``yes''; unset otherwise. d213 1 a213 1 Default: ``/etc/mk.conf'' d231 1 a231 1 have been hidden through use of the ``@@'' prefix in the d235 1 a235 1 are traced through use of the sh(1) ``-x'' flag. d239 2 a240 3 MKCATPAGES Can be set to ``yes'' or ``no''. Indicates whether preformatted plaintext manual pages will be created during a build. d242 1 a242 1 Default: ``no'' d244 2 a245 2 MKCROSSGDB Can be set to ``yes'' or ``no''. Create a cross-gdb as a host tool. d247 1 a247 1 Default: ``no'' d249 5 a253 5 MKCRYPTO Can be set to ``yes'' or ``no''. Indicates whether cryptographic code will be included in a build; provided for the benefit of countries that do not allow strong cryptography. Will not affect use of the standard low- security password encryption system, crypt(3). d255 1 a255 1 Default: ``yes'' d257 1 a257 1 MKDEBUG Can be set to ``yes'' or ``no''. Indicates whether debug d262 1 a262 1 Default: ``no'' d264 1 a264 1 MKDEBUGLIB Can be set to ``yes'' or ``no''. Indicates whether debug d268 1 a268 1 Default: ``no'' d270 1 a270 1 MKDOC Can be set to ``yes'' or ``no''. Indicates whether system d274 1 a274 1 Default: ``yes'' d276 1 a276 1 MKEXTSRC Can be set to ``yes'' or ``no''. Indicates whether extsrc is d279 1 a279 1 Default: ``no'' d281 2 a282 2 MKHTML Can be set to ``yes'' or ``no''. Indicates whether preformatted HTML manual pages will be built and installed d284 1 a284 1 Default: ``yes'' d286 1 a286 1 MKHOSTOBJ Can be set to ``yes'' or ``no''. If set to ``yes'', then for d290 2 a291 2 ``make obj''. (This allows multiple host systems to compile NetBSD for a single target.) If set to ``no'', then programs d295 1 a295 1 Default: ``no'' d297 1 a297 1 MKINFO Can be set to ``yes'' or ``no''. Indicates whether GNU Info d301 1 a301 1 Default: ``yes'' d303 3 a305 3 MKKDEBUG Can be set to ``yes'' or ``no''. Force generation of full- debug symbol versions of all kernels compiled. Alongside of the netbsd kernel file, an unstripped version netbsd.gdb is d309 1 a309 1 Default: ``no'' d311 1 a311 1 MKKMOD Can be set to ``yes'' or ``no''. Indicates whether kernel d314 1 a314 1 Default: ``yes'' d316 3 a318 3 MKLINT Can be set to ``yes'' or ``no''. Indicates whether lint(1) will be run against portions of the NetBSD source code during the build, and whether lint libraries will be installed into d321 1 a321 1 Default: ``yes'' d323 2 a324 2 MKMAN Can be set to ``yes'' or ``no''. Indicates whether manual pages will be installed during a build. d326 1 a326 1 Default: ``yes'' d328 1 a328 1 MKNLS Can be set to ``yes'' or ``no''. Indicates whether Native d332 1 a332 1 Default: ``yes'' d334 4 a337 4 MKOBJ Can be set to ``yes'' or ``no''. Indicates whether object directories will be created when running ``make obj''. If set to ``no'', then all built files will be located inside the regular source tree. d339 1 a339 1 Default: ``yes'' d341 1 a341 1 Note that setting MKOBJ to ``no'' is not recommended and may d344 1 a344 1 MKPIC Can be set to ``yes'' or ``no''. Indicates whether shared d346 1 a346 1 build. If set to ``no'', the entire built system will be d350 1 a350 1 platforms except m68000 default to ``yes''. d353 1 a353 1 Can be set to ``yes'' or ``no''. Indicates whether the ar(1) d357 1 a357 1 Default: ``yes'' d359 1 a359 1 MKPROFILE Can be set to ``yes'' or ``no''. Indicates whether profiled d363 2 a364 2 Default: ``yes''; however, some platforms turn off MKPROFILE by default at times due to toolchain problems with profiled d367 1 a367 1 MKREPRO Can be set to ``yes'' or ``no''. Create reproducible builds. d371 2 a372 2 Default: ``no'' This may be set to ``yes'' by giving build.sh the -P option. d382 1 a382 1 MKSHARE Can be set to ``yes'' or ``no''. Indicates whether files d384 1 a384 1 installed during a build. If set to ``no'', then all of d386 1 a386 1 ``no'' unconditionally. d388 1 a388 1 Default: ``yes'' d391 3 a393 3 Can be set to ``yes'' or ``no''. Indicates whether RCS IDs, for use with ident(1), should be stripped from program binaries and shared libraries. d395 1 a395 1 Default: ``no'' d397 2 a398 2 MKSTRIPSYM Can be set to ``yes'' or ``no''. Indicates whether all local symbols should be stripped from shared libraries. If ``yes'', d400 3 a402 3 equivalent to -x option of ld(1). If ``no'', strip only temporary local symbols; the affect is equivalent to -X option of ld(1). Keeping non-temporary local symbols such as d407 1 a407 1 Default: ``yes'' d409 1 a409 1 MKUNPRIVED Can be set to ``yes'' or ``no''. Indicates whether an d417 1 a417 1 Default: ``no'' d419 4 a422 4 MKUPDATE Can be set to ``yes'' or ``no''. Indicates whether all install operations intended to write to DESTDIR will compare file timestamps before installing, and skip the install phase if the destination files are up-to-date. This also has d425 1 a425 1 Default: ``no'' d427 2 a428 2 MKX11 Can be set to ``yes'' or ``no''. Indicates whether X11 is built from X11SRCDIR. d430 1 a430 1 Default: ``no'' d443 2 a444 2 used as part of a build in progress. Must be set to ``yes'' if cross-compiling. d460 1 a460 1 Default: ``yes'', unless TOOLCHAIN_MISSING is set to ``yes''. d462 1 a462 1 USETOOLS is also set to ``no'' when using outside d473 1 a473 1 These variables only affect the top level ``Makefile'' and do not affect d476 1 a476 1 INSTALLWORLDDIR Location for the ``make installworld'' target to install d479 1 a479 1 Default: ``/'' d481 3 a483 3 MKOBJDIRS Can be set to ``yes'' or ``no''. Indicates whether object directories will be created automatically (via a ``make obj'' pass) at the start of a build. d485 1 a485 1 Default: ``no'' d487 2 a488 2 If using build.sh, the default is ``yes''. This may be set back to ``no'' by giving build.sh the -o option. d490 4 a493 4 MKUPDATE Can be set to ``yes'' or ``no''. If set, then in addition to the effects described for MKUPDATE=yes above, this implies the effects of NOCLEANDIR (i.e., ``make cleandir'' is avoided). d495 1 a495 1 Default: ``no'' d505 1 a505 1 NOCLEANDIR If set, avoids the ``make cleandir'' phase of a full d514 1 a514 1 NODISTRIBDIRS If set, avoids the ``make distrib-dirs'' phase of a full d522 1 a522 1 NOINCLUDES If set, avoids the ``make includes'' phase of a full d533 1 a533 1 layout will be written at the end of a ``make release''. d553 1 a553 1 ``share/mk'' directory in the source tree. This is set d571 2 a572 2 from the top level Makefile; as a specific exception, ``make obj'' and ``make cleandir'' are useful in that context. d579 1 a579 1 dependency files generated by ``make depend'', and any other d587 1 a587 1 dependall Does a ``make depend'' immediately followed by a ``make all''. d618 1 a618 1 distribution Do a ``make build'', and then install a full distribution d623 1 a623 1 buildworld As per ``make distribution'', except that it ensures that d633 3 a635 3 default, all sets except ``etc'' and ``xetc'' are installed, so most files in INSTALLWORLDDIR/etc will not be installed or modified. d646 2 a647 2 after ``make distribution'', as ``make build'' alone does not install all of the required files. d654 2 a655 2 after ``make distribution'', as ``make build'' alone does not install all of the required files. d657 3 a659 3 release Do a ``make distribution'', build kernels, distribution media, and install sets (this as per ``make sets''), and then package the system into a standard release layout as d674 2 a675 2 Before ``make iso-image'' is attempted, RELEASEDIR must be populated by ``make release'' or equivalent. d679 2 a680 2 directory by ``make release''. These smaller images usually contain the same tools as the larger images in d702 2 a703 2 Before ``make iso-image-source'' is attempted, RELEASEDIR must be populated by ``make sourcesets release'' or d708 2 a709 2 directory by ``make release''. These smaller images usually contain the same tools as the larger images in d733 4 a736 4 Before ``make install-image'' is attempted, RELEASEDIR must be populated by ``make release'' or equivalent. The build must have been performed with MKUNPRIVED=yes because ``make install-image'' relies on information in DESTDIR/METALOG. d749 4 a752 4 Before ``make live-image'' is attempted, RELEASEDIR must be populated by ``make release'' or equivalent. The build must have been performed with MKUNPRIVED=yes because ``make install-image'' relies on information in DESTDIR/METALOG. d756 4 a759 4 directory ``regress''. Runs those compiled regression tests on the local host. Note that most tests are now managed instead using atf(7); this target should probably run those as well but currently does not. d789 1 a789 1 should make use of build.sh rather than just running ``make''. This way, d791 1 a791 1 system has an older or incompatible ``make'' program. d800 4 a803 5 build Build the system as per ``make build''. Before the main part of the build commences, this command runs the obj operation (unless the -o option is given), ``make cleandir'' (unless the -u option is given), and the tools operation. d805 2 a806 2 distribution Build a full distribution as per ``make distribution''. This command first runs the build operation. d808 1 a808 1 release Build a full release as per ``make release''. This command d814 1 a814 1 cleandir Perform ``make cleandir''. d816 1 a816 1 obj Perform ``make obj''. d819 2 a820 2 command will first run ``make obj'' and ``make cleandir'' in the tools subdirectory unless the -o or -u options d823 4 a826 4 install=idir Install the contents of DESTDIR to idir, using ``make installworld''. Note that files that are part of the ``etc'' or ``xetc'' sets will not be installed, unless overridden by the INSTALLSETS environment variable. d840 1 a840 1 This command will run ``make cleandir'' on the kernel in d863 2 a864 2 netbsd-kconf.gz, although the ``netbsd'' prefix is determined from the ``config'' directives in kconf. d866 1 a866 1 sets Perform ``make sets''. d868 1 a868 1 sourcesets Perform ``make sourcesets''. d870 1 a870 1 syspkgs Perform ``make syspkgs''. d872 1 a872 1 iso-image Perform ``make iso-image''. d875 1 a875 1 Perform ``make iso-image-source''. d878 1 a878 1 Perform ``make install-image''. d880 1 a880 1 live-image Perform ``make live-image''. d887 1 a887 1 ``build.sh -m 'evm*' -a '*arm*' list-arch'' will list all d900 1 a900 1 build identifier to the name of the ``make'' wrapper script so d902 1 a902 1 ``nbmake-MACHINE-BUILDID''. d907 3 a909 3 the CD-ROM image that may be create by the ``iso-image'' or ``iso-image-source'' operations. Files will be added to the root of the CD-ROM image, whereas directories will be copied d939 2 a940 2 -M obj Set MAKEOBJDIRPREFIX to obj. Unsets MAKEOBJDIR. See ``-O obj'' for more information. d943 1 a943 1 ``-M /usr/obj'' will place build-time files under d950 1 a950 1 with a ``$'' (dollar sign) character; otherwise it would be too d970 2 a971 2 Set the ``noisyness'' level of the build, by setting MAKEVERBOSE to noiselevel. d974 1 a974 2 not make any changes. This is similar in concept to ``make -n''. d980 3 a982 3 For instance, a setting of ``-O /usr/obj'' will place build- time files under /usr/obj/bin, /usr/obj/lib, /usr/obj/usr.bin, and so forth. d987 1 a987 1 a ``$'' (dollar sign) character. If the directory does not d1000 1 a1000 1 out old files in the event the ``make cleandir'' operation is d1008 2 a1009 2 -o Set the value of MKOBJDIRS to ``no''. Otherwise, it will be automatically set to ``yes''. This default is opposite to the d1025 2 a1026 2 being used. If set, the bootstrap ``make'' will only be rebuilt if the source files for make(1) have changed. d1067 1 a1067 1 the up-to-date version of ``nbmake'' installed into TOOLDIR/bin with d1097 3 a1099 3 MKUPDATE=yes (-u) is set to prevent the ``make cleandir'', so that if this is run after example 2, it doesn't need to redo that portion of the release build. d1118 3 a1120 3 the ``make cleandir'' operation may be insufficient to clean out old files in object directories. Instead, one may have to manually remove the files. Consult the UPDATING file for notices concerning this. d1122 1 a1122 1 NetBSD February 20, 2017 NetBSD @ 1.124 log @regen @ text @d399 12 @ 1.123 log @The default values for MKPIC are yes and no for sh3 and m68000, respectively. Bump date. @ text @d369 1 a369 1 MKREPRO Can be set to ``yes'' or ``no''. Create reproducable builds. d373 2 a374 1 Default: ``no'' d380 3 a382 1 Default: Unset. d1114 1 a1114 1 NetBSD February 16, 2017 NetBSD @ 1.122 log @Document MKREPRO_TIMESTAMP. @ text @d352 1 a352 1 platforms except sh3 default to ``yes''. d1111 1 a1111 1 NetBSD January 29, 2016 NetBSD @ 1.122.4.1 log @Sync with HEAD @ text @d12 3 a14 3 This source tree contains a special subtree, "tools", which uses the host system to create a build toolchain for the target architecture. The host system must have at least C and C++ compilers in order to create the d48 3 a50 3 in bin through usr.sbin use the NetBSD make(1) "reachover" Makefile semantics when building these programs for a native host. d71 1 a71 1 tools/ "Reachover" build structure for the host build tools. d81 1 a81 1 "Reachover" build structure for modular Xorg; the source d84 2 a85 2 extsrc/ "Reachover" build structure for externally added programs and libraries; the source is in EXTSRCSRCDIR. d99 1 a99 1 "local" keyword to declare local variables in shell d105 2 a106 2 variant of ksh that supports the "local" keyword, such as ksh88, but not ksh93), or /usr/local/bin/bash. d117 1 a117 1 MACHINE Machine type, e.g., "macppc". d119 1 a119 1 MACHINE_ARCH Machine architecture, e.g., "powerpc". d165 1 a165 1 "uname -v". d174 3 a176 3 may contain backslash escape sequences, such as "\\" (representing a backslash character) and "\n" (representing a newline). d195 2 a196 2 an empty string, not to "/"). The directory must reside on a file system which supports long file names and hard links. d198 2 a199 1 Default: Empty string if USETOOLS is "yes"; unset otherwise. d214 1 a214 1 Default: "/etc/mk.conf" d232 1 a232 1 have been hidden through use of the "@@" prefix in the d236 1 a236 1 are traced through use of the sh(1) "-x" flag. d240 3 a242 2 MKCATPAGES Can be set to "yes" or "no". Indicates whether preformatted plaintext manual pages will be created during a build. d244 1 a244 1 Default: "no" d246 2 a247 2 MKCROSSGDB Can be set to "yes" or "no". Create a cross-gdb as a host tool. d249 1 a249 1 Default: "no" d251 5 a255 5 MKCRYPTO Can be set to "yes" or "no". Indicates whether cryptographic code will be included in a build; provided for the benefit of countries that do not allow strong cryptography. Will not affect use of the standard low-security password encryption system, crypt(3). d257 1 a257 1 Default: "yes" d259 1 a259 1 MKDEBUG Can be set to "yes" or "no". Indicates whether debug d264 1 a264 1 Default: "no" d266 1 a266 1 MKDEBUGLIB Can be set to "yes" or "no". Indicates whether debug d270 1 a270 1 Default: "no" d272 1 a272 1 MKDOC Can be set to "yes" or "no". Indicates whether system d276 1 a276 1 Default: "yes" d278 1 a278 1 MKEXTSRC Can be set to "yes" or "no". Indicates whether extsrc is d281 1 a281 1 Default: "no" d283 2 a284 2 MKHTML Can be set to "yes" or "no". Indicates whether preformatted HTML manual pages will be built and installed d286 1 a286 1 Default: "yes" d288 1 a288 1 MKHOSTOBJ Can be set to "yes" or "no". If set to "yes", then for d292 2 a293 2 "make obj". (This allows multiple host systems to compile NetBSD for a single target.) If set to "no", then programs d297 1 a297 1 Default: "no" d299 1 a299 1 MKINFO Can be set to "yes" or "no". Indicates whether GNU Info d303 1 a303 1 Default: "yes" d305 3 a307 3 MKKDEBUG Can be set to "yes" or "no". Force generation of full-debug symbol versions of all kernels compiled. Alongside of the netbsd kernel file, an unstripped version netbsd.gdb is d311 1 a311 1 Default: "no" d313 1 a313 1 MKKMOD Can be set to "yes" or "no". Indicates whether kernel d316 1 a316 1 Default: "yes" d318 3 a320 3 MKLINT Can be set to "yes" or "no". Indicates whether lint(1) will be run against portions of the NetBSD source code during the build, and whether lint libraries will be installed into d323 1 a323 1 Default: "yes" d325 2 a326 2 MKMAN Can be set to "yes" or "no". Indicates whether manual pages will be installed during a build. d328 1 a328 1 Default: "yes" d330 1 a330 1 MKNLS Can be set to "yes" or "no". Indicates whether Native d334 1 a334 1 Default: "yes" d336 4 a339 4 MKOBJ Can be set to "yes" or "no". Indicates whether object directories will be created when running "make obj". If set to "no", then all built files will be located inside the regular source tree. d341 1 a341 1 Default: "yes" d343 1 a343 1 Note that setting MKOBJ to "no" is not recommended and may d346 1 a346 1 MKPIC Can be set to "yes" or "no". Indicates whether shared d348 1 a348 1 build. If set to "no", the entire built system will be d352 1 a352 1 platforms except sh3 default to "yes". d355 1 a355 1 Can be set to "yes" or "no". Indicates whether the ar(1) d359 1 a359 1 Default: "yes" d361 1 a361 1 MKPROFILE Can be set to "yes" or "no". Indicates whether profiled d365 2 a366 2 Default: "yes"; however, some platforms turn off MKPROFILE by default at times due to toolchain problems with profiled d369 1 a369 1 MKREPRO Can be set to "yes" or "no". Create reproducible builds. d373 1 a373 2 Default: "no" This may be set to "yes" by giving build.sh the -P option. d379 1 a379 3 Default: Unset. This may be set automatically to the latest source tree timestamp using cvslatest(1) by giving build.sh the -P option. d381 1 a381 1 MKSHARE Can be set to "yes" or "no". Indicates whether files d383 1 a383 1 installed during a build. If set to "no", then all of d385 1 a385 1 "no" unconditionally. d387 1 a387 1 Default: "yes" d390 3 a392 15 Can be set to "yes" or "no". Indicates whether RCS IDs, for use with ident(1), should be stripped from program binaries and shared libraries. Default: "no" MKSTRIPSYM Can be set to "yes" or "no". Indicates whether all local symbols should be stripped from shared libraries. If "yes", strip all local symbols from shared libraries; the affect is equivalent to the -x option of ld(1). If "no", strip only temporary local symbols; the affect is equivalent to the -X option of ld(1). Keeping non-temporary local symbols such as static function names is useful on using DTrace for userland libraries and getting a backtrace from a rump kernel loading shared libraries. d394 1 a394 1 Default: "yes" d396 1 a396 1 MKUNPRIVED Can be set to "yes" or "no". Indicates whether an d404 1 a404 1 Default: "no" d406 4 a409 4 MKUPDATE Can be set to "yes" or "no". Indicates whether all install operations intended to write to DESTDIR will compare file timestamps before installing, and skip the install phase if the destination files are up-to-date. This also has d412 1 a412 1 Default: "no" d414 2 a415 2 MKX11 Can be set to "yes" or "no". Indicates whether X11 is built from X11SRCDIR. d417 1 a417 1 Default: "no" d430 2 a431 2 used as part of a build in progress. Must be set to "yes" if cross-compiling. d447 1 a447 1 Default: "yes", unless TOOLCHAIN_MISSING is set to "yes". d449 1 a449 1 USETOOLS is also set to "no" when using outside d460 1 a460 1 These variables only affect the top level "Makefile" and do not affect d463 1 a463 1 INSTALLWORLDDIR Location for the "make installworld" target to install d466 1 a466 1 Default: "/" d468 3 a470 3 MKOBJDIRS Can be set to "yes" or "no". Indicates whether object directories will be created automatically (via a "make obj" pass) at the start of a build. d472 1 a472 1 Default: "no" d474 2 a475 2 If using build.sh, the default is "yes". This may be set back to "no" by giving build.sh the -o option. d477 4 a480 4 MKUPDATE Can be set to "yes" or "no". If set, then in addition to the effects described for MKUPDATE=yes above, this implies the effects of NOCLEANDIR (i.e., "make cleandir" is avoided). d482 1 a482 1 Default: "no" d492 1 a492 1 NOCLEANDIR If set, avoids the "make cleandir" phase of a full d501 1 a501 1 NODISTRIBDIRS If set, avoids the "make distrib-dirs" phase of a full d509 1 a509 1 NOINCLUDES If set, avoids the "make includes" phase of a full d520 1 a520 1 layout will be written at the end of a "make release". d540 1 a540 1 "share/mk" directory in the source tree. This is set d558 2 a559 2 from the top level Makefile; as a specific exception, "make obj" and "make cleandir" are useful in that context. d566 1 a566 1 dependency files generated by "make depend", and any other d574 1 a574 1 dependall Does a "make depend" immediately followed by a "make all". d605 1 a605 1 distribution Do a "make build", and then install a full distribution d610 1 a610 1 buildworld As per "make distribution", except that it ensures that d620 3 a622 3 default, all sets except "etc" and "xetc" are installed, so most files in INSTALLWORLDDIR/etc will not be installed or modified. d633 2 a634 2 after "make distribution", as "make build" alone does not install all of the required files. d641 2 a642 2 after "make distribution", as "make build" alone does not install all of the required files. d644 3 a646 3 release Do a "make distribution", build kernels, distribution media, and install sets (this as per "make sets"), and then package the system into a standard release layout as d661 2 a662 2 Before "make iso-image" is attempted, RELEASEDIR must be populated by "make release" or equivalent. d666 2 a667 2 directory by "make release". These smaller images usually contain the same tools as the larger images in d689 2 a690 2 Before "make iso-image-source" is attempted, RELEASEDIR must be populated by "make sourcesets release" or d695 2 a696 2 directory by "make release". These smaller images usually contain the same tools as the larger images in d720 4 a723 4 Before "make install-image" is attempted, RELEASEDIR must be populated by "make release" or equivalent. The build must have been performed with MKUNPRIVED=yes because "make install-image" relies on information in DESTDIR/METALOG. d736 4 a739 4 Before "make live-image" is attempted, RELEASEDIR must be populated by "make release" or equivalent. The build must have been performed with MKUNPRIVED=yes because "make install-image" relies on information in DESTDIR/METALOG. d743 4 a746 4 directory "regress". Runs those compiled regression tests on the local host. Note that most tests are now managed instead using atf(7); this target should probably run those as well but currently does not. d776 1 a776 1 should make use of build.sh rather than just running "make". This way, d778 1 a778 1 system has an older or incompatible "make" program. d787 5 a791 4 build Build the system as per "make build". Before the main part of the build commences, this command runs the obj operation (unless the -o option is given), "make cleandir" (unless the -u option is given), and the tools operation. d793 2 a794 2 distribution Build a full distribution as per "make distribution". This command first runs the build operation. d796 1 a796 1 release Build a full release as per "make release". This command d802 1 a802 1 cleandir Perform "make cleandir". d804 1 a804 1 obj Perform "make obj". d807 2 a808 2 command will first run "make obj" and "make cleandir" in the tools subdirectory unless the -o or -u options d811 4 a814 4 install=idir Install the contents of DESTDIR to idir, using "make installworld". Note that files that are part of the "etc" or "xetc" sets will not be installed, unless overridden by the INSTALLSETS environment variable. d828 1 a828 1 This command will run "make cleandir" on the kernel in d851 2 a852 2 netbsd-kconf.gz, although the "netbsd" prefix is determined from the "config" directives in kconf. d854 1 a854 1 sets Perform "make sets". d856 1 a856 1 sourcesets Perform "make sourcesets". d858 1 a858 1 syspkgs Perform "make syspkgs". d860 1 a860 1 iso-image Perform "make iso-image". d863 1 a863 1 Perform "make iso-image-source". d866 1 a866 1 Perform "make install-image". d868 1 a868 1 live-image Perform "make live-image". d875 1 a875 1 "build.sh -m 'evm*' -a '*arm*' list-arch" will list all d888 1 a888 1 build identifier to the name of the "make" wrapper script so d890 1 a890 1 "nbmake-MACHINE-BUILDID". d895 3 a897 3 the CD-ROM image that may be create by the "iso-image" or "iso-image-source" operations. Files will be added to the root of the CD-ROM image, whereas directories will be copied d927 2 a928 2 -M obj Set MAKEOBJDIRPREFIX to obj. Unsets MAKEOBJDIR. See "-O obj" for more information. d931 1 a931 1 "-M /usr/obj" will place build-time files under d938 1 a938 1 with a "$" (dollar sign) character; otherwise it would be too d958 2 a959 2 Set the "noisyness" level of the build, by setting MAKEVERBOSE to noiselevel. d962 2 a963 1 not make any changes. This is similar in concept to "make -n". d969 3 a971 3 For instance, a setting of "-O /usr/obj" will place build-time files under /usr/obj/bin, /usr/obj/lib, /usr/obj/usr.bin, and so forth. d976 1 a976 1 a "$" (dollar sign) character. If the directory does not d989 1 a989 1 out old files in the event the "make cleandir" operation is d997 2 a998 2 -o Set the value of MKOBJDIRS to "no". Otherwise, it will be automatically set to "yes". This default is opposite to the d1014 2 a1015 2 being used. If set, the bootstrap "make" will only be rebuilt if the source files for make(1) have changed. d1056 1 a1056 1 the up-to-date version of "nbmake" installed into TOOLDIR/bin with d1086 3 a1088 3 MKUPDATE=yes (-u) is set to prevent the "make cleandir", so that if this is run after example 2, it doesn't need to redo that portion of the release build. d1107 3 a1109 3 the "make cleandir" operation may be insufficient to clean out old files in object directories. Instead, one may have to manually remove the files. Consult the UPDATING file for notices concerning this. d1111 1 a1111 1 NetBSD April 13, 2017 NetBSD @ 1.122.2.1 log @Sync with HEAD @ text @d352 1 a352 1 platforms except m68000 default to ``yes''. d369 1 a369 1 MKREPRO Can be set to ``yes'' or ``no''. Create reproducible builds. d373 1 a373 2 Default: ``no'' This may be set to ``yes'' by giving build.sh the -P option. d379 1 a379 3 Default: Unset. This may be set automatically to the latest source tree timestamp using cvslatest(1) by giving build.sh the -P option. d1111 1 a1111 1 NetBSD February 20, 2017 NetBSD @ 1.122.2.2 log @Sync with HEAD @ text @d12 3 a14 3 This source tree contains a special subtree, "tools", which uses the host system to create a build toolchain for the target architecture. The host system must have at least C and C++ compilers in order to create the d48 3 a50 3 in bin through usr.sbin use the NetBSD make(1) "reachover" Makefile semantics when building these programs for a native host. d71 1 a71 1 tools/ "Reachover" build structure for the host build tools. d81 1 a81 1 "Reachover" build structure for modular Xorg; the source d84 2 a85 2 extsrc/ "Reachover" build structure for externally added programs and libraries; the source is in EXTSRCSRCDIR. d99 1 a99 1 "local" keyword to declare local variables in shell d105 2 a106 2 variant of ksh that supports the "local" keyword, such as ksh88, but not ksh93), or /usr/local/bin/bash. d117 1 a117 1 MACHINE Machine type, e.g., "macppc". d119 1 a119 1 MACHINE_ARCH Machine architecture, e.g., "powerpc". d165 1 a165 1 "uname -v". d174 3 a176 3 may contain backslash escape sequences, such as "\\" (representing a backslash character) and "\n" (representing a newline). d195 2 a196 2 an empty string, not to "/"). The directory must reside on a file system which supports long file names and hard links. d198 2 a199 1 Default: Empty string if USETOOLS is "yes"; unset otherwise. d214 1 a214 1 Default: "/etc/mk.conf" d232 1 a232 1 have been hidden through use of the "@@" prefix in the d236 1 a236 1 are traced through use of the sh(1) "-x" flag. d240 3 a242 2 MKCATPAGES Can be set to "yes" or "no". Indicates whether preformatted plaintext manual pages will be created during a build. d244 1 a244 1 Default: "no" d246 2 a247 2 MKCROSSGDB Can be set to "yes" or "no". Create a cross-gdb as a host tool. d249 1 a249 1 Default: "no" d251 5 a255 5 MKCRYPTO Can be set to "yes" or "no". Indicates whether cryptographic code will be included in a build; provided for the benefit of countries that do not allow strong cryptography. Will not affect use of the standard low-security password encryption system, crypt(3). d257 1 a257 1 Default: "yes" d259 1 a259 1 MKDEBUG Can be set to "yes" or "no". Indicates whether debug d264 1 a264 1 Default: "no" d266 1 a266 1 MKDEBUGLIB Can be set to "yes" or "no". Indicates whether debug d270 1 a270 1 Default: "no" d272 1 a272 1 MKDOC Can be set to "yes" or "no". Indicates whether system d276 1 a276 1 Default: "yes" d278 1 a278 1 MKEXTSRC Can be set to "yes" or "no". Indicates whether extsrc is d281 1 a281 1 Default: "no" d283 2 a284 2 MKHTML Can be set to "yes" or "no". Indicates whether preformatted HTML manual pages will be built and installed d286 1 a286 1 Default: "yes" d288 1 a288 1 MKHOSTOBJ Can be set to "yes" or "no". If set to "yes", then for d292 2 a293 2 "make obj". (This allows multiple host systems to compile NetBSD for a single target.) If set to "no", then programs d297 1 a297 1 Default: "no" d299 1 a299 1 MKINFO Can be set to "yes" or "no". Indicates whether GNU Info d303 1 a303 1 Default: "yes" d305 3 a307 3 MKKDEBUG Can be set to "yes" or "no". Force generation of full-debug symbol versions of all kernels compiled. Alongside of the netbsd kernel file, an unstripped version netbsd.gdb is d311 1 a311 1 Default: "no" d313 1 a313 1 MKKMOD Can be set to "yes" or "no". Indicates whether kernel d316 1 a316 1 Default: "yes" d318 3 a320 3 MKLINT Can be set to "yes" or "no". Indicates whether lint(1) will be run against portions of the NetBSD source code during the build, and whether lint libraries will be installed into d323 1 a323 1 Default: "yes" d325 2 a326 2 MKMAN Can be set to "yes" or "no". Indicates whether manual pages will be installed during a build. d328 1 a328 1 Default: "yes" d330 1 a330 1 MKNLS Can be set to "yes" or "no". Indicates whether Native d334 1 a334 1 Default: "yes" d336 4 a339 4 MKOBJ Can be set to "yes" or "no". Indicates whether object directories will be created when running "make obj". If set to "no", then all built files will be located inside the regular source tree. d341 1 a341 1 Default: "yes" d343 1 a343 1 Note that setting MKOBJ to "no" is not recommended and may d346 1 a346 1 MKPIC Can be set to "yes" or "no". Indicates whether shared d348 1 a348 1 build. If set to "no", the entire built system will be d352 1 a352 1 platforms except sh3 default to "yes". d355 1 a355 1 Can be set to "yes" or "no". Indicates whether the ar(1) d359 1 a359 1 Default: "yes" d361 1 a361 1 MKPROFILE Can be set to "yes" or "no". Indicates whether profiled d365 2 a366 2 Default: "yes"; however, some platforms turn off MKPROFILE by default at times due to toolchain problems with profiled d369 1 a369 1 MKREPRO Can be set to "yes" or "no". Create reproducible builds. d373 2 a374 2 Default: "no" This may be set to "yes" by giving build.sh the -P option. d384 1 a384 1 MKSHARE Can be set to "yes" or "no". Indicates whether files d386 1 a386 1 installed during a build. If set to "no", then all of d388 1 a388 1 "no" unconditionally. d390 1 a390 1 Default: "yes" d393 3 a395 15 Can be set to "yes" or "no". Indicates whether RCS IDs, for use with ident(1), should be stripped from program binaries and shared libraries. Default: "no" MKSTRIPSYM Can be set to "yes" or "no". Indicates whether all local symbols should be stripped from shared libraries. If "yes", strip all local symbols from shared libraries; the affect is equivalent to the -x option of ld(1). If "no", strip only temporary local symbols; the affect is equivalent to the -X option of ld(1). Keeping non-temporary local symbols such as static function names is useful on using DTrace for userland libraries and getting a backtrace from a rump kernel loading shared libraries. d397 1 a397 1 Default: "yes" d399 1 a399 1 MKUNPRIVED Can be set to "yes" or "no". Indicates whether an d407 1 a407 1 Default: "no" d409 4 a412 4 MKUPDATE Can be set to "yes" or "no". Indicates whether all install operations intended to write to DESTDIR will compare file timestamps before installing, and skip the install phase if the destination files are up-to-date. This also has d415 1 a415 1 Default: "no" d417 2 a418 2 MKX11 Can be set to "yes" or "no". Indicates whether X11 is built from X11SRCDIR. d420 1 a420 1 Default: "no" d433 2 a434 2 used as part of a build in progress. Must be set to "yes" if cross-compiling. d450 1 a450 1 Default: "yes", unless TOOLCHAIN_MISSING is set to "yes". d452 1 a452 1 USETOOLS is also set to "no" when using outside d463 1 a463 1 These variables only affect the top level "Makefile" and do not affect d466 1 a466 1 INSTALLWORLDDIR Location for the "make installworld" target to install d469 1 a469 1 Default: "/" d471 3 a473 3 MKOBJDIRS Can be set to "yes" or "no". Indicates whether object directories will be created automatically (via a "make obj" pass) at the start of a build. d475 1 a475 1 Default: "no" d477 2 a478 2 If using build.sh, the default is "yes". This may be set back to "no" by giving build.sh the -o option. d480 4 a483 4 MKUPDATE Can be set to "yes" or "no". If set, then in addition to the effects described for MKUPDATE=yes above, this implies the effects of NOCLEANDIR (i.e., "make cleandir" is avoided). d485 1 a485 1 Default: "no" d495 1 a495 1 NOCLEANDIR If set, avoids the "make cleandir" phase of a full d504 1 a504 1 NODISTRIBDIRS If set, avoids the "make distrib-dirs" phase of a full d512 1 a512 1 NOINCLUDES If set, avoids the "make includes" phase of a full d523 1 a523 1 layout will be written at the end of a "make release". d543 1 a543 1 "share/mk" directory in the source tree. This is set d561 2 a562 2 from the top level Makefile; as a specific exception, "make obj" and "make cleandir" are useful in that context. d569 1 a569 1 dependency files generated by "make depend", and any other d577 1 a577 1 dependall Does a "make depend" immediately followed by a "make all". d608 1 a608 1 distribution Do a "make build", and then install a full distribution d613 1 a613 1 buildworld As per "make distribution", except that it ensures that d623 3 a625 3 default, all sets except "etc" and "xetc" are installed, so most files in INSTALLWORLDDIR/etc will not be installed or modified. d636 2 a637 2 after "make distribution", as "make build" alone does not install all of the required files. d644 2 a645 2 after "make distribution", as "make build" alone does not install all of the required files. d647 3 a649 3 release Do a "make distribution", build kernels, distribution media, and install sets (this as per "make sets"), and then package the system into a standard release layout as d664 2 a665 2 Before "make iso-image" is attempted, RELEASEDIR must be populated by "make release" or equivalent. d669 2 a670 2 directory by "make release". These smaller images usually contain the same tools as the larger images in d692 2 a693 2 Before "make iso-image-source" is attempted, RELEASEDIR must be populated by "make sourcesets release" or d698 2 a699 2 directory by "make release". These smaller images usually contain the same tools as the larger images in d710 6 a715 5 RELEASEDIR/images directory. The installation disk image is suitable for copying to bootable USB flash memory sticks, etc., for machines which are able to boot from such devices. The file system in the bootable disk image will have a layout as described in release(7). d723 4 a726 4 Before "make install-image" is attempted, RELEASEDIR must be populated by "make release" or equivalent. The build must have been performed with MKUNPRIVED=yes because "make install-image" relies on information in DESTDIR/METALOG. d739 4 a742 4 Before "make live-image" is attempted, RELEASEDIR must be populated by "make release" or equivalent. The build must have been performed with MKUNPRIVED=yes because "make install-image" relies on information in DESTDIR/METALOG. d746 4 a749 4 directory "regress". Runs those compiled regression tests on the local host. Note that most tests are now managed instead using atf(7); this target should probably run those as well but currently does not. d779 1 a779 1 should make use of build.sh rather than just running "make". This way, d781 1 a781 1 system has an older or incompatible "make" program. d790 5 a794 4 build Build the system as per "make build". Before the main part of the build commences, this command runs the obj operation (unless the -o option is given), "make cleandir" (unless the -u option is given), and the tools operation. d796 2 a797 2 distribution Build a full distribution as per "make distribution". This command first runs the build operation. d799 1 a799 1 release Build a full release as per "make release". This command d805 1 a805 1 cleandir Perform "make cleandir". d807 1 a807 1 obj Perform "make obj". d810 2 a811 2 command will first run "make obj" and "make cleandir" in the tools subdirectory unless the -o or -u options d814 4 a817 4 install=idir Install the contents of DESTDIR to idir, using "make installworld". Note that files that are part of the "etc" or "xetc" sets will not be installed, unless overridden by the INSTALLSETS environment variable. d831 1 a831 1 This command will run "make cleandir" on the kernel in d854 2 a855 2 netbsd-kconf.gz, although the "netbsd" prefix is determined from the "config" directives in kconf. d857 1 a857 1 sets Perform "make sets". d859 1 a859 1 sourcesets Perform "make sourcesets". d861 1 a861 1 syspkgs Perform "make syspkgs". d863 1 a863 1 iso-image Perform "make iso-image". d866 1 a866 1 Perform "make iso-image-source". d869 1 a869 1 Perform "make install-image". d871 1 a871 1 live-image Perform "make live-image". d878 1 a878 1 "build.sh -m 'evm*' -a '*arm*' list-arch" will list all d891 1 a891 1 build identifier to the name of the "make" wrapper script so d893 1 a893 1 "nbmake-MACHINE-BUILDID". d898 3 a900 3 the CD-ROM image that may be create by the "iso-image" or "iso-image-source" operations. Files will be added to the root of the CD-ROM image, whereas directories will be copied d930 2 a931 2 -M obj Set MAKEOBJDIRPREFIX to obj. Unsets MAKEOBJDIR. See "-O obj" for more information. d934 1 a934 1 "-M /usr/obj" will place build-time files under d941 1 a941 1 with a "$" (dollar sign) character; otherwise it would be too d961 2 a962 2 Set the "noisyness" level of the build, by setting MAKEVERBOSE to noiselevel. d965 2 a966 1 not make any changes. This is similar in concept to "make -n". d972 3 a974 3 For instance, a setting of "-O /usr/obj" will place build-time files under /usr/obj/bin, /usr/obj/lib, /usr/obj/usr.bin, and so forth. d979 1 a979 1 a "$" (dollar sign) character. If the directory does not d992 1 a992 1 out old files in the event the "make cleandir" operation is d1000 2 a1001 2 -o Set the value of MKOBJDIRS to "no". Otherwise, it will be automatically set to "yes". This default is opposite to the d1017 2 a1018 2 being used. If set, the bootstrap "make" will only be rebuilt if the source files for make(1) have changed. d1059 1 a1059 1 the up-to-date version of "nbmake" installed into TOOLDIR/bin with d1089 3 a1091 3 MKUPDATE=yes (-u) is set to prevent the "make cleandir", so that if this is run after example 2, it doesn't need to redo that portion of the release build. d1110 3 a1112 3 the "make cleandir" operation may be insufficient to clean out old files in object directories. Instead, one may have to manually remove the files. Consult the UPDATING file for notices concerning this. d1114 1 a1114 1 NetBSD April 13, 2017 NetBSD @ 1.121 log @remove the xfree86 reachover makefiles and the vast majority of the support in the rest of the source tree. X11 sets could use some cleaning up perhaps (just deletion, as we've never really marked the old X11R6 as obsolete for native xorg using platforms so far either.) @ text @d4 1 a4 1 BUILDING -- Procedure for building NetBSD from source code. d375 6 d1111 1 a1111 1 NetBSD April 7, 2015 NetBSD @ 1.120 log @Update to reflect changes made in rev 1.398 of src/etc/Makefile @ text @d80 3 a82 2 x11/ ``Reachover'' build structure for X11R6; the source is in X11SRCDIR. d446 3 a448 3 X11SRCDIR Directory containing the X11R6 source. If specified, must be an absolute path. The main X11R6 source is found in X11SRCDIR/xfree/xc. a452 6 X11FLAVOUR The style of X11 cross-built, set to either ``Xorg'' or ``XFree86''. Default: ``XFree86'' on acorn32, alpha, amiga, mac68k, pmax, and sun3 platforms, ``Xorg'' on everything else. @ 1.119 log @regen @ text @d724 1 a724 2 live-image Create NetBSD live images in the RELEASEDIR/RELEASEMACHINEDIR/installation/liveimage @ 1.118 log @regen @ text @d455 2 a456 2 Default: ``Xorg'' on amd64, i386, macppc, shark and sparc64 platforms, ``XFree86'' on everything else. d1111 1 a1111 1 NetBSD August 7, 2014 NetBSD @ 1.117 log @regen @ text @a837 5 mkernel=kconf Build a new kernel in modular build. Similar to the above kernel=kconf operation, but creates intermediate per-module relocatable objects and link them to the final kernel. a843 3 mkernels Similar to the above kernels operation, but builds kernels in modular build. @ 1.116 log @regen @ text @d849 3 @ 1.115 log @regen from doc/BUILDING.mdoc revision 1.107. This reinstates documentation for "extsrc" which was lost in 2009. @ text @d838 5 @ 1.114 log @fourth time's the charm, i guess. when committing a generated file, it's best to use the latest revision of the source file (hi uebs!) regen to include changes from revision 1.105 of doc/BUILDING.mdoc @ text @d83 3 d203 7 d277 5 d1040 7 @ 1.113 log @regen @ text @d635 2 a636 2 RELEASEDIR/iso directory. The CD-ROM file system will have a layout as described in release(7). d652 2 a653 2 RELEASEDIR/iso, but do not contain additional content such as the distribution sets. d662 2 a663 2 RELEASEDIR/iso directory. The CD-ROM file system will have a layout as described in release(7). It will have top d681 2 a682 2 RELEASEDIR/iso, but do not contain additional content such as the distribution sets. @ 1.112 log @Expand TABs. @ text @d635 2 a636 2 RELEASEDIR/images directory. The CD-ROM file system will have a layout as described in release(7). d652 2 a653 2 RELEASEDIR/images, but do not contain additional content such as the distribution sets. d662 2 a663 2 RELEASEDIR/images directory. The CD-ROM file system will have a layout as described in release(7). It will have top d681 2 a682 2 RELEASEDIR/images, but do not contain additional content such as the distribution sets. d823 2 a824 2 kernels This command will build all kernels defined in port specific release build procedure. @ 1.111 log @Document the new "kernels" operation, prompted by joerg@@. @ text @d826 2 a827 2 This command internally calls the kernel=kconf operation for each found kernel configuration file. @ 1.110 log @regen @ text @d823 6 @ 1.109 log @regen BUILDING from doc/BUILDING.mdoc @ text @d635 2 a636 2 RELEASEDIR/iso directory. The CD-ROM file system will have a layout as described in release(7). d652 2 a653 2 RELEASEDIR/iso, but do not contain additional content such as the distribution sets. d662 2 a663 2 RELEASEDIR/iso directory. The CD-ROM file system will have a layout as described in release(7). It will have top d681 2 a682 2 RELEASEDIR/iso, but do not contain additional content such as the distribution sets. @ 1.109.2.1 log @Pull up following revision(s) (requested by snj in ticket #227): Makefile: revision 1.311 build.sh: revision 1.299 doc/BUILDING.mdoc: revision 1.105 distrib/notes/macppc/prep.OPENFIRMWARE: revision 1.16 distrib/notes/macppc/prep.OPENFIRMWARE: revision 1.17 BUILDING: revision 1.110 distrib/notes/arc/prep: revision 1.3 distrib/notes/arc/prep: revision 1.4 distrib/notes/cats/prep: revision 1.12 distrib/notes/cats/prep: revision 1.13 distrib/notes/sparc/install: revision 1.58 distrib/notes/common/main: revision 1.512 share/man/man8/man8.macppc/ofwboot.8: revision 1.13 Update path to release ISOs. @ text @d635 2 a636 2 RELEASEDIR/images directory. The CD-ROM file system will have a layout as described in release(7). d652 2 a653 2 RELEASEDIR/images, but do not contain additional content such as the distribution sets. d662 2 a663 2 RELEASEDIR/images directory. The CD-ROM file system will have a layout as described in release(7). It will have top d681 2 a682 2 RELEASEDIR/images, but do not contain additional content such as the distribution sets. @ 1.108 log @BUILDINFO part6: regen BUILDING from doc/BUILDING.mdoc @ text @d849 10 d862 2 a863 1 -a arch Set the value of MACHINE_ARCH to arch. d922 13 a934 24 -m mach Set the value of MACHINE to mach, except in some special cases listed below. This will also override any value of MACHINE_ARCH in the process environment with a value deduced from mach, unless -a is specified. All cross builds require -m, but if unset on a NetBSD host, the host's value of MACHINE will be detected and used automatically. Some machines support multiple values for MACHINE_ARCH. The following special cases for the mach argument are defined to set the listed values of MACHINE and MACHINE_ARCH: mach MACHINE MACHINE_ARCH evbarm evbarm (not set) evbarm-eb evbarm armeb evbarm-el evbarm arm evbmips evbmips (not set) evbmips-eb evbmips mipseb evbmips-el evbmips mipsel evbsh3 evbsh3 (not set) evbsh3-eb evbsh3 sh3eb evbsh3-el evbsh3 sh3el sbmips sbmips (not set) sbmips-eb sbmips mipseb sbmips-el sbmips mipsel d966 10 d1077 7 a1083 1 NetBSD August 3, 2014 NetBSD @ 1.107 log @Regen from doc/BUILDING.mdoc;1.100: Improve documentation for BUILDID. @ text @d165 11 d1067 1 a1067 1 NetBSD June 14, 2014 NetBSD @ 1.106 log @regen @ text @d154 4 a157 2 BUILDID Identifier for the build. The identifier will be appended to object directory names, and can be consulted in the make(1) d159 5 a163 1 parameters, such as compiler flags. d1056 1 a1056 1 NetBSD November 8, 2012 NetBSD @ 1.105 log @regen using 'make regen' from src/doc. @ text @d52 6 d218 5 d231 13 d272 8 d799 7 d879 1 a879 1 -obj'' for more information. @ 1.105.4.1 log @Rebase. @ text @a51 6 external, sys/external Sources and build infrastructure for components imported (mostly) unchanged from upstream maintainers, sorted by applicable license. This is (slowly) replacing the crypto/dist, dist, and gnu/dist directories. d148 2 a149 4 BUILDID Identifier for the build. If set, this should be a short string that is suitable for use as part of a file or directory name. The identifier will be appended to object directory names, and can be consulted in the make(1) d151 1 a151 16 parameters, such as compiler flags. It will also be used as part of the kernel version string, which can be printed by ``uname -v''. Default: Unset. BUILDINFO This may be a multi-line string containing information about the build. This will appear in DESTDIR/etc/release, and it will be stored in the buildinfo variable in any kernels that are built. When such kernels are booted, the sysctl(7) kern.buildinfo variable will report this value. The string may contain backslash escape sequences, such as ``\\'' (representing a backslash character) and ``\n'' (representing a newline). Default: Unset. a211 5 MKCROSSGDB Can be set to ``yes'' or ``no''. Create a cross-gdb as a host tool. Default: ``no'' a219 13 MKDEBUG Can be set to ``yes'' or ``no''. Indicates whether debug information should be generated for all userland binaries compiled. The result is collected as an additional debug.tgz and xdebug.tgz set and installed in /usr/libdata/debug. Default: ``no'' MKDEBUGLIB Can be set to ``yes'' or ``no''. Indicates whether debug information (see MKDEBUG) should also be generated for all libraries build. Default: ``no'' a247 8 MKKDEBUG Can be set to ``yes'' or ``no''. Force generation of full- debug symbol versions of all kernels compiled. Alongside of the netbsd kernel file, an unstripped version netbsd.gdb is created. This is useful if a cross-gdb is built as well (see MKCROSSGDB). Default: ``no'' a766 7 kernel.gdb=kconf Build a new kernel with debug information. Similar to the above kernel=kconf operation, but creates a netbsd.gdb file alongside of the kernel netbsd, which contains a full symbol table and can be used for debugging (for example with a cross-gdb built by MKCROSSGDB). a792 10 list-arch Prints a list of valid MACHINE and MACHINE_ARCH settings, the default MACHINE_ARCH for each MACHINE, and aliases for MACHINE/MACHINE_ARCH pairs, and then exits. The -m or -a options (or both) may be used to specify glob patterns that will be used to narrow the list of results; for example, ``build.sh -m 'evm*' -a '*arm*' list-arch'' will list all known MACHINE/MACHINE_ARCH values in which either MACHINE or ALIAS matches the pattern `evb*', and MACHINE_ARCH matches the pattern `*arm*'. d796 1 a796 2 -a arch Set the value of MACHINE_ARCH to arch. See the -m option for more information. d840 1 a840 1 obj'' for more information. d855 24 a878 13 -m mach Set the value of MACHINE to mach, unless the mach argument is an alias that refers to a MACHINE/MACHINE_ARCH pair, in which case both MACHINE and MACHINE_ARCH are set from the alias. Such aliases are interpreted entirely by build.sh; they are not used by any other part of the build system. The MACHINE_ARCH setting implied by mach will override any value of MACHINE_ARCH in the process environment, but will not override a value set by the -a option. All cross builds require -m, but if unset on a NetBSD host, the host's value of MACHINE will be detected and used automatically. See the list-arch operation for a way to get a list of valid MACHINE and MACHINE_ARCH settings. a909 10 Note that placing the obj directory location outside of the default source tree hierarchy makes it easier to manually clear out old files in the event the ``make cleandir'' operation is unable to do so. (See CAVEATS below.) Note also that use of one of -M or -O is the only means of building multiple machine architecture userlands from the same source tree without cleaning between builds (in which case, one would specify distinct obj locations for each). d1011 1 a1011 7 CAVEATS After significant updates to third-party components in the source tree, the ``make cleandir'' operation may be insufficient to clean out old files in object directories. Instead, one may have to manually remove the files. Consult the UPDATING file for notices concerning this. NetBSD August 7, 2014 NetBSD @ 1.104 log @regen (using mandoc doc/BUILDING.mdoc > BUILDING -- let me know if a different way is preferred, I see that it now contains formatting). @ text @d3 2 a4 2 NNAAMMEE BBUUIILLDDIINNGG -- Procedure for building NetBSD from source code. d6 1 a6 1 RREEQQUUIIRREEMMEENNTTSS d8 2 a9 2 The basic build procedure is the same whether compiling _n_a_t_i_v_e_l_y (on the same NetBSD architecture) or _c_r_o_s_s _c_o_m_p_i_l_i_n_g (on another architecture or d15 1 a15 1 toolchain (mmaakkee is not required); all other tools are created as part of d19 3 a21 3 FFIILLEESS SSoouurrccee ttrreeee llaayyoouutt ddoocc//BBUUIILLDDIINNGG..mmddoocc d24 1 a24 1 BBUUIILLDDIINNGG This document (in plaintext). d26 1 a26 1 ttoooollss//ccoommppaatt//RREEAADDMMEE d30 1 a30 1 MMaakkeeffiillee The main Makefile for NetBSD; should only be run for d33 1 a33 1 on a non-native host, see the bbuuiilldd..sshh shell script.) d35 1 a35 1 UUPPDDAATTIINNGG Special notes for updating from an earlier revision of d39 1 a39 1 bbuuiilldd..sshh Bourne-compatible shell script used for building the host d45 1 a45 1 ccrryyppttoo//ddiisstt//, ddiisstt//, ggnnuu//ddiisstt// d48 1 a48 1 in bbiinn through uussrr..ssbbiinn use the NetBSD make(1) d52 1 a52 1 ddiissttrriibb//, eettcc// d54 1 a54 1 snapshot, such as files installed in DDEESSTTDDIIRR_/_e_t_c on the d57 1 a57 1 tteessttss//, rreeggrreessss// d59 2 a60 2 run natively. _t_e_s_t_s_/ uses the atf(7) test framework; _r_e_g_r_e_s_s_/ contains older tests that have not yet been d63 1 a63 1 ssyyss// NetBSD kernel sources. d65 1 a65 1 ttoooollss// ``Reachover'' build structure for the host build tools. d69 1 a69 1 bbiinn// ...... uussrr..ssbbiinn// d74 2 a75 2 xx1111// ``Reachover'' build structure for X11R6; the source is in XX1111SSRRCCDDIIRR. d77 1 a77 1 BBuuiilldd ttrreeee llaayyoouutt d81 2 a82 2 CCOONNFFIIGGUURRAATTIIOONN EEnnvviirroonnmmeenntt vvaarriiaabblleess d85 1 a85 1 HHOOSSTT__SSHH Path name to a shell available on the host system and d94 1 a94 1 _/_b_i_n_/_s_h, _/_u_s_r_/_x_p_g_4_/_b_i_n_/_s_h, _/_b_i_n_/_k_s_h (provided it is a d96 1 a96 1 such as ksh88, but not ksh93), or _/_u_s_r_/_l_o_c_a_l_/_b_i_n_/_b_a_s_h. d98 2 a99 2 Most parts of the build require HHOOSSTT__SSHH to be an absolute path; however, bbuuiilldd..sshh allows it to be a d101 1 a101 1 absolute path by searching the PPAATTHH. d103 1 a103 1 HHOOSSTT__CCCC Path name to C compiler used to create the toolchain. d105 1 a105 1 HHOOSSTT__CCXXXX Path name to C++ compiler used to create the toolchain. d107 1 a107 1 MMAACCHHIINNEE Machine type, e.g., ``macppc''. d109 1 a109 1 MMAACCHHIINNEE__AARRCCHH Machine architecture, e.g., ``powerpc''. d111 1 a111 1 MMAAKKEE Path name to invoke make(1) as. d113 3 a115 3 MMAAKKEEFFLLAAGGSS Flags to invoke make(1) with. Note that bbuuiilldd..sshh ignores the value of MMAAKKEEFFLLAAGGSS passed in the environment, but allows MMAAKKEEFFLLAAGGSS to be set via the --VV d118 1 a118 1 MMAAKKEEOOBBJJDDIIRR Directory to use as the ..OOBBJJDDIIRR for the current d123 5 a127 5 value of ..OOBBJJDDIIRR from the value of ..CCUURRDDIIRR. Used only if MMAAKKEEOOBBJJDDIIRRPPRREEFFIIXX is not defined. MMAAKKEEOOBBJJDDIIRR can be provided only in the environment or via the --OO flag of bbuuiilldd..sshh; it cannot usefully be set inside a Makefile, including _m_k_._c_o_n_f or $${{MMAAKKEECCOONNFF}}. d129 1 a129 1 MMAAKKEEOOBBJJDDIIRRPPRREEFFIIXX Top level directory of the object directory tree. The d131 2 a132 2 bbuuiilldd..sshh will create the ${MAKEOBJDIRPREFIX} directory if necessary, but if make(1) is used without bbuuiilldd..sshh, d136 1 a136 1 ${MAKEOBJDIRPREFIX}/${.CURDIR} is used as the ..OOBBJJDDIIRR d138 2 a139 2 be read only. MMAAKKEEOOBBJJDDIIRRPPRREEFFIIXX can be provided only in the environment or via the --MM flag of bbuuiilldd..sshh; it d141 1 a141 1 _m_k_._c_o_n_f or $${{MMAAKKEECCOONNFF}}. d143 1 a143 1 ""mmaakkee"" vvaarriiaabblleess d146 1 a146 1 environment or the make(1) configuration file specified by MMAAKKEECCOONNFF. d148 1 a148 1 BBUUIILLDDIIDD Identifier for the build. The identifier will be appended to d153 1 a153 1 BBUUIILLDDSSEEEEDD GCC uses random numbers when compiling C++ code. This d162 1 a162 1 DDEESSTTDDIIRR Directory to contain the built NetBSD system. If set, d164 4 a167 4 prevent their default use of the host system's //uussrr//iinncclluuddee, //uussrr//lliibb, and so forth. This pathname must be an absolute path, and should _n_o_t end with a slash (/) character. (For installation into the system's root directory, set DDEESSTTDDIIRR to d171 1 a171 1 _D_e_f_a_u_l_t: Empty string if UUSSEETTOOOOLLSS is ``yes''; unset d174 2 a175 2 _N_o_t_e: bbuuiilldd..sshh will provide a default of _d_e_s_t_d_i_r_.MMAACCHHIINNEE (in the top-level ..OOBBJJDDIIRR) unless run in `expert' mode. d177 2 a178 2 MMAAKKEECCOONNFF The name of the make(1) configuration file. _O_n_l_y _s_e_t_t_a_b_l_e _i_n _t_h_e _p_r_o_c_e_s_s _e_n_v_i_r_o_n_m_e_n_t_. d180 1 a180 1 _D_e_f_a_u_l_t: ``/etc/mk.conf'' d182 1 a182 1 MMAAKKEEVVEERRBBOOSSEE d202 1 a202 1 are traced through use of the sh(1) ``--xx'' flag. d204 1 a204 1 _D_e_f_a_u_l_t: 2 d206 1 a206 1 MMKKCCAATTPPAAGGEESS Can be set to ``yes'' or ``no''. Indicates whether d210 1 a210 1 _D_e_f_a_u_l_t: ``no'' d212 1 a212 1 MMKKCCRRYYPPTTOO Can be set to ``yes'' or ``no''. Indicates whether d218 1 a218 1 _D_e_f_a_u_l_t: ``yes'' d220 2 a221 2 MMKKDDOOCC Can be set to ``yes'' or ``no''. Indicates whether system documentation destined for DDEESSTTDDIIRR_/_u_s_r_/_s_h_a_r_e_/_d_o_c will be d224 1 a224 1 _D_e_f_a_u_l_t: ``yes'' d226 1 a226 1 MMKKHHTTMMLL Can be set to ``yes'' or ``no''. Indicates whether d229 1 a229 1 _D_e_f_a_u_l_t: ``yes'' d231 1 a231 1 MMKKHHOOSSTTOOBBJJ Can be set to ``yes'' or ``no''. If set to ``yes'', then for d240 1 a240 1 _D_e_f_a_u_l_t: ``no'' d242 1 a242 1 MMKKIINNFFOO Can be set to ``yes'' or ``no''. Indicates whether GNU Info d246 1 a246 1 _D_e_f_a_u_l_t: ``yes'' d248 1 a248 1 MMKKKKMMOODD Can be set to ``yes'' or ``no''. Indicates whether kernel d251 1 a251 1 _D_e_f_a_u_l_t: ``yes'' d253 1 a253 1 MMKKLLIINNTT Can be set to ``yes'' or ``no''. Indicates whether lint(1) d256 1 a256 1 DDEESSTTDDIIRR_/_u_s_r_/_l_i_b_d_a_t_a_/_l_i_n_t. d258 1 a258 1 _D_e_f_a_u_l_t: ``yes'' d260 1 a260 1 MMKKMMAANN Can be set to ``yes'' or ``no''. Indicates whether manual d263 1 a263 1 _D_e_f_a_u_l_t: ``yes'' d265 1 a265 1 MMKKNNLLSS Can be set to ``yes'' or ``no''. Indicates whether Native d269 1 a269 1 _D_e_f_a_u_l_t: ``yes'' d271 1 a271 1 MMKKOOBBJJ Can be set to ``yes'' or ``no''. Indicates whether object d276 1 a276 1 _D_e_f_a_u_l_t: ``yes'' d278 1 a278 1 Note that setting MMKKOOBBJJ to ``no'' is not recommended and may d281 1 a281 1 MMKKPPIICC Can be set to ``yes'' or ``no''. Indicates whether shared d286 2 a287 2 _D_e_f_a_u_l_t: Platform dependent. As of this writing, all platforms except sshh33 default to ``yes''. d289 1 a289 1 MMKKPPIICCIINNSSTTAALLLL d291 1 a291 1 format libraries (lliibb**__ppiicc..aa), used to generate shared d294 1 a294 1 _D_e_f_a_u_l_t: ``yes'' d296 2 a297 2 MMKKPPRROOFFIILLEE Can be set to ``yes'' or ``no''. Indicates whether profiled libraries (lliibb**__pp..aa) will be built and installed during a d300 1 a300 1 _D_e_f_a_u_l_t: ``yes''; however, some platforms turn off MMKKPPRROOFFIILLEE d304 1 a304 1 MMKKRREEPPRROO Can be set to ``yes'' or ``no''. Create reproducable builds. d308 1 a308 1 _D_e_f_a_u_l_t: ``no'' d310 2 a311 2 MMKKSSHHAARREE Can be set to ``yes'' or ``no''. Indicates whether files destined to reside in DDEESSTTDDIIRR_/_u_s_r_/_s_h_a_r_e will be built and d313 1 a313 1 MMKKCCAATTPPAAGGEESS, MMKKDDOOCC, MMKKIINNFFOO, MMKKMMAANN, and MMKKNNLLSS will be set to d316 1 a316 1 _D_e_f_a_u_l_t: ``yes'' d318 1 a318 1 MMKKSSTTRRIIPPIIDDEENNTT d323 1 a323 1 _D_e_f_a_u_l_t: ``no'' d325 1 a325 1 MMKKUUNNPPRRIIVVEEDD Can be set to ``yes'' or ``no''. Indicates whether an d329 1 a329 1 called _M_E_T_A_L_O_G in DDEESSTTDDIIRR. The contents of _M_E_T_A_L_O_G are used d333 1 a333 1 _D_e_f_a_u_l_t: ``no'' d335 2 a336 2 MMKKUUPPDDAATTEE Can be set to ``yes'' or ``no''. Indicates whether all install operations intended to write to DDEESSTTDDIIRR will compare d341 1 a341 1 _D_e_f_a_u_l_t: ``no'' d343 2 a344 2 MMKKXX1111 Can be set to ``yes'' or ``no''. Indicates whether X11 is built from XX1111SSRRCCDDIIRR. d346 1 a346 1 _D_e_f_a_u_l_t: ``no'' d348 1 a348 1 TTOOOOLLDDIIRR Directory to hold the host tools, once built. If specified, d351 1 a351 1 multiple targets may share the same TTOOOOLLDDIIRR; the target- d354 1 a354 1 be created in the ..OOBBJJDDIIRR of _s_r_c. d356 1 a356 1 _D_e_f_a_u_l_t: Unset. d358 1 a358 1 UUSSEETTOOOOLLSS Indicates whether the tools specified by TTOOOOLLDDIIRR should be d362 1 a362 1 yyeess Use the tools from TTOOOOLLDDIIRR. d364 1 a364 1 nnoo Do not use the tools from TTOOOOLLDDIIRR, but refuse to build d368 1 a368 1 nneevveerr Do not use the tools from TTOOOOLLDDIIRR, even when building d370 1 a370 1 traditional NetBSD build method, but does _n_o_t verify d376 1 a376 1 _D_e_f_a_u_l_t: ``yes'', unless TTOOOOLLCCHHAAIINN__MMIISSSSIINNGG is set to ``yes''. d378 1 a378 1 UUSSEETTOOOOLLSS is also set to ``no'' when using outside d381 1 a381 1 XX1111SSRRCCDDIIRR Directory containing the X11R6 source. If specified, must be d383 1 a383 1 XX1111SSRRCCDDIIRR_/_x_f_r_e_e_/_x_c. d385 2 a386 2 _D_e_f_a_u_l_t: NNEETTBBSSDDRRCCDDIIRR_/_._._/_x_s_r_c, if that exists; otherwise _/_u_s_r_/_x_s_r_c. d388 1 a388 1 XX1111FFLLAAVVOOUURR The style of X11 cross-built, set to either ``Xorg'' or d391 1 a391 1 _D_e_f_a_u_l_t: ``Xorg'' on amd64, i386, macppc, shark and sparc64 d394 1 a394 1 ""mmaakkee"" vvaarriiaabblleess ffoorr ffuullll bbuuiillddss d398 1 a398 1 IINNSSTTAALLLLWWOORRLLDDDDIIRR Location for the ``make installworld'' target to install d401 1 a401 1 _D_e_f_a_u_l_t: ``/'' d403 1 a403 1 MMKKOOBBJJDDIIRRSS Can be set to ``yes'' or ``no''. Indicates whether d407 1 a407 1 _D_e_f_a_u_l_t: ``no'' d409 2 a410 2 If using bbuuiilldd..sshh, the default is ``yes''. This may be set back to ``no'' by giving bbuuiilldd..sshh the --oo option. d412 3 a414 3 MMKKUUPPDDAATTEE Can be set to ``yes'' or ``no''. If set, then in addition to the effects described for MMKKUUPPDDAATTEE==yyeess above, this implies the effects of NNOOCCLLEEAANNDDIIRR (i.e., d417 1 a417 1 _D_e_f_a_u_l_t: ``no'' d419 1 a419 1 If using bbuuiilldd..sshh, this may be set by giving the --uu d422 1 a422 1 NNBBUUIILLDDJJOOBBSS Now obsolete. Use the make(1) option --jj, instead. See d425 1 a425 1 _D_e_f_a_u_l_t: Unset. d427 1 a427 1 NNOOCCLLEEAANNDDIIRR If set, avoids the ``make cleandir'' phase of a full d432 1 a432 1 _D_e_f_a_u_l_t: Unset. d434 1 a434 1 See also MMKKUUPPDDAATTEE. d436 2 a437 2 NNOODDIISSTTRRIIBBDDIIRRSS If set, avoids the ``make distrib-dirs'' phase of a full build. This skips running mtree(8) on DDEESSTTDDIIRR, useful d442 1 a442 1 _D_e_f_a_u_l_t: Unset. d444 1 a444 1 NNOOIINNCCLLUUDDEESS If set, avoids the ``make includes'' phase of a full d450 1 a450 1 MMKKUUPPDDAATTEE==yyeess instead in that case. d452 1 a452 1 _D_e_f_a_u_l_t: Unset. d454 1 a454 1 RREELLEEAASSEEDDIIRR If set, specifies the directory to which a release(7) d458 1 a458 1 _D_e_f_a_u_l_t: Unset. d460 2 a461 2 _N_o_t_e: bbuuiilldd..sshh will provide a default of _r_e_l_e_a_s_e_d_i_r (in the top-level ..OOBBJJDDIIRR) unless run in `expert' mode. d463 2 a464 2 BBUUIILLDDIINNGG ""mmaakkee"" ccoommmmaanndd lliinnee ooppttiioonnss d468 1 a468 1 --jj _n_j_o_b Run up to _n_j_o_b make(1) subjobs in parallel. Makefiles should d472 1 a472 1 --mm _d_i_r Specify the default directory for searching for system d477 1 a477 1 bbuuiilldd..sshh. d479 1 a479 1 --nn Display the commands that would have been executed, but do not d483 1 a483 1 --VV _v_a_r Print make(1)'s idea of the value of _v_a_r. Does not build any d486 2 a487 2 _v_a_r_=_v_a_l_u_e Set the variable _v_a_r to _v_a_l_u_e, overriding any setting specified by the process environment, the MMAAKKEECCOONNFF d490 1 a490 1 ""mmaakkee"" ttaarrggeettss d496 1 a496 1 aallll Build programs, libraries, and preformatted documentation. d498 1 a498 1 cclleeaann Remove program and library object code files. d500 1 a500 1 cclleeaannddiirr Same as cclleeaann, but also remove preformatted documentation, d504 1 a504 1 ddeeppeenndd Create dependency files (..ddeeppeenndd) containing more detailed d509 1 a509 1 ddeeppeennddaallll Does a ``make depend'' immediately followed by a ``make all''. d513 1 a513 1 ddiissttcclleeaann Synonym for cclleeaannddiirr. d515 1 a515 1 iinncclluuddeess Build and install system header files. Typically needed d518 3 a520 3 iinnssttaallll Install programs, libraries, and documentation into DDEESSTTDDIIRR. Few files will be installed to DDEESSTTDDIIRR_/_d_e_v, DDEESSTTDDIIRR_/_e_t_c, DDEESSTTDDIIRR_/_r_o_o_t or DDEESSTTDDIIRR_/_v_a_r in order to prevent user supplied d523 1 a523 1 lliinntt Run lint(1) against the C source code, where appropriate, and d526 1 a526 1 oobbjj Create object directories to be used for built files, instead d529 1 a529 1 ttaaggss Create ctags(1) searchable function lists usable by the ex(1) d532 1 a532 1 ""mmaakkee"" ttaarrggeettss ffoorr tthhee ttoopp lleevveell d536 1 a536 1 bbuuiilldd Build the entire NetBSD system (except the kernel). This d540 4 a543 4 ddiissttrriibbuuttiioonn Do a ``make build'', and then install a full distribution (which does not include a kernel) into DDEESSTTDDIIRR, including files in DDEESSTTDDIIRR_/_d_e_v, DDEESSTTDDIIRR_/_e_t_c, DDEESSTTDDIIRR_/_r_o_o_t and DDEESSTTDDIIRR_/_v_a_r. d545 2 a546 2 bbuuiillddwwoorrlldd As per ``make distribution'', except that it ensures that DDEESSTTDDIIRR is not the root directory. d548 1 a548 1 iinnssttaallllwwoorrlldd Install the distribution from DDEESSTTDDIIRR to IINNSSTTAALLLLWWOORRLLDDDDIIRR, d550 1 a550 1 IINNSSTTAALLLLWWOORRLLDDDDIIRR is not the root directory if cross d553 1 a553 1 The IINNSSTTAALLLLSSEETTSS environment variable may be set to a space- d556 1 a556 1 installed, so most files in IINNSSTTAALLLLWWOORRLLDDDDIIRR_/_e_t_c will not be d559 2 a560 2 _N_o_t_e: Before performing this operation with IINNSSTTAALLLLWWOORRLLDDDDIIRR=_/, it is highly recommended that you d563 1 a563 1 update files in IINNSSTTAALLLLWWOORRLLDDDDIIRR_/_e_t_c, and postinstall(8) to d566 2 a567 2 sseettss Create distribution sets from DDEESSTTDDIIRR into RREELLEEAASSEEDDIIRR//RREELLEEAASSEEMMAACCHHIINNEEDDIIRR_/_b_i_n_a_r_y_/_s_e_t_s. Should be run d571 2 a572 2 ssoouurrcceesseettss Create source sets of the source tree into RREELLEEAASSEEDDIIRR_/_s_o_u_r_c_e_/_s_e_t_s. d574 2 a575 2 ssyyssppkkggss Create syspkgs from DDEESSTTDDIIRR into RREELLEEAASSEEDDIIRR//RREELLEEAASSEEMMAACCHHIINNEEDDIIRR_/_b_i_n_a_r_y_/_s_y_s_p_k_g_s. Should be run d579 1 a579 1 rreelleeaassee Do a ``make distribution'', build kernels, distribution d582 1 a582 1 described by release(7). This requires that RREELLEEAASSEEDDIIRR be d585 2 a586 2 iissoo--iimmaaggee Create a NetBSD installation CD-ROM image in the RREELLEEAASSEEDDIIRR_/_i_s_o directory. The CD-ROM file system will have d600 1 a600 1 the RREELLEEAASSEEDDIIRR//RREELLEEAASSEEMMAACCHHIINNEEDDIIRR_/_i_n_s_t_a_l_l_a_t_i_o_n_/_c_d_r_o_m d603 1 a603 1 RREELLEEAASSEEDDIIRR_/_i_s_o, but do not contain additional content such d609 1 a609 1 installed from _p_k_g_s_r_c_/_s_y_s_u_t_i_l_s_/_c_d_r_t_o_o_l_s. d611 1 a611 1 iissoo--iimmaaggee--ssoouurrccee d613 1 a613 1 RREELLEEAASSEEDDIIRR_/_i_s_o directory. The CD-ROM file system will have d629 1 a629 1 the RREELLEEAASSEEDDIIRR//RREELLEEAASSEEMMAACCHHIINNEEDDIIRR_/_i_n_s_t_a_l_l_a_t_i_o_n_/_c_d_r_o_m d632 1 a632 1 RREELLEEAASSEEDDIIRR_/_i_s_o, but do not contain additional content such d638 1 a638 1 installed from _p_k_g_s_r_c_/_s_y_s_u_t_i_l_s_/_c_d_r_t_o_o_l_s. d640 1 a640 1 iinnssttaallll--iimmaaggee d642 1 a642 1 RREELLEEAASSEEDDIIRR//RREELLEEAASSEEMMAACCHHIINNEEDDIIRR_/_i_n_s_t_a_l_l_a_t_i_o_n_/_i_n_s_t_a_l_l_i_m_a_g_e d655 1 a655 1 Before ``make install-image'' is attempted, RREELLEEAASSEEDDIIRR must d657 2 a658 2 must have been performed with MMKKUUNNPPRRIIVVEEDD==yyeess because ``make install-image'' relies on information in DDEESSTTDDIIRR_/_M_E_T_A_L_O_G. d661 1 a661 1 RREELLEEAASSEEDDIIRR//RREELLEEAASSEEMMAACCHHIINNEEDDIIRR_/_i_n_s_t_a_l_l_a_t_i_o_n_/_l_i_v_e_i_m_a_g_e d674 2 a675 2 must have been performed with MMKKUUNNPPRRIIVVEEDD==yyeess because ``make install-image'' relies on information in DDEESSTTDDIIRR_/_M_E_T_A_L_O_G. d677 1 a677 1 rreeggrreessssiioonn--tteessttss d684 1 a684 1 TThhee ""bbuuiilldd..sshh"" ssccrriipptt d687 1 a687 1 utilities. The required shell features are described under the HHOOSSTT__SSHH d694 1 a694 1 /path/to/suitable/shell build.sh [_o_p_t_i_o_n_s] d696 2 a697 2 The above command will usually enable bbuuiilldd..sshh to automatically set HHOOSSTT__SSHH==_/_p_a_t_h_/_t_o_/_s_u_i_t_a_b_l_e_/_s_h_e_l_l, but if that fails, then the following d700 1 a700 1 HOST_SH=_/_p_a_t_h_/_t_o_/_s_u_i_t_a_b_l_e_/_s_h_e_l_l d702 1 a702 1 ${HOST_SH} build.sh [_o_p_t_i_o_n_s] d704 1 a704 1 If bbuuiilldd..sshh detects that it is being executed under an unsuitable shell, d706 1 a706 1 If HHOOSSTT__SSHH is not set explicitly, then bbuuiilldd..sshh sets a default using d708 2 a709 2 bbuuiilldd..sshh is executed (if that can be determined), or using the first copy of _s_h found in PPAATTHH. d712 1 a712 1 should make use of bbuuiilldd..sshh rather than just running ``make''. This way, d716 1 a716 1 When compiling the entire system via bbuuiilldd..sshh, many make(1) variables are d718 1 a718 1 of options below, variables that are automatically set by bbuuiilldd..sshh are d721 1 a721 1 The following operations are supported by bbuuiilldd..sshh: d723 4 a726 4 bbuuiilldd Build the system as per ``make build''. Before the main part of the build commences, this command runs the oobbjj operation (unless the --oo option is given), ``make cleandir'' (unless the --uu option is given), and the ttoooollss d729 2 a730 2 ddiissttrriibbuuttiioonn Build a full distribution as per ``make distribution''. This command first runs the bbuuiilldd operation. d732 2 a733 2 rreelleeaassee Build a full release as per ``make release''. This command first runs the ddiissttrriibbuuttiioonn operation. d735 1 a735 1 mmaakkeewwrraappppeerr Create the nnbbmmaakkee--MMAACCHHIINNEE wrapper. This operation is d738 1 a738 1 cclleeaannddiirr Perform ``make cleandir''. d740 1 a740 1 oobbjj Perform ``make obj''. d742 1 a742 1 ttoooollss Build and install the host tools from _s_r_c_/_t_o_o_l_s. This d744 1 a744 1 in the _t_o_o_l_s subdirectory unless the --oo or --uu options d747 1 a747 1 iinnssttaallll=_i_d_i_r Install the contents of DDEESSTTDDIIRR to _i_d_i_r, using ``make d752 2 a753 2 kkeerrnneell=_k_c_o_n_f Build a new kernel. The _k_c_o_n_f argument is the name of a configuration file suitable for use by config(1). If _k_c_o_n_f d755 4 a758 4 is expected to be found in the KKEERRNNCCOONNFFDDIIRR directory, which is typically ssyyss//aarrcchh//MMAACCHHIINNEE//ccoonnff. The new kernel will be built in a subdirectory of KKEERRNNOOBBJJDDIIRR, which is typically ssyyss//aarrcchh//MMAACCHHIINNEE//ccoommppiillee or an associated object directory. d760 2 a761 2 This command does _n_o_t imply the ttoooollss command; run the ttoooollss command first unless it is _c_e_r_t_a_i_n that the tools d765 1 a765 1 question first unless the --uu option is given. d767 2 a768 2 mmoodduulleess This command will build kernel modules and install them into DDEESSTTDDIIRR. d770 1 a770 1 rreelleeaasseekkeerrnneell=_k_c_o_n_f d772 4 a775 4 kkeerrnneell=_k_c_o_n_f into RREELLEEAASSEEDDIIRR//RREELLEEAASSEEMMAACCHHIINNEEDDIIRR_/_b_i_n_a_r_y_/_k_e_r_n_e_l, usually as _n_e_t_b_s_d_-_k_c_o_n_f_._g_z, although the ``_n_e_t_b_s_d'' prefix is determined from the ``ccoonnffiigg'' directives in _k_c_o_n_f. d777 1 a777 1 sseettss Perform ``make sets''. d779 1 a779 1 ssoouurrcceesseettss Perform ``make sourcesets''. d781 1 a781 1 ssyyssppkkggss Perform ``make syspkgs''. d783 1 a783 1 iissoo--iimmaaggee Perform ``make iso-image''. d785 1 a785 1 iissoo--iimmaaggee--ssoouurrccee d788 1 a788 1 iinnssttaallll--iimmaaggee d791 1 a791 1 lliivvee--iimmaaggee Perform ``make live-image''. d793 1 a793 1 The following command line options alter the behaviour of the bbuuiilldd..sshh d796 1 a796 1 --aa _a_r_c_h Set the value of MMAACCHHIINNEE__AARRCCHH to _a_r_c_h. d798 2 a799 2 --BB _b_u_i_l_d_i_d Set the value of BBUUIILLDDIIDD to _b_u_i_l_d_i_d. This will also append the d802 1 a802 1 ``nnbbmmaakkee--MMAACCHHIINNEE--BBUUIILLDDIIDD''. d804 2 a805 2 --CC _c_d_e_x_t_r_a_s Append _c_d_e_x_t_r_a_s to the CCDDEEXXTTRRAA variable, which is a space- d812 1 a812 1 may be specified via multiple --CC options, or via a single d815 1 a815 1 --DD _d_e_s_t Set the value of DDEESSTTDDIIRR to _d_e_s_t. If a relative path is d819 3 a821 3 --EE Set `expert' mode. This overrides various sanity checks, and allows: DDEESSTTDDIIRR does not have to be set to a non-root path for builds, and MMKKUUNNPPRRIIVVEEDD==yyeess does not have to be set when d824 1 a824 1 _N_o_t_e: It is highly recommended that you know what you are doing d827 1 a827 1 --hh Print a help message. d829 1 a829 1 --jj _n_j_o_b Run up to _n_j_o_b make(1) subjobs in parallel; passed through to d831 1 a831 1 out of memory while using bbuuiilldd..sshh with --jj, please save d834 1 a834 1 To achieve the fastest builds, --jj values between (1 + the d839 2 a840 2 --MM _o_b_j Set MMAAKKEEOOBBJJDDIIRRPPRREEFFIIXX to _o_b_j. Unsets MMAAKKEEOOBBJJDDIIRR. See ``--OO --oobbjj'' for more information. d842 4 a845 4 For instance, if the source directory is _/_u_s_r_/_s_r_c, a setting of ``--MM _/_u_s_r_/_o_b_j'' will place build-time files under _/_u_s_r_/_o_b_j_/_u_s_r_/_s_r_c_/_b_i_n, _/_u_s_r_/_o_b_j_/_u_s_r_/_s_r_c_/_l_i_b, _/_u_s_r_/_o_b_j_/_u_s_r_/_s_r_c_/_u_s_r_._b_i_n, and so forth. d848 2 a849 2 absolute path before being used. bbuuiilldd..sshh imposes the restriction that the argument to the --MM option must not begin d853 1 a853 1 bbuuiilldd..sshh will create it. d855 1 a855 1 --mm _m_a_c_h Set the value of MMAACCHHIINNEE to _m_a_c_h, except in some special cases d857 3 a859 3 MMAACCHHIINNEE__AARRCCHH in the process environment with a value deduced from _m_a_c_h, unless --aa is specified. All cross builds require --mm, but if unset on a NetBSD host, the host's value of MACHINE d862 3 a864 3 Some machines support multiple values for MMAACCHHIINNEE__AARRCCHH. The following special cases for the _m_a_c_h argument are defined to set the listed values of MMAACCHHIINNEE and MMAACCHHIINNEE__AARRCCHH: d866 1 a866 1 mmaacchh MMAACCHHIINNEE MMAACCHHIINNEE__AARRCCHH d880 1 a880 1 --NN _n_o_i_s_e_l_e_v_e_l d882 1 a882 1 MMAAKKEEVVEERRBBOOSSEE to _n_o_i_s_e_l_e_v_e_l. d884 1 a884 1 --nn Show the commands that would be executed by bbuuiilldd..sshh, but do d888 3 a890 3 --OO _o_b_j Create an appropriate transform macro for MMAAKKEEOOBBJJDDIIRR that will place the built object files under _o_b_j. Unsets MMAAKKEEOOBBJJDDIIRRPPRREEFFIIXX. d892 2 a893 2 For instance, a setting of ``--OO _/_u_s_r_/_o_b_j'' will place build- time files under _/_u_s_r_/_o_b_j_/_b_i_n, _/_u_s_r_/_o_b_j_/_l_i_b, _/_u_s_r_/_o_b_j_/_u_s_r_._b_i_n, d897 2 a898 2 absolute path before being used. bbuuiilldd..sshh imposes the restriction that the argument to the --OO option must not contain d900 1 a900 1 already exist, bbuuiilldd..sshh will create it. d902 2 a903 2 In normal use, exactly one of the --MM or --OO options should be specified. If neither --MM nor --OO is specified, then a default d910 1 a910 1 --oo Set the value of MMKKOOBBJJDDIIRRSS to ``no''. Otherwise, it will be d912 1 a912 1 behaviour when not using bbuuiilldd..sshh. d914 1 a914 1 --RR _r_e_l Set the value of RREELLEEAASSEEDDIIRR to _r_e_l. If a relative path is d918 1 a918 1 --rr Remove the contents of DDEESSTTDDIIRR and TTOOOOLLDDIIRR before building d920 1 a920 1 DDEESSTTDDIIRR if building on a native system to the root directory. d922 1 a922 1 --SS _s_e_e_d Change the value of BBUUIILLDDSSEEEEDD to _s_e_e_d. This should rarely be d925 1 a925 1 --TT _t_o_o_l_s Set the value of TTOOOOLLDDIIRR to _t_o_o_l_s. If a relative path is d930 1 a930 1 --UU Set MMKKUUNNPPRRIIVVEEDD==yyeess. d932 1 a932 1 --uu Set MMKKUUPPDDAATTEE==yyeess. d934 8 a941 8 --VV _v_a_r=[_v_a_l_u_e] Set the environment variable _v_a_r to an optional _v_a_l_u_e. This is propagated to the nnbbmmaakkee wrapper. --ww _w_r_a_p_p_e_r Create the nnbbmmaakkee wrapper script (see below) in a custom location, specified by _w_r_a_p_p_e_r. This allows, for instance, to place the wrapper in PPAATTHH automatically. Note that _w_r_a_p_p_e_r is d946 2 a947 2 --XX _x_1_1_s_r_c Set the value of XX1111SSRRCCDDIIRR to _x_1_1_s_r_c. If a relative path is d951 1 a951 1 --xx Set MMKKXX1111==yyeess. d953 2 a954 2 --ZZ _v_a_r Unset ("zap") the environment variable _v_a_r. This is propagated to the nnbbmmaakkee wrapper. d956 3 a958 3 TThhee ""nnbbmmaakkee--MMAACCHHIINNEE"" wwrraappppeerr ssccrriipptt If using the bbuuiilldd..sshh script to build NetBSD, a nnbbmmaakkee--MMAACCHHIINNEE script will be created in TTOOOOLLDDIIRR//bbiinn upon the first build to assist in building d961 5 a965 5 nnbbmmaakkee--MMAACCHHIINNEE can be invoked in lieu of make(1), and will instead call the up-to-date version of ``nbmake'' installed into TTOOOOLLDDIIRR//bbiinn with several key variables pre-set, including MMAACCHHIINNEE, MMAACCHHIINNEE__AARRCCHH, and TTOOOOLLDDIIRR. nnbbmmaakkee--MMAACCHHIINNEE will also set variables specified with --VV, and unset variables specified with --ZZ. d967 1 a967 1 This script can be symlinked into a directory listed in PPAATTHH, or called d970 1 a970 1 EEXXAAMMPPLLEESS d978 2 a979 2 Using unprivileged mode, build a complete distribution to a DDEESSTTDDIIRR directory that bbuuiilldd..sshh selects (and will display). d983 4 a986 4 As root, install to _/ the distribution that was built by example 2. Even though this is run as root, --UU is required so that the permissions stored in DDEESSTTDDIIRR_/_M_E_T_A_L_O_G are correctly applied to the files as they're copied to _/. d990 3 a992 3 Using unprivileged mode, build a complete release to DDEESSTTDDIIRR and RREELLEEAASSEEDDIIRR directories that bbuuiilldd..sshh selects (and will display). MMKKUUPPDDAATTEE==yyeess (--uu) is set to prevent the ``make cleandir'', so that d996 2 a997 2 OOBBSSOOLLEETTEE VVAARRIIAABBLLEESS NNBBUUIILLDDJJOOBBSS Use the make(1) option --jj instead. d999 1 a999 1 UUSSEE__NNEEWW__TTOOOOLLCCHHAAIINN d1001 1 a1001 1 TTOOOOLLCCHHAAIINN__MMIISSSSIINNGG==yyeess. d1003 1 a1003 1 SSEEEE AALLSSOO d1005 1 a1005 1 _p_k_g_s_r_c_/_s_y_s_u_t_i_l_s_/_c_d_r_t_o_o_l_s d1007 3 a1009 3 HHIISSTTOORRYY The bbuuiilldd..sshh based build scheme was introduced for NetBSD 1.6 as UUSSEE__NNEEWW__TTOOOOLLCCHHAAIINN, and re-worked to TTOOOOLLCCHHAAIINN__MMIISSSSIINNGG after that. @ 1.103 log @regen @ text @d1 1 a1 1 BUILDING(8) NetBSD System Manager's Manual BUILDING(8) d3 2 a4 2 NAME BUILDING -- Procedure for building NetBSD from source code. d6 1 a6 1 REQUIREMENTS d8 2 a9 2 The basic build procedure is the same whether compiling natively (on the same NetBSD architecture) or cross compiling (on another architecture or d15 1 a15 1 toolchain (make is not required); all other tools are created as part of d19 3 a21 3 FILES Source tree layout doc/BUILDING.mdoc d24 1 a24 1 BUILDING This document (in plaintext). d26 1 a26 1 tools/compat/README d30 1 a30 1 Makefile The main Makefile for NetBSD; should only be run for d33 1 a33 1 on a non-native host, see the build.sh shell script.) d35 1 a35 1 UPDATING Special notes for updating from an earlier revision of d39 1 a39 1 build.sh Bourne-compatible shell script used for building the host d45 11 a55 11 crypto/dist/, dist/, gnu/dist/ Sources imported verbatim from third parties, without man- gling the existing build structure. Other source trees in bin through usr.sbin use the NetBSD make(1) ``reachover'' Makefile semantics when building these programs for a native host. distrib/, etc/ Sources for items used when making a full release snap- shot, such as files installed in DESTDIR/etc on the desti- nation system, boot media, and release notes. d57 1 a57 1 tests/, regress/ d59 2 a60 2 run natively. tests/ uses the atf(7) test framework; regress/ contains older tests that have not yet been d63 1 a63 1 sys/ NetBSD kernel sources. d65 3 a67 3 tools/ ``Reachover'' build structure for the host build tools. This has a special method of determining out-of-date sta- tus. d69 1 a69 1 bin/ ... usr.sbin/ d74 2 a75 2 x11/ ``Reachover'' build structure for X11R6; the source is in X11SRCDIR. d77 1 a77 1 Build tree layout d81 2 a82 2 CONFIGURATION Environment variables d85 1 a85 1 HOST_SH Path name to a shell available on the host system and d90 2 a91 2 functions (which is a widely-implemented but non-stan- dardised feature). d94 1 a94 1 /bin/sh, /usr/xpg4/bin/sh, /bin/ksh (provided it is a d96 1 a96 1 such as ksh88, but not ksh93), or /usr/local/bin/bash. d98 4 a101 4 Most parts of the build require HOST_SH to be an abso- lute path; however, build.sh allows it to be a simple command name, which will be converted to an absolute path by searching the PATH. d103 1 a103 1 HOST_CC Path name to C compiler used to create the toolchain. d105 1 a105 1 HOST_CXX Path name to C++ compiler used to create the toolchain. d107 1 a107 1 MACHINE Machine type, e.g., ``macppc''. d109 1 a109 1 MACHINE_ARCH Machine architecture, e.g., ``powerpc''. d111 1 a111 1 MAKE Path name to invoke make(1) as. d113 4 a116 3 MAKEFLAGS Flags to invoke make(1) with. Note that build.sh ignores the value of MAKEFLAGS passed in the environ- ment, but allows MAKEFLAGS to be set via the -V option. d118 10 a127 10 MAKEOBJDIR Directory to use as the .OBJDIR for the current direc- tory. The value is subjected to variable expansion by make(1). Typical usage is to set this variable to a value involving the use of `${.CURDIR:S...}' or `${.CURDIR:C...}', to derive the value of .OBJDIR from the value of .CURDIR. Used only if MAKEOBJDIRPREFIX is not defined. MAKEOBJDIR can be provided only in the environment or via the -O flag of build.sh; it cannot usefully be set inside a Makefile, including mk.conf or ${MAKECONF}. d129 1 a129 1 MAKEOBJDIRPREFIX Top level directory of the object directory tree. The d131 2 a132 2 build.sh will create the ${MAKEOBJDIRPREFIX} directory if necessary, but if make(1) is used without build.sh, d135 12 a146 12 value is defined and valid, then ${MAKEOBJDIRPRE- FIX}/${.CURDIR} is used as the .OBJDIR for the current directory. The current directory may be read only. MAKEOBJDIRPREFIX can be provided only in the environ- ment or via the -M flag of build.sh; it cannot usefully be set inside a Makefile, including mk.conf or ${MAKECONF}. "make" variables Several variables control the behavior of NetBSD builds. Unless other- wise specified, these variables may be set in either the process environ- ment or the make(1) configuration file specified by MAKECONF. d148 1 a148 1 BUILDID Identifier for the build. The identifier will be appended to d150 2 a151 2 configuration file in order to set additional build parame- ters, such as compiler flags. d153 15 a167 14 BUILDSEED GCC uses random numbers when compiling C++ code. This vari- able seeds the gcc random number generator using the -fran- dom-seed flag with this value. By default, it is set to NetBSD-(majorversion). Using a fixed value causes C++ bina- ries to be the same when built from the same sources, result- ing in identical (reproducible) builds. Additional informa- tion is available in the GCC documentation of -frandom-seed. DESTDIR Directory to contain the built NetBSD system. If set, spe- cial options are passed to the compilation tools to prevent their default use of the host system's /usr/include, /usr/lib, and so forth. This pathname must be an absolute path, and should not end with a slash (/) character. (For installation into the system's root directory, set DESTDIR to d171 2 a172 2 Default: Empty string if USETOOLS is ``yes''; unset other- wise. d174 2 a175 2 Note: build.sh will provide a default of destdir.MACHINE (in the top-level .OBJDIR) unless run in `expert' mode. d177 2 a178 2 MAKECONF The name of the make(1) configuration file. Only settable in the process environment. d180 1 a180 1 Default: ``/etc/mk.conf'' d182 1 a182 1 MAKEVERBOSE d189 2 a190 2 but the actual commands executed by make(1) are not dis- played. d202 1 a202 1 are traced through use of the sh(1) ``-x'' flag. d204 1 a204 1 Default: 2 d206 3 a208 2 MKCATPAGES Can be set to ``yes'' or ``no''. Indicates whether prefor- matted plaintext manual pages will be created during a build. d210 1 a210 1 Default: ``no'' d212 5 a216 5 MKCRYPTO Can be set to ``yes'' or ``no''. Indicates whether crypto- graphic code will be included in a build; provided for the benefit of countries that do not allow strong cryptography. Will not affect use of the standard low-security password encryption system, crypt(3). d218 1 a218 1 Default: ``yes'' d220 2 a221 2 MKDOC Can be set to ``yes'' or ``no''. Indicates whether system documentation destined for DESTDIR/usr/share/doc will be d224 1 a224 1 Default: ``yes'' d226 2 a227 2 MKHTML Can be set to ``yes'' or ``no''. Indicates whether prefor- matted HTML manual pages will be built and installed d229 1 a229 1 Default: ``yes'' d231 1 a231 1 MKHOSTOBJ Can be set to ``yes'' or ``no''. If set to ``yes'', then for d240 1 a240 1 Default: ``no'' d242 1 a242 1 MKINFO Can be set to ``yes'' or ``no''. Indicates whether GNU Info d246 1 a246 1 Default: ``yes'' d248 1 a248 1 MKKMOD Can be set to ``yes'' or ``no''. Indicates whether kernel d251 1 a251 1 Default: ``yes'' d253 1 a253 1 MKLINT Can be set to ``yes'' or ``no''. Indicates whether lint(1) d256 1 a256 1 DESTDIR/usr/libdata/lint. d258 1 a258 1 Default: ``yes'' d260 1 a260 1 MKMAN Can be set to ``yes'' or ``no''. Indicates whether manual d263 1 a263 1 Default: ``yes'' d265 1 a265 1 MKNLS Can be set to ``yes'' or ``no''. Indicates whether Native d269 1 a269 1 Default: ``yes'' d271 1 a271 1 MKOBJ Can be set to ``yes'' or ``no''. Indicates whether object d276 1 a276 1 Default: ``yes'' d278 1 a278 1 Note that setting MKOBJ to ``no'' is not recommended and may d281 1 a281 1 MKPIC Can be set to ``yes'' or ``no''. Indicates whether shared d286 2 a287 2 Default: Platform dependent. As of this writing, all plat- forms except sh3 default to ``yes''. d289 1 a289 1 MKPICINSTALL d291 1 a291 1 format libraries (lib*_pic.a), used to generate shared d294 1 a294 1 Default: ``yes'' d296 2 a297 2 MKPROFILE Can be set to ``yes'' or ``no''. Indicates whether profiled libraries (lib*_p.a) will be built and installed during a d300 1 a300 1 Default: ``yes''; however, some platforms turn off MKPROFILE d304 1 a304 1 MKREPRO Can be set to ``yes'' or ``no''. Create reproducable builds. d308 1 a308 1 Default: ``no'' d310 2 a311 2 MKSHARE Can be set to ``yes'' or ``no''. Indicates whether files destined to reside in DESTDIR/usr/share will be built and d313 1 a313 1 MKCATPAGES, MKDOC, MKINFO, MKMAN, and MKNLS will be set to d316 1 a316 1 Default: ``yes'' d318 1 a318 1 MKSTRIPIDENT d320 2 a321 2 for use with ident(1), should be stripped from program bina- ries and shared libraries. d323 1 a323 1 Default: ``no'' d325 3 a327 3 MKUNPRIVED Can be set to ``yes'' or ``no''. Indicates whether an unprivileged install will occur. The user, group, permis- sions, and file flags, will not be set on the installed d329 1 a329 1 called METALOG in DESTDIR. The contents of METALOG are used d333 1 a333 1 Default: ``no'' d335 2 a336 2 MKUPDATE Can be set to ``yes'' or ``no''. Indicates whether all install operations intended to write to DESTDIR will compare d341 1 a341 1 Default: ``no'' d343 2 a344 2 MKX11 Can be set to ``yes'' or ``no''. Indicates whether X11 is built from X11SRCDIR. d346 1 a346 1 Default: ``no'' d348 1 a348 1 TOOLDIR Directory to hold the host tools, once built. If specified, d350 5 a354 5 a given host system and NetBSD source tree. (However, multi- ple targets may share the same TOOLDIR; the target-dependent files have unique names.) If unset, a default based on the uname(1) information of the host platform will be created in the .OBJDIR of src. d356 1 a356 1 Default: Unset. d358 1 a358 1 USETOOLS Indicates whether the tools specified by TOOLDIR should be d362 1 a362 1 yes Use the tools from TOOLDIR. d364 1 a364 1 no Do not use the tools from TOOLDIR, but refuse to build d368 7 a374 7 never Do not use the tools from TOOLDIR, even when building native tool components. This is similar to the tradi- tional NetBSD build method, but does not verify that the compilation tools in use are up-to-date enough in order to build the tree successfully. This may cause build or runtime problems when building the whole NetBSD source tree. d376 1 a376 1 Default: ``yes'', unless TOOLCHAIN_MISSING is set to ``yes''. d378 1 a378 1 USETOOLS is also set to ``no'' when using outside d381 1 a381 1 X11SRCDIR Directory containing the X11R6 source. If specified, must be d383 1 a383 1 X11SRCDIR/xfree/xc. d385 2 a386 2 Default: NETBSDRCDIR/../xsrc, if that exists; otherwise /usr/xsrc. d388 1 a388 1 X11FLAVOUR The style of X11 cross-built, set to either ``Xorg'' or d391 1 a391 1 Default: ``Xorg'' on amd64, i386, macppc, shark and sparc64 d394 1 a394 1 "make" variables for full builds d398 1 a398 1 INSTALLWORLDDIR Location for the ``make installworld'' target to install d401 1 a401 1 Default: ``/'' d403 1 a403 1 MKOBJDIRS Can be set to ``yes'' or ``no''. Indicates whether d407 1 a407 1 Default: ``no'' d409 2 a410 2 If using build.sh, the default is ``yes''. This may be set back to ``no'' by giving build.sh the -o option. d412 4 a415 4 MKUPDATE Can be set to ``yes'' or ``no''. If set, then in addi- tion to the effects described for MKUPDATE=yes above, this implies the effects of NOCLEANDIR (i.e., ``make cleandir'' is avoided). d417 1 a417 1 Default: ``no'' d419 1 a419 1 If using build.sh, this may be set by giving the -u d422 1 a422 1 NBUILDJOBS Now obsolete. Use the make(1) option -j, instead. See d425 1 a425 1 Default: Unset. d427 1 a427 1 NOCLEANDIR If set, avoids the ``make cleandir'' phase of a full d432 1 a432 1 Default: Unset. d434 1 a434 1 See also MKUPDATE. d436 2 a437 2 NODISTRIBDIRS If set, avoids the ``make distrib-dirs'' phase of a full build. This skips running mtree(8) on DESTDIR, useful d442 1 a442 1 Default: Unset. d444 1 a444 1 NOINCLUDES If set, avoids the ``make includes'' phase of a full d450 1 a450 1 MKUPDATE=yes instead in that case. d452 1 a452 1 Default: Unset. d454 1 a454 1 RELEASEDIR If set, specifies the directory to which a release(7) d458 1 a458 1 Default: Unset. d460 2 a461 2 Note: build.sh will provide a default of releasedir (in the top-level .OBJDIR) unless run in `expert' mode. d463 2 a464 2 BUILDING "make" command line options d468 1 a468 1 -j njob Run up to njob make(1) subjobs in parallel. Makefiles should d472 6 a477 6 -m dir Specify the default directory for searching for system Make- file segments, mainly the files. When building any full NetBSD source tree, this should be set to the ``share/mk'' directory in the source tree. This is set auto- matically when building from the top level, or when using build.sh. d479 1 a479 1 -n Display the commands that would have been executed, but do not d483 1 a483 1 -V var Print make(1)'s idea of the value of var. Does not build any d486 3 a488 3 var=value Set the variable var to value, overriding any setting speci- fied by the process environment, the MAKECONF configuration file, or the system Makefile segments. d490 1 a490 1 "make" targets d496 1 a496 1 all Build programs, libraries, and preformatted documentation. d498 1 a498 1 clean Remove program and library object code files. d500 1 a500 1 cleandir Same as clean, but also remove preformatted documentation, d504 1 a504 1 depend Create dependency files (.depend) containing more detailed d509 1 a509 1 dependall Does a ``make depend'' immediately followed by a ``make all''. d513 1 a513 1 distclean Synonym for cleandir. d515 1 a515 1 includes Build and install system header files. Typically needed d518 3 a520 3 install Install programs, libraries, and documentation into DESTDIR. Few files will be installed to DESTDIR/dev, DESTDIR/etc, DESTDIR/root or DESTDIR/var in order to prevent user supplied d523 1 a523 1 lint Run lint(1) against the C source code, where appropriate, and d526 1 a526 1 obj Create object directories to be used for built files, instead d529 1 a529 1 tags Create ctags(1) searchable function lists usable by the ex(1) d532 1 a532 1 "make" targets for the top level d536 1 a536 1 build Build the entire NetBSD system (except the kernel). This d540 4 a543 4 distribution Do a ``make build'', and then install a full distribution (which does not include a kernel) into DESTDIR, including files in DESTDIR/dev, DESTDIR/etc, DESTDIR/root and DESTDIR/var. d545 2 a546 2 buildworld As per ``make distribution'', except that it ensures that DESTDIR is not the root directory. d548 1 a548 1 installworld Install the distribution from DESTDIR to INSTALLWORLDDIR, d550 2 a551 2 INSTALLWORLDDIR is not the root directory if cross compil- ing. d553 1 a553 1 The INSTALLSETS environment variable may be set to a space- d556 1 a556 1 installed, so most files in INSTALLWORLDDIR/etc will not be d559 2 a560 2 Note: Before performing this operation with INSTALLWORLDDIR=/, it is highly recommended that you d563 1 a563 1 update files in INSTALLWORLDDIR/etc, and postinstall(8) to d566 2 a567 2 sets Create distribution sets from DESTDIR into RELEASEDIR/RELEASEMACHINEDIR/binary/sets. Should be run d571 2 a572 2 sourcesets Create source sets of the source tree into RELEASEDIR/source/sets. d574 2 a575 2 syspkgs Create syspkgs from DESTDIR into RELEASEDIR/RELEASEMACHINEDIR/binary/syspkgs. Should be run d579 1 a579 1 release Do a ``make distribution'', build kernels, distribution d582 1 a582 1 described by release(7). This requires that RELEASEDIR be d585 2 a586 2 iso-image Create a NetBSD installation CD-ROM image in the RELEASEDIR/iso directory. The CD-ROM file system will have d590 5 a594 4 will automatically run the sysinst(8) menu-based installa- tion program, which can be used to install or upgrade a NetBSD system. Bootable CD-ROMs also contain tools that may be useful in repairing a damaged NetBSD installation. d600 4 a603 4 the RELEASEDIR/RELEASEMACHINEDIR/installation/cdrom direc- tory by ``make release''. These smaller images usually contain the same tools as the larger images in RELEASEDIR/iso, but do not contain additional content such d607 3 a609 3 creating CD-ROM images. This requires the mkisofs(1) util- ity, which is not part of NetBSD, but which can be installed from pkgsrc/sysutils/cdrtools. d611 1 a611 1 iso-image-source d613 1 a613 1 RELEASEDIR/iso directory. The CD-ROM file system will have d618 5 a622 4 will automatically run the sysinst(8) menu-based installa- tion program, which can be used to install or upgrade a NetBSD system. Bootable CD-ROMs also contain tools that may be useful in repairing a damaged NetBSD installation. d625 2 a626 2 must be populated by ``make sourcesets release'' or equiva- lent. d629 4 a632 4 the RELEASEDIR/RELEASEMACHINEDIR/installation/cdrom direc- tory by ``make release''. These smaller images usually contain the same tools as the larger images in RELEASEDIR/iso, but do not contain additional content such d636 3 a638 3 creating CD-ROM images. This requires the mkisofs(1) util- ity, which is not part of NetBSD, but which can be installed from pkgsrc/sysutils/cdrtools. d640 1 a640 1 install-image d642 1 a642 1 RELEASEDIR/RELEASEMACHINEDIR/installation/installimage d655 1 a655 1 Before ``make install-image'' is attempted, RELEASEDIR must d657 2 a658 2 must have been performed with MKUNPRIVED=yes because ``make install-image'' relies on information in DESTDIR/METALOG. d661 9 a669 9 RELEASEDIR/RELEASEMACHINEDIR/installation/liveimage direc- tory. The live image contains all necessary files to boot NetBSD up to multi-user mode, including all files which should be extracted during installation, NetBSD disklabel, bootloaders, etc. The live image is suitable for use as a disk image in vir- tual machine environments such as QEMU, and also useful to boot NetBSD from a USB flash memory stick on a real d674 2 a675 2 must have been performed with MKUNPRIVED=yes because ``make install-image'' relies on information in DESTDIR/METALOG. d677 1 a677 1 regression-tests d680 3 a682 3 tests on the local host. Note that most tests are now man- aged instead using atf(7); this target should probably run those as well but currently does not. d684 1 a684 1 The "build.sh" script d686 3 a688 3 system on any host with a suitable modern shell and some common utili- ties. The required shell features are described under the HOST_SH vari- able. d694 1 a694 1 /path/to/suitable/shell build.sh [options] d696 2 a697 2 The above command will usually enable build.sh to automatically set HOST_SH=/path/to/suitable/shell, but if that fails, then the following d700 1 a700 1 HOST_SH=/path/to/suitable/shell d702 1 a702 1 ${HOST_SH} build.sh [options] d704 1 a704 1 If build.sh detects that it is being executed under an unsuitable shell, d706 1 a706 1 If HOST_SH is not set explicitly, then build.sh sets a default using d708 2 a709 2 build.sh is executed (if that can be determined), or using the first copy of sh found in PATH. d712 3 a714 3 should make use of build.sh rather than just running ``make''. This way, the make(1) program will be bootstrapped properly, in case the host sys- tem has an older or incompatible ``make'' program. d716 1 a716 1 When compiling the entire system via build.sh, many make(1) variables are d718 1 a718 1 of options below, variables that are automatically set by build.sh are d721 1 a721 1 The following operations are supported by build.sh: d723 4 a726 4 build Build the system as per ``make build''. Before the main part of the build commences, this command runs the obj operation (unless the -o option is given), ``make cleandir'' (unless the -u option is given), and the tools d729 2 a730 2 distribution Build a full distribution as per ``make distribution''. This command first runs the build operation. d732 2 a733 2 release Build a full release as per ``make release''. This command first runs the distribution operation. d735 2 a736 2 makewrapper Create the nbmake-MACHINE wrapper. This operation is auto- matically performed for any of the other operations. d738 1 a738 1 cleandir Perform ``make cleandir''. d740 1 a740 1 obj Perform ``make obj''. d742 4 a745 4 tools Build and install the host tools from src/tools. This com- mand will first run ``make obj'' and ``make cleandir'' in the tools subdirectory unless the -o or -u options (respec- tively) are given. d747 1 a747 1 install=idir Install the contents of DESTDIR to idir, using ``make d752 2 a753 2 kernel=kconf Build a new kernel. The kconf argument is the name of a configuration file suitable for use by config(1). If kconf d755 4 a758 4 is expected to be found in the KERNCONFDIR directory, which is typically sys/arch/MACHINE/conf. The new kernel will be built in a subdirectory of KERNOBJDIR, which is typically sys/arch/MACHINE/compile or an associated object directory. d760 2 a761 2 This command does not imply the tools command; run the tools command first unless it is certain that the tools d765 1 a765 1 question first unless the -u option is given. d767 2 a768 2 modules This command will build kernel modules and install them into DESTDIR. d770 1 a770 1 releasekernel=kconf d772 4 a775 4 kernel=kconf into RELEASEDIR/RELEASEMACHINEDIR/binary/kernel, usually as netbsd-kconf.gz, although the ``netbsd'' prefix is deter- mined from the ``config'' directives in kconf. d777 1 a777 1 sets Perform ``make sets''. d779 1 a779 1 sourcesets Perform ``make sourcesets''. d781 1 a781 1 syspkgs Perform ``make syspkgs''. d783 1 a783 1 iso-image Perform ``make iso-image''. d785 1 a785 1 iso-image-source d788 1 a788 1 install-image d791 1 a791 1 live-image Perform ``make live-image''. d793 1 a793 1 The following command line options alter the behaviour of the build.sh d796 1 a796 1 -a arch Set the value of MACHINE_ARCH to arch. d798 2 a799 2 -B buildid Set the value of BUILDID to buildid. This will also append the d802 1 a802 1 ``nbmake-MACHINE-BUILDID''. d804 4 a807 4 -C cdextras Append cdextras to the CDEXTRA variable, which is a space-sepa- rated list of files or directories that will be added to the CD-ROM image that may be create by the ``iso-image'' or d812 1 a812 1 may be specified via multiple -C options, or via a single d815 8 a822 8 -D dest Set the value of DESTDIR to dest. If a relative path is speci- fied, it will be converted to an absolute path before being used. -E Set `expert' mode. This overrides various sanity checks, and allows: DESTDIR does not have to be set to a non-root path for builds, and MKUNPRIVED=yes does not have to be set when build- ing as a non-root user. d824 1 a824 1 Note: It is highly recommended that you know what you are doing d827 1 a827 1 -h Print a help message. d829 1 a829 1 -j njob Run up to njob make(1) subjobs in parallel; passed through to d831 2 a832 2 out of memory while using build.sh with -j, please save com- plete build logs so the failures can be analyzed. d834 12 a845 11 To achieve the fastest builds, -j values between (1 + the num- ber of CPUs) and (2 * the number of CPUs) are recommended. Use lower values on machines with limited memory or I/O bandwidth. -M obj Set MAKEOBJDIRPREFIX to obj. Unsets MAKEOBJDIR. See ``-O -obj'' for more information. For instance, if the source directory is /usr/src, a setting of ``-M /usr/obj'' will place build-time files under /usr/obj/usr/src/bin, /usr/obj/usr/src/lib, /usr/obj/usr/src/usr.bin, and so forth. d848 6 a853 6 absolute path before being used. build.sh imposes the restric- tion that the argument to the -M option must not begin with a ``$'' (dollar sign) character; otherwise it would be too diffi- cult to determine whether the value is an absolute or a rela- tive path. If the directory does not already exist, build.sh will create it. d855 1 a855 1 -m mach Set the value of MACHINE to mach, except in some special cases d857 3 a859 3 MACHINE_ARCH in the process environment with a value deduced from mach, unless -a is specified. All cross builds require -m, but if unset on a NetBSD host, the host's value of MACHINE d862 3 a864 3 Some machines support multiple values for MACHINE_ARCH. The following special cases for the mach argument are defined to set the listed values of MACHINE and MACHINE_ARCH: d866 1 a866 1 mach MACHINE MACHINE_ARCH d880 1 a880 1 -N noiselevel d882 1 a882 1 MAKEVERBOSE to noiselevel. d884 1 a884 1 -n Show the commands that would be executed by build.sh, but do d888 3 a890 3 -O obj Create an appropriate transform macro for MAKEOBJDIR that will place the built object files under obj. Unsets MAKEOBJDIRPREFIX. d892 2 a893 2 For instance, a setting of ``-O /usr/obj'' will place build- time files under /usr/obj/bin, /usr/obj/lib, /usr/obj/usr.bin, d897 4 a900 4 absolute path before being used. build.sh imposes the restric- tion that the argument to the -O option must not contain a ``$'' (dollar sign) character. If the directory does not already exist, build.sh will create it. d902 2 a903 2 In normal use, exactly one of the -M or -O options should be specified. If neither -M nor -O is specified, then a default d910 1 a910 1 -o Set the value of MKOBJDIRS to ``no''. Otherwise, it will be d912 1 a912 1 behaviour when not using build.sh. d914 1 a914 1 -R rel Set the value of RELEASEDIR to rel. If a relative path is d918 1 a918 1 -r Remove the contents of DESTDIR and TOOLDIR before building d920 1 a920 1 DESTDIR if building on a native system to the root directory. d922 1 a922 1 -S seed Change the value of BUILDSEED to seed. This should rarely be d925 17 a941 17 -T tools Set the value of TOOLDIR to tools. If a relative path is spec- ified, it will be converted to an absolute path before being used. If set, the bootstrap ``make'' will only be rebuilt if the source files for make(1) have changed. -U Set MKUNPRIVED=yes. -u Set MKUPDATE=yes. -V var=[value] Set the environment variable var to an optional value. This is propagated to the nbmake wrapper. -w wrapper Create the nbmake wrapper script (see below) in a custom loca- tion, specified by wrapper. This allows, for instance, to place the wrapper in PATH automatically. Note that wrapper is d946 2 a947 2 -X x11src Set the value of X11SRCDIR to x11src. If a relative path is d951 1 a951 1 -x Set MKX11=yes. d953 2 a954 2 -Z var Unset ("zap") the environment variable var. This is propagated to the nbmake wrapper. d956 3 a958 3 The "nbmake-MACHINE" wrapper script If using the build.sh script to build NetBSD, a nbmake-MACHINE script will be created in TOOLDIR/bin upon the first build to assist in building d961 5 a965 5 nbmake-MACHINE can be invoked in lieu of make(1), and will instead call the up-to-date version of ``nbmake'' installed into TOOLDIR/bin with sev- eral key variables pre-set, including MACHINE, MACHINE_ARCH, and TOOLDIR. nbmake-MACHINE will also set variables specified with -V, and unset vari- ables specified with -Z. d967 1 a967 1 This script can be symlinked into a directory listed in PATH, or called d970 1 a970 1 EXAMPLES d978 2 a979 2 Using unprivileged mode, build a complete distribution to a DESTDIR directory that build.sh selects (and will display). d983 4 a986 4 As root, install to / the distribution that was built by example 2. Even though this is run as root, -U is required so that the permis- sions stored in DESTDIR/METALOG are correctly applied to the files as they're copied to /. d990 3 a992 3 Using unprivileged mode, build a complete release to DESTDIR and RELEASEDIR directories that build.sh selects (and will display). MKUPDATE=yes (-u) is set to prevent the ``make cleandir'', so that d996 2 a997 2 OBSOLETE VARIABLES NBUILDJOBS Use the make(1) option -j instead. d999 1 a999 1 USE_NEW_TOOLCHAIN d1001 1 a1001 1 TOOLCHAIN_MISSING=yes. d1003 1 a1003 1 SEE ALSO d1005 1 a1005 1 pkgsrc/sysutils/cdrtools d1007 3 a1009 3 HISTORY The build.sh based build scheme was introduced for NetBSD 1.6 as USE_NEW_TOOLCHAIN, and re-worked to TOOLCHAIN_MISSING after that. d1011 1 a1011 1 NetBSD September 19, 2012 NetBSD @ 1.102 log @regen @ text @d207 1 a207 1 Default: ``yes'' @ 1.101 log @regen using 'make regen' in doc/ @ text @d316 3 a318 3 Can be set to ``yes'' or ``no''. Indicates whether program binaries and shared libraries should be built to include RCS IDs for use with ident(1). d560 2 a561 3 update files in INSTALLWORLDDIR/etc and that you use postinstall(8) to check for inconsistencies (and possibly to fix them). d1005 1 a1005 1 NetBSD May 25, 2012 NetBSD @ 1.101.2.1 log @Resync to 2012-11-19 00:00:00 UTC @ text @d207 1 a207 1 Default: ``no'' d316 3 a318 3 Can be set to ``yes'' or ``no''. Indicates whether RCS IDs, for use with ident(1), should be stripped from program bina- ries and shared libraries. d560 3 a562 2 update files in INSTALLWORLDDIR/etc, and postinstall(8) to check for or fix inconsistencies. d1006 1 a1006 1 NetBSD September 19, 2012 NetBSD @ 1.101.2.2 log @resync from head @ text @d1 1 a1 1 BUILDING(8) System Manager's Manual BUILDING(8) d46 5 a50 5 Sources imported verbatim from third parties, without mangling the existing build structure. Other source trees in bin through usr.sbin use the NetBSD make(1) ``reachover'' Makefile semantics when building these programs for a native host. d53 3 a55 3 Sources for items used when making a full release snapshot, such as files installed in DESTDIR/etc on the destination system, boot media, and release notes. d66 2 a67 2 This has a special method of determining out-of-date status. d90 2 a91 2 functions (which is a widely-implemented but non- standardised feature). d98 4 a101 4 Most parts of the build require HOST_SH to be an absolute path; however, build.sh allows it to be a simple command name, which will be converted to an absolute path by searching the PATH. d114 13 a126 14 ignores the value of MAKEFLAGS passed in the environment, but allows MAKEFLAGS to be set via the -V option. MAKEOBJDIR Directory to use as the .OBJDIR for the current directory. The value is subjected to variable expansion by make(1). Typical usage is to set this variable to a value involving the use of `${.CURDIR:S...}' or `${.CURDIR:C...}', to derive the value of .OBJDIR from the value of .CURDIR. Used only if MAKEOBJDIRPREFIX is not defined. MAKEOBJDIR can be provided only in the environment or via the -O flag of build.sh; it cannot usefully be set inside a Makefile, including mk.conf or ${MAKECONF}. d134 7 a140 7 value is defined and valid, then ${MAKEOBJDIRPREFIX}/${.CURDIR} is used as the .OBJDIR for the current directory. The current directory may be read only. MAKEOBJDIRPREFIX can be provided only in the environment or via the -M flag of build.sh; it cannot usefully be set inside a Makefile, including mk.conf or ${MAKECONF}. d143 3 a145 3 Several variables control the behavior of NetBSD builds. Unless otherwise specified, these variables may be set in either the process environment or the make(1) configuration file specified by MAKECONF. d149 2 a150 2 configuration file in order to set additional build parameters, such as compiler flags. d152 11 a162 12 BUILDSEED GCC uses random numbers when compiling C++ code. This variable seeds the gcc random number generator using the -frandom-seed flag with this value. By default, it is set to NetBSD-(majorversion). Using a fixed value causes C++ binaries to be the same when built from the same sources, resulting in identical (reproducible) builds. Additional information is available in the GCC documentation of -frandom-seed. DESTDIR Directory to contain the built NetBSD system. If set, special options are passed to the compilation tools to prevent their default use of the host system's /usr/include, d169 2 a170 2 Default: Empty string if USETOOLS is ``yes''; unset otherwise. d187 2 a188 2 but the actual commands executed by make(1) are not displayed. d204 2 a205 3 MKCATPAGES Can be set to ``yes'' or ``no''. Indicates whether preformatted plaintext manual pages will be created during a build. d209 5 a213 5 MKCRYPTO Can be set to ``yes'' or ``no''. Indicates whether cryptographic code will be included in a build; provided for the benefit of countries that do not allow strong cryptography. Will not affect use of the standard low- security password encryption system, crypt(3). d223 2 a224 2 MKHTML Can be set to ``yes'' or ``no''. Indicates whether preformatted HTML manual pages will be built and installed d283 2 a284 2 Default: Platform dependent. As of this writing, all platforms except sh3 default to ``yes''. d317 2 a318 2 for use with ident(1), should be stripped from program binaries and shared libraries. d323 2 a324 2 unprivileged install will occur. The user, group, permissions, and file flags, will not be set on the installed d347 5 a351 5 a given host system and NetBSD source tree. (However, multiple targets may share the same TOOLDIR; the target- dependent files have unique names.) If unset, a default based on the uname(1) information of the host platform will be created in the .OBJDIR of src. d366 6 a371 6 native tool components. This is similar to the traditional NetBSD build method, but does not verify that the compilation tools in use are up-to-date enough in order to build the tree successfully. This may cause build or runtime problems when building the whole NetBSD source tree. d409 4 a412 4 MKUPDATE Can be set to ``yes'' or ``no''. If set, then in addition to the effects described for MKUPDATE=yes above, this implies the effects of NOCLEANDIR (i.e., ``make cleandir'' is avoided). d469 5 a473 5 -m dir Specify the default directory for searching for system Makefile segments, mainly the files. When building any full NetBSD source tree, this should be set to the ``share/mk'' directory in the source tree. This is set automatically when building from the top level, or when using d483 3 a485 3 var=value Set the variable var to value, overriding any setting specified by the process environment, the MAKECONF configuration file, or the system Makefile segments. d547 2 a548 2 INSTALLWORLDDIR is not the root directory if cross compiling. d587 4 a590 5 will automatically run the sysinst(8) menu-based installation program, which can be used to install or upgrade a NetBSD system. Bootable CD-ROMs also contain tools that may be useful in repairing a damaged NetBSD installation. d596 3 a598 3 the RELEASEDIR/RELEASEMACHINEDIR/installation/cdrom directory by ``make release''. These smaller images usually contain the same tools as the larger images in d603 2 a604 2 creating CD-ROM images. This requires the mkisofs(1) utility, which is not part of NetBSD, but which can be d614 4 a617 5 will automatically run the sysinst(8) menu-based installation program, which can be used to install or upgrade a NetBSD system. Bootable CD-ROMs also contain tools that may be useful in repairing a damaged NetBSD installation. d620 2 a621 2 must be populated by ``make sourcesets release'' or equivalent. d624 3 a626 3 the RELEASEDIR/RELEASEMACHINEDIR/installation/cdrom directory by ``make release''. These smaller images usually contain the same tools as the larger images in d631 2 a632 2 creating CD-ROM images. This requires the mkisofs(1) utility, which is not part of NetBSD, but which can be d656 9 a664 9 RELEASEDIR/RELEASEMACHINEDIR/installation/liveimage directory. The live image contains all necessary files to boot NetBSD up to multi-user mode, including all files which should be extracted during installation, NetBSD disklabel, bootloaders, etc. The live image is suitable for use as a disk image in virtual machine environments such as QEMU, and also useful to boot NetBSD from a USB flash memory stick on a real d675 3 a677 3 tests on the local host. Note that most tests are now managed instead using atf(7); this target should probably run those as well but currently does not. d681 3 a683 3 system on any host with a suitable modern shell and some common utilities. The required shell features are described under the HOST_SH variable. d708 2 a709 2 the make(1) program will be bootstrapped properly, in case the host system has an older or incompatible ``make'' program. d730 2 a731 2 makewrapper Create the nbmake-MACHINE wrapper. This operation is automatically performed for any of the other operations. d737 4 a740 4 tools Build and install the host tools from src/tools. This command will first run ``make obj'' and ``make cleandir'' in the tools subdirectory unless the -o or -u options (respectively) are given. d769 2 a770 2 netbsd-kconf.gz, although the ``netbsd'' prefix is determined from the ``config'' directives in kconf. d800 3 a802 3 Append cdextras to the CDEXTRA variable, which is a space- separated list of files or directories that will be added to the CD-ROM image that may be create by the ``iso-image'' or d810 3 a812 3 -D dest Set the value of DESTDIR to dest. If a relative path is specified, it will be converted to an absolute path before being used. d816 2 a817 2 builds, and MKUNPRIVED=yes does not have to be set when building as a non-root user. d826 2 a827 2 out of memory while using build.sh with -j, please save complete build logs so the failures can be analyzed. d829 3 a831 4 To achieve the fastest builds, -j values between (1 + the number of CPUs) and (2 * the number of CPUs) are recommended. Use lower values on machines with limited memory or I/O bandwidth. d842 6 a847 6 absolute path before being used. build.sh imposes the restriction that the argument to the -M option must not begin with a ``$'' (dollar sign) character; otherwise it would be too difficult to determine whether the value is an absolute or a relative path. If the directory does not already exist, build.sh will create it. d891 3 a893 3 absolute path before being used. build.sh imposes the restriction that the argument to the -O option must not contain a ``$'' (dollar sign) character. If the directory does not d919 4 a922 4 -T tools Set the value of TOOLDIR to tools. If a relative path is specified, it will be converted to an absolute path before being used. If set, the bootstrap ``make'' will only be rebuilt if the source files for make(1) have changed. d933 2 a934 2 Create the nbmake wrapper script (see below) in a custom location, specified by wrapper. This allows, for instance, to d956 4 a959 4 the up-to-date version of ``nbmake'' installed into TOOLDIR/bin with several key variables pre-set, including MACHINE, MACHINE_ARCH, and TOOLDIR. nbmake-MACHINE will also set variables specified with -V, and unset variables specified with -Z. d978 3 a980 3 Even though this is run as root, -U is required so that the permissions stored in DESTDIR/METALOG are correctly applied to the files as they're copied to /. d1005 1 a1005 1 NetBSD November 8, 2012 NetBSD @ 1.101.2.3 log @Rebase to HEAD as of a few days ago. @ text @a51 6 external, sys/external Sources and build infrastructure for components imported (mostly) unchanged from upstream maintainers, sorted by applicable license. This is (slowly) replacing the crypto/dist, dist, and gnu/dist directories. d148 2 a149 4 BUILDID Identifier for the build. If set, this should be a short string that is suitable for use as part of a file or directory name. The identifier will be appended to object directory names, and can be consulted in the make(1) d151 1 a151 16 parameters, such as compiler flags. It will also be used as part of the kernel version string, which can be printed by ``uname -v''. Default: Unset. BUILDINFO This may be a multi-line string containing information about the build. This will appear in DESTDIR/etc/release, and it will be stored in the buildinfo variable in any kernels that are built. When such kernels are booted, the sysctl(7) kern.buildinfo variable will report this value. The string may contain backslash escape sequences, such as ``\\'' (representing a backslash character) and ``\n'' (representing a newline). Default: Unset. a211 5 MKCROSSGDB Can be set to ``yes'' or ``no''. Create a cross-gdb as a host tool. Default: ``no'' a219 13 MKDEBUG Can be set to ``yes'' or ``no''. Indicates whether debug information should be generated for all userland binaries compiled. The result is collected as an additional debug.tgz and xdebug.tgz set and installed in /usr/libdata/debug. Default: ``no'' MKDEBUGLIB Can be set to ``yes'' or ``no''. Indicates whether debug information (see MKDEBUG) should also be generated for all libraries build. Default: ``no'' a247 8 MKKDEBUG Can be set to ``yes'' or ``no''. Force generation of full- debug symbol versions of all kernels compiled. Alongside of the netbsd kernel file, an unstripped version netbsd.gdb is created. This is useful if a cross-gdb is built as well (see MKCROSSGDB). Default: ``no'' a766 7 kernel.gdb=kconf Build a new kernel with debug information. Similar to the above kernel=kconf operation, but creates a netbsd.gdb file alongside of the kernel netbsd, which contains a full symbol table and can be used for debugging (for example with a cross-gdb built by MKCROSSGDB). a792 10 list-arch Prints a list of valid MACHINE and MACHINE_ARCH settings, the default MACHINE_ARCH for each MACHINE, and aliases for MACHINE/MACHINE_ARCH pairs, and then exits. The -m or -a options (or both) may be used to specify glob patterns that will be used to narrow the list of results; for example, ``build.sh -m 'evm*' -a '*arm*' list-arch'' will list all known MACHINE/MACHINE_ARCH values in which either MACHINE or ALIAS matches the pattern `evb*', and MACHINE_ARCH matches the pattern `*arm*'. d796 1 a796 2 -a arch Set the value of MACHINE_ARCH to arch. See the -m option for more information. d840 1 a840 1 obj'' for more information. d855 24 a878 13 -m mach Set the value of MACHINE to mach, unless the mach argument is an alias that refers to a MACHINE/MACHINE_ARCH pair, in which case both MACHINE and MACHINE_ARCH are set from the alias. Such aliases are interpreted entirely by build.sh; they are not used by any other part of the build system. The MACHINE_ARCH setting implied by mach will override any value of MACHINE_ARCH in the process environment, but will not override a value set by the -a option. All cross builds require -m, but if unset on a NetBSD host, the host's value of MACHINE will be detected and used automatically. See the list-arch operation for a way to get a list of valid MACHINE and MACHINE_ARCH settings. a909 10 Note that placing the obj directory location outside of the default source tree hierarchy makes it easier to manually clear out old files in the event the ``make cleandir'' operation is unable to do so. (See CAVEATS below.) Note also that use of one of -M or -O is the only means of building multiple machine architecture userlands from the same source tree without cleaning between builds (in which case, one would specify distinct obj locations for each). d1011 1 a1011 7 CAVEATS After significant updates to third-party components in the source tree, the ``make cleandir'' operation may be insufficient to clean out old files in object directories. Instead, one may have to manually remove the files. Consult the UPDATING file for notices concerning this. NetBSD August 7, 2014 NetBSD @ 1.100 log @Document MKREPRO using joerg's wording. @ text @d1 1 a1 1 BUILDING(8) System Manager's Manual BUILDING(8) d3 2 a4 2 NNAAMMEE BBUUIILLDDIINNGG -- Procedure for building NetBSD from source code. d6 1 a6 1 RREEQQUUIIRREEMMEENNTTSS d8 2 a9 2 The basic build procedure is the same whether compiling _n_a_t_i_v_e_l_y (on the same NetBSD architecture) or _c_r_o_s_s _c_o_m_p_i_l_i_n_g (on another architecture or d15 1 a15 1 toolchain (mmaakkee is not required); all other tools are created as part of d19 3 a21 3 FFIILLEESS SSoouurrccee ttrreeee llaayyoouutt ddoocc//BBUUIILLDDIINNGG..mmddoocc d24 1 a24 1 BBUUIILLDDIINNGG This document (in plaintext). d26 1 a26 1 ttoooollss//ccoommppaatt//RREEAADDMMEE d30 1 a30 1 MMaakkeeffiillee The main Makefile for NetBSD; should only be run for d33 1 a33 1 on a non-native host, see the bbuuiilldd..sshh shell script.) d35 1 a35 1 UUPPDDAATTIINNGG Special notes for updating from an earlier revision of d39 1 a39 1 bbuuiilldd..sshh Bourne-compatible shell script used for building the host d45 11 a55 11 ccrryyppttoo//ddiisstt//, ddiisstt//, ggnnuu//ddiisstt// Sources imported verbatim from third parties, without mangling the existing build structure. Other source trees in bbiinn through uussrr..ssbbiinn use the NetBSD make(1) ``reachover'' Makefile semantics when building these programs for a native host. ddiissttrriibb//, eettcc// Sources for items used when making a full release snapshot, such as files installed in DDEESSTTDDIIRR_/_e_t_c on the destination system, boot media, and release notes. d57 1 a57 1 tteessttss//, rreeggrreessss// d59 2 a60 2 run natively. _t_e_s_t_s_/ uses the atf(7) test framework; _r_e_g_r_e_s_s_/ contains older tests that have not yet been d63 1 a63 1 ssyyss// NetBSD kernel sources. d65 3 a67 3 ttoooollss// ``Reachover'' build structure for the host build tools. This has a special method of determining out-of-date status. d69 1 a69 1 bbiinn// ...... uussrr..ssbbiinn// d74 2 a75 2 xx1111// ``Reachover'' build structure for X11R6; the source is in XX1111SSRRCCDDIIRR. d77 1 a77 1 BBuuiilldd ttrreeee llaayyoouutt d81 2 a82 2 CCOONNFFIIGGUURRAATTIIOONN EEnnvviirroonnmmeenntt vvaarriiaabblleess d85 1 a85 1 HHOOSSTT__SSHH Path name to a shell available on the host system and d90 2 a91 2 functions (which is a widely-implemented but non- standardised feature). d94 1 a94 1 _/_b_i_n_/_s_h, _/_u_s_r_/_x_p_g_4_/_b_i_n_/_s_h, _/_b_i_n_/_k_s_h (provided it is a d96 1 a96 1 such as ksh88, but not ksh93), or _/_u_s_r_/_l_o_c_a_l_/_b_i_n_/_b_a_s_h. d98 4 a101 4 Most parts of the build require HHOOSSTT__SSHH to be an absolute path; however, bbuuiilldd..sshh allows it to be a simple command name, which will be converted to an absolute path by searching the PPAATTHH. d103 1 a103 1 HHOOSSTT__CCCC Path name to C compiler used to create the toolchain. d105 1 a105 1 HHOOSSTT__CCXXXX Path name to C++ compiler used to create the toolchain. d107 1 a107 1 MMAACCHHIINNEE Machine type, e.g., ``macppc''. d109 1 a109 1 MMAACCHHIINNEE__AARRCCHH Machine architecture, e.g., ``powerpc''. d111 1 a111 1 MMAAKKEE Path name to invoke make(1) as. d113 3 a115 4 MMAAKKEEFFLLAAGGSS Flags to invoke make(1) with. Note that bbuuiilldd..sshh ignores the value of MMAAKKEEFFLLAAGGSS passed in the environment, but allows MMAAKKEEFFLLAAGGSS to be set via the --VV option. d117 10 a126 10 MMAAKKEEOOBBJJDDIIRR Directory to use as the ..OOBBJJDDIIRR for the current directory. The value is subjected to variable expansion by make(1). Typical usage is to set this variable to a value involving the use of `${.CURDIR:S...}' or `${.CURDIR:C...}', to derive the value of ..OOBBJJDDIIRR from the value of ..CCUURRDDIIRR. Used only if MMAAKKEEOOBBJJDDIIRRPPRREEFFIIXX is not defined. MMAAKKEEOOBBJJDDIIRR can be provided only in the environment or via the --OO flag of bbuuiilldd..sshh; it cannot usefully be set inside a Makefile, including _m_k_._c_o_n_f or $${{MMAAKKEECCOONNFF}}. d128 1 a128 1 MMAAKKEEOOBBJJDDIIRRPPRREEFFIIXX Top level directory of the object directory tree. The d130 2 a131 2 bbuuiilldd..sshh will create the ${MAKEOBJDIRPREFIX} directory if necessary, but if make(1) is used without bbuuiilldd..sshh, d134 12 a145 12 value is defined and valid, then ${MAKEOBJDIRPREFIX}/${.CURDIR} is used as the ..OOBBJJDDIIRR for the current directory. The current directory may be read only. MMAAKKEEOOBBJJDDIIRRPPRREEFFIIXX can be provided only in the environment or via the --MM flag of bbuuiilldd..sshh; it cannot usefully be set inside a Makefile, including _m_k_._c_o_n_f or $${{MMAAKKEECCOONNFF}}. ""mmaakkee"" vvaarriiaabblleess Several variables control the behavior of NetBSD builds. Unless otherwise specified, these variables may be set in either the process environment or the make(1) configuration file specified by MMAAKKEECCOONNFF. d147 1 a147 1 BBUUIILLDDIIDD Identifier for the build. The identifier will be appended to d149 2 a150 2 configuration file in order to set additional build parameters, such as compiler flags. d152 14 a165 15 BBUUIILLDDSSEEEEDD GCC uses random numbers when compiling C++ code. This variable seeds the gcc random number generator using the -frandom-seed flag with this value. By default, it is set to NetBSD-(majorversion). Using a fixed value causes C++ binaries to be the same when built from the same sources, resulting in identical (reproducible) builds. Additional information is available in the GCC documentation of -frandom-seed. DDEESSTTDDIIRR Directory to contain the built NetBSD system. If set, special options are passed to the compilation tools to prevent their default use of the host system's //uussrr//iinncclluuddee, //uussrr//lliibb, and so forth. This pathname must be an absolute path, and should _n_o_t end with a slash (/) character. (For installation into the system's root directory, set DDEESSTTDDIIRR to d169 2 a170 2 _D_e_f_a_u_l_t: Empty string if UUSSEETTOOOOLLSS is ``yes''; unset otherwise. d172 2 a173 2 _N_o_t_e: bbuuiilldd..sshh will provide a default of _d_e_s_t_d_i_r_.MMAACCHHIINNEE (in the top-level ..OOBBJJDDIIRR) unless run in `expert' mode. d175 2 a176 2 MMAAKKEECCOONNFF The name of the make(1) configuration file. _O_n_l_y _s_e_t_t_a_b_l_e _i_n _t_h_e _p_r_o_c_e_s_s _e_n_v_i_r_o_n_m_e_n_t_. d178 1 a178 1 _D_e_f_a_u_l_t: ``/etc/mk.conf'' d180 1 a180 1 MMAAKKEEVVEERRBBOOSSEE d187 2 a188 2 but the actual commands executed by make(1) are not displayed. d200 1 a200 1 are traced through use of the sh(1) ``--xx'' flag. d202 1 a202 1 _D_e_f_a_u_l_t: 2 d204 2 a205 3 MMKKCCAATTPPAAGGEESS Can be set to ``yes'' or ``no''. Indicates whether preformatted plaintext manual pages will be created during a build. d207 1 a207 1 _D_e_f_a_u_l_t: ``yes'' d209 5 a213 5 MMKKCCRRYYPPTTOO Can be set to ``yes'' or ``no''. Indicates whether cryptographic code will be included in a build; provided for the benefit of countries that do not allow strong cryptography. Will not affect use of the standard low- security password encryption system, crypt(3). d215 1 a215 1 _D_e_f_a_u_l_t: ``yes'' d217 2 a218 2 MMKKDDOOCC Can be set to ``yes'' or ``no''. Indicates whether system documentation destined for DDEESSTTDDIIRR_/_u_s_r_/_s_h_a_r_e_/_d_o_c will be d221 1 a221 1 _D_e_f_a_u_l_t: ``yes'' d223 2 a224 2 MMKKHHTTMMLL Can be set to ``yes'' or ``no''. Indicates whether preformatted HTML manual pages will be built and installed d226 1 a226 1 _D_e_f_a_u_l_t: ``yes'' d228 1 a228 1 MMKKHHOOSSTTOOBBJJ Can be set to ``yes'' or ``no''. If set to ``yes'', then for d237 1 a237 1 _D_e_f_a_u_l_t: ``no'' d239 1 a239 1 MMKKIINNFFOO Can be set to ``yes'' or ``no''. Indicates whether GNU Info d243 1 a243 1 _D_e_f_a_u_l_t: ``yes'' d245 1 a245 1 MMKKKKMMOODD Can be set to ``yes'' or ``no''. Indicates whether kernel d248 1 a248 1 _D_e_f_a_u_l_t: ``yes'' d250 1 a250 1 MMKKLLIINNTT Can be set to ``yes'' or ``no''. Indicates whether lint(1) d253 1 a253 1 DDEESSTTDDIIRR_/_u_s_r_/_l_i_b_d_a_t_a_/_l_i_n_t. d255 1 a255 1 _D_e_f_a_u_l_t: ``yes'' d257 1 a257 1 MMKKMMAANN Can be set to ``yes'' or ``no''. Indicates whether manual d260 1 a260 1 _D_e_f_a_u_l_t: ``yes'' d262 1 a262 1 MMKKNNLLSS Can be set to ``yes'' or ``no''. Indicates whether Native d266 1 a266 1 _D_e_f_a_u_l_t: ``yes'' d268 1 a268 1 MMKKOOBBJJ Can be set to ``yes'' or ``no''. Indicates whether object d273 1 a273 1 _D_e_f_a_u_l_t: ``yes'' d275 1 a275 1 Note that setting MMKKOOBBJJ to ``no'' is not recommended and may d278 1 a278 1 MMKKPPIICC Can be set to ``yes'' or ``no''. Indicates whether shared d283 2 a284 2 _D_e_f_a_u_l_t: Platform dependent. As of this writing, all platforms except sshh33 default to ``yes''. d286 1 a286 1 MMKKPPIICCIINNSSTTAALLLL d288 1 a288 1 format libraries (lliibb**__ppiicc..aa), used to generate shared d291 1 a291 1 _D_e_f_a_u_l_t: ``yes'' d293 2 a294 2 MMKKPPRROOFFIILLEE Can be set to ``yes'' or ``no''. Indicates whether profiled libraries (lliibb**__pp..aa) will be built and installed during a d297 1 a297 1 _D_e_f_a_u_l_t: ``yes''; however, some platforms turn off MMKKPPRROOFFIILLEE d301 1 a301 1 MMKKRREEPPRROO Can be set to ``yes'' or ``no''. Create reproducable builds. d305 1 a305 1 _D_e_f_a_u_l_t: ``no'' d307 2 a308 2 MMKKSSHHAARREE Can be set to ``yes'' or ``no''. Indicates whether files destined to reside in DDEESSTTDDIIRR_/_u_s_r_/_s_h_a_r_e will be built and d310 1 a310 1 MMKKCCAATTPPAAGGEESS, MMKKDDOOCC, MMKKIINNFFOO, MMKKMMAANN, and MMKKNNLLSS will be set to d313 1 a313 1 _D_e_f_a_u_l_t: ``yes'' d315 1 a315 1 MMKKSSTTRRIIPPIIDDEENNTT d320 1 a320 1 _D_e_f_a_u_l_t: ``no'' d322 3 a324 3 MMKKUUNNPPRRIIVVEEDD Can be set to ``yes'' or ``no''. Indicates whether an unprivileged install will occur. The user, group, permissions, and file flags, will not be set on the installed d326 1 a326 1 called _M_E_T_A_L_O_G in DDEESSTTDDIIRR. The contents of _M_E_T_A_L_O_G are used d330 1 a330 1 _D_e_f_a_u_l_t: ``no'' d332 2 a333 2 MMKKUUPPDDAATTEE Can be set to ``yes'' or ``no''. Indicates whether all install operations intended to write to DDEESSTTDDIIRR will compare d338 1 a338 1 _D_e_f_a_u_l_t: ``no'' d340 2 a341 2 MMKKXX1111 Can be set to ``yes'' or ``no''. Indicates whether X11 is built from XX1111SSRRCCDDIIRR. d343 1 a343 1 _D_e_f_a_u_l_t: ``no'' d345 1 a345 1 TTOOOOLLDDIIRR Directory to hold the host tools, once built. If specified, d347 5 a351 5 a given host system and NetBSD source tree. (However, multiple targets may share the same TTOOOOLLDDIIRR; the target- dependent files have unique names.) If unset, a default based on the uname(1) information of the host platform will be created in the ..OOBBJJDDIIRR of _s_r_c. d353 1 a353 1 _D_e_f_a_u_l_t: Unset. d355 1 a355 1 UUSSEETTOOOOLLSS Indicates whether the tools specified by TTOOOOLLDDIIRR should be d359 1 a359 1 yyeess Use the tools from TTOOOOLLDDIIRR. d361 1 a361 1 nnoo Do not use the tools from TTOOOOLLDDIIRR, but refuse to build d365 7 a371 7 nneevveerr Do not use the tools from TTOOOOLLDDIIRR, even when building native tool components. This is similar to the traditional NetBSD build method, but does _n_o_t verify that the compilation tools in use are up-to-date enough in order to build the tree successfully. This may cause build or runtime problems when building the whole NetBSD source tree. d373 1 a373 1 _D_e_f_a_u_l_t: ``yes'', unless TTOOOOLLCCHHAAIINN__MMIISSSSIINNGG is set to ``yes''. d375 1 a375 1 UUSSEETTOOOOLLSS is also set to ``no'' when using outside d378 1 a378 1 XX1111SSRRCCDDIIRR Directory containing the X11R6 source. If specified, must be d380 1 a380 1 XX1111SSRRCCDDIIRR_/_x_f_r_e_e_/_x_c. d382 2 a383 2 _D_e_f_a_u_l_t: NNEETTBBSSDDRRCCDDIIRR_/_._._/_x_s_r_c, if that exists; otherwise _/_u_s_r_/_x_s_r_c. d385 1 a385 1 XX1111FFLLAAVVOOUURR The style of X11 cross-built, set to either ``Xorg'' or d388 1 a388 1 _D_e_f_a_u_l_t: ``Xorg'' on amd64, i386, macppc, shark and sparc64 d391 1 a391 1 ""mmaakkee"" vvaarriiaabblleess ffoorr ffuullll bbuuiillddss d395 1 a395 1 IINNSSTTAALLLLWWOORRLLDDDDIIRR Location for the ``make installworld'' target to install d398 1 a398 1 _D_e_f_a_u_l_t: ``/'' d400 1 a400 1 MMKKOOBBJJDDIIRRSS Can be set to ``yes'' or ``no''. Indicates whether d404 1 a404 1 _D_e_f_a_u_l_t: ``no'' d406 2 a407 2 If using bbuuiilldd..sshh, the default is ``yes''. This may be set back to ``no'' by giving bbuuiilldd..sshh the --oo option. d409 4 a412 4 MMKKUUPPDDAATTEE Can be set to ``yes'' or ``no''. If set, then in addition to the effects described for MMKKUUPPDDAATTEE==yyeess above, this implies the effects of NNOOCCLLEEAANNDDIIRR (i.e., ``make cleandir'' is avoided). d414 1 a414 1 _D_e_f_a_u_l_t: ``no'' d416 1 a416 1 If using bbuuiilldd..sshh, this may be set by giving the --uu d419 1 a419 1 NNBBUUIILLDDJJOOBBSS Now obsolete. Use the make(1) option --jj, instead. See d422 1 a422 1 _D_e_f_a_u_l_t: Unset. d424 1 a424 1 NNOOCCLLEEAANNDDIIRR If set, avoids the ``make cleandir'' phase of a full d429 1 a429 1 _D_e_f_a_u_l_t: Unset. d431 1 a431 1 See also MMKKUUPPDDAATTEE. d433 2 a434 2 NNOODDIISSTTRRIIBBDDIIRRSS If set, avoids the ``make distrib-dirs'' phase of a full build. This skips running mtree(8) on DDEESSTTDDIIRR, useful d439 1 a439 1 _D_e_f_a_u_l_t: Unset. d441 1 a441 1 NNOOIINNCCLLUUDDEESS If set, avoids the ``make includes'' phase of a full d447 1 a447 1 MMKKUUPPDDAATTEE==yyeess instead in that case. d449 1 a449 1 _D_e_f_a_u_l_t: Unset. d451 1 a451 1 RREELLEEAASSEEDDIIRR If set, specifies the directory to which a release(7) d455 1 a455 1 _D_e_f_a_u_l_t: Unset. d457 2 a458 2 _N_o_t_e: bbuuiilldd..sshh will provide a default of _r_e_l_e_a_s_e_d_i_r (in the top-level ..OOBBJJDDIIRR) unless run in `expert' mode. d460 2 a461 2 BBUUIILLDDIINNGG ""mmaakkee"" ccoommmmaanndd lliinnee ooppttiioonnss d465 1 a465 1 --jj _n_j_o_b Run up to _n_j_o_b make(1) subjobs in parallel. Makefiles should d469 6 a474 6 --mm _d_i_r Specify the default directory for searching for system Makefile segments, mainly the files. When building any full NetBSD source tree, this should be set to the ``share/mk'' directory in the source tree. This is set automatically when building from the top level, or when using bbuuiilldd..sshh. d476 1 a476 1 --nn Display the commands that would have been executed, but do not d480 1 a480 1 --VV _v_a_r Print make(1)'s idea of the value of _v_a_r. Does not build any d483 3 a485 3 _v_a_r_=_v_a_l_u_e Set the variable _v_a_r to _v_a_l_u_e, overriding any setting specified by the process environment, the MMAAKKEECCOONNFF configuration file, or the system Makefile segments. d487 1 a487 1 ""mmaakkee"" ttaarrggeettss d493 1 a493 1 aallll Build programs, libraries, and preformatted documentation. d495 1 a495 1 cclleeaann Remove program and library object code files. d497 1 a497 1 cclleeaannddiirr Same as cclleeaann, but also remove preformatted documentation, d501 1 a501 1 ddeeppeenndd Create dependency files (..ddeeppeenndd) containing more detailed d506 1 a506 1 ddeeppeennddaallll Does a ``make depend'' immediately followed by a ``make all''. d510 1 a510 1 ddiissttcclleeaann Synonym for cclleeaannddiirr. d512 1 a512 1 iinncclluuddeess Build and install system header files. Typically needed d515 3 a517 3 iinnssttaallll Install programs, libraries, and documentation into DDEESSTTDDIIRR. Few files will be installed to DDEESSTTDDIIRR_/_d_e_v, DDEESSTTDDIIRR_/_e_t_c, DDEESSTTDDIIRR_/_r_o_o_t or DDEESSTTDDIIRR_/_v_a_r in order to prevent user supplied d520 1 a520 1 lliinntt Run lint(1) against the C source code, where appropriate, and d523 1 a523 1 oobbjj Create object directories to be used for built files, instead d526 1 a526 1 ttaaggss Create ctags(1) searchable function lists usable by the ex(1) d529 1 a529 1 ""mmaakkee"" ttaarrggeettss ffoorr tthhee ttoopp lleevveell d533 1 a533 1 bbuuiilldd Build the entire NetBSD system (except the kernel). This d537 4 a540 4 ddiissttrriibbuuttiioonn Do a ``make build'', and then install a full distribution (which does not include a kernel) into DDEESSTTDDIIRR, including files in DDEESSTTDDIIRR_/_d_e_v, DDEESSTTDDIIRR_/_e_t_c, DDEESSTTDDIIRR_/_r_o_o_t and DDEESSTTDDIIRR_/_v_a_r. d542 2 a543 2 bbuuiillddwwoorrlldd As per ``make distribution'', except that it ensures that DDEESSTTDDIIRR is not the root directory. d545 1 a545 1 iinnssttaallllwwoorrlldd Install the distribution from DDEESSTTDDIIRR to IINNSSTTAALLLLWWOORRLLDDDDIIRR, d547 2 a548 2 IINNSSTTAALLLLWWOORRLLDDDDIIRR is not the root directory if cross compiling. d550 1 a550 1 The IINNSSTTAALLLLSSEETTSS environment variable may be set to a space- d553 1 a553 1 installed, so most files in IINNSSTTAALLLLWWOORRLLDDDDIIRR_/_e_t_c will not be d556 2 a557 2 _N_o_t_e: Before performing this operation with IINNSSTTAALLLLWWOORRLLDDDDIIRR=_/, it is highly recommended that you d560 1 a560 1 update files in IINNSSTTAALLLLWWOORRLLDDDDIIRR_/_e_t_c and that you use d564 2 a565 2 sseettss Create distribution sets from DDEESSTTDDIIRR into RREELLEEAASSEEDDIIRR//RREELLEEAASSEEMMAACCHHIINNEEDDIIRR_/_b_i_n_a_r_y_/_s_e_t_s. Should be run d569 2 a570 2 ssoouurrcceesseettss Create source sets of the source tree into RREELLEEAASSEEDDIIRR_/_s_o_u_r_c_e_/_s_e_t_s. d572 2 a573 2 ssyyssppkkggss Create syspkgs from DDEESSTTDDIIRR into RREELLEEAASSEEDDIIRR//RREELLEEAASSEEMMAACCHHIINNEEDDIIRR_/_b_i_n_a_r_y_/_s_y_s_p_k_g_s. Should be run d577 1 a577 1 rreelleeaassee Do a ``make distribution'', build kernels, distribution d580 1 a580 1 described by release(7). This requires that RREELLEEAASSEEDDIIRR be d583 2 a584 2 iissoo--iimmaaggee Create a NetBSD installation CD-ROM image in the RREELLEEAASSEEDDIIRR_/_i_s_o directory. The CD-ROM file system will have d588 4 a591 5 will automatically run the sysinst(8) menu-based installation program, which can be used to install or upgrade a NetBSD system. Bootable CD-ROMs also contain tools that may be useful in repairing a damaged NetBSD installation. d597 4 a600 4 the RREELLEEAASSEEDDIIRR//RREELLEEAASSEEMMAACCHHIINNEEDDIIRR_/_i_n_s_t_a_l_l_a_t_i_o_n_/_c_d_r_o_m directory by ``make release''. These smaller images usually contain the same tools as the larger images in RREELLEEAASSEEDDIIRR_/_i_s_o, but do not contain additional content such d604 3 a606 3 creating CD-ROM images. This requires the mkisofs(1) utility, which is not part of NetBSD, but which can be installed from _p_k_g_s_r_c_/_s_y_s_u_t_i_l_s_/_c_d_r_t_o_o_l_s. d608 1 a608 1 iissoo--iimmaaggee--ssoouurrccee d610 1 a610 1 RREELLEEAASSEEDDIIRR_/_i_s_o directory. The CD-ROM file system will have d615 4 a618 5 will automatically run the sysinst(8) menu-based installation program, which can be used to install or upgrade a NetBSD system. Bootable CD-ROMs also contain tools that may be useful in repairing a damaged NetBSD installation. d621 2 a622 2 must be populated by ``make sourcesets release'' or equivalent. d625 4 a628 4 the RREELLEEAASSEEDDIIRR//RREELLEEAASSEEMMAACCHHIINNEEDDIIRR_/_i_n_s_t_a_l_l_a_t_i_o_n_/_c_d_r_o_m directory by ``make release''. These smaller images usually contain the same tools as the larger images in RREELLEEAASSEEDDIIRR_/_i_s_o, but do not contain additional content such d632 3 a634 3 creating CD-ROM images. This requires the mkisofs(1) utility, which is not part of NetBSD, but which can be installed from _p_k_g_s_r_c_/_s_y_s_u_t_i_l_s_/_c_d_r_t_o_o_l_s. d636 1 a636 1 iinnssttaallll--iimmaaggee d638 1 a638 1 RREELLEEAASSEEDDIIRR//RREELLEEAASSEEMMAACCHHIINNEEDDIIRR_/_i_n_s_t_a_l_l_a_t_i_o_n_/_i_n_s_t_a_l_l_i_m_a_g_e d651 1 a651 1 Before ``make install-image'' is attempted, RREELLEEAASSEEDDIIRR must d653 2 a654 2 must have been performed with MMKKUUNNPPRRIIVVEEDD==yyeess because ``make install-image'' relies on information in DDEESSTTDDIIRR_/_M_E_T_A_L_O_G. d657 9 a665 9 RREELLEEAASSEEDDIIRR//RREELLEEAASSEEMMAACCHHIINNEEDDIIRR_/_i_n_s_t_a_l_l_a_t_i_o_n_/_l_i_v_e_i_m_a_g_e directory. The live image contains all necessary files to boot NetBSD up to multi-user mode, including all files which should be extracted during installation, NetBSD disklabel, bootloaders, etc. The live image is suitable for use as a disk image in virtual machine environments such as QEMU, and also useful to boot NetBSD from a USB flash memory stick on a real d670 2 a671 2 must have been performed with MMKKUUNNPPRRIIVVEEDD==yyeess because ``make install-image'' relies on information in DDEESSTTDDIIRR_/_M_E_T_A_L_O_G. d673 1 a673 1 rreeggrreessssiioonn--tteessttss d676 3 a678 3 tests on the local host. Note that most tests are now managed instead using atf(7); this target should probably run those as well but currently does not. d680 1 a680 1 TThhee ""bbuuiilldd..sshh"" ssccrriipptt d682 3 a684 3 system on any host with a suitable modern shell and some common utilities. The required shell features are described under the HHOOSSTT__SSHH variable. d690 1 a690 1 /path/to/suitable/shell build.sh [_o_p_t_i_o_n_s] d692 2 a693 2 The above command will usually enable bbuuiilldd..sshh to automatically set HHOOSSTT__SSHH==_/_p_a_t_h_/_t_o_/_s_u_i_t_a_b_l_e_/_s_h_e_l_l, but if that fails, then the following d696 1 a696 1 HOST_SH=_/_p_a_t_h_/_t_o_/_s_u_i_t_a_b_l_e_/_s_h_e_l_l d698 1 a698 1 ${HOST_SH} build.sh [_o_p_t_i_o_n_s] d700 1 a700 1 If bbuuiilldd..sshh detects that it is being executed under an unsuitable shell, d702 1 a702 1 If HHOOSSTT__SSHH is not set explicitly, then bbuuiilldd..sshh sets a default using d704 2 a705 2 bbuuiilldd..sshh is executed (if that can be determined), or using the first copy of _s_h found in PPAATTHH. d708 3 a710 3 should make use of bbuuiilldd..sshh rather than just running ``make''. This way, the make(1) program will be bootstrapped properly, in case the host system has an older or incompatible ``make'' program. d712 1 a712 1 When compiling the entire system via bbuuiilldd..sshh, many make(1) variables are d714 1 a714 1 of options below, variables that are automatically set by bbuuiilldd..sshh are d717 1 a717 1 The following operations are supported by bbuuiilldd..sshh: d719 4 a722 4 bbuuiilldd Build the system as per ``make build''. Before the main part of the build commences, this command runs the oobbjj operation (unless the --oo option is given), ``make cleandir'' (unless the --uu option is given), and the ttoooollss d725 2 a726 2 ddiissttrriibbuuttiioonn Build a full distribution as per ``make distribution''. This command first runs the bbuuiilldd operation. d728 2 a729 2 rreelleeaassee Build a full release as per ``make release''. This command first runs the ddiissttrriibbuuttiioonn operation. d731 2 a732 2 mmaakkeewwrraappppeerr Create the nnbbmmaakkee--MMAACCHHIINNEE wrapper. This operation is automatically performed for any of the other operations. d734 1 a734 1 cclleeaannddiirr Perform ``make cleandir''. d736 1 a736 1 oobbjj Perform ``make obj''. d738 4 a741 4 ttoooollss Build and install the host tools from _s_r_c_/_t_o_o_l_s. This command will first run ``make obj'' and ``make cleandir'' in the _t_o_o_l_s subdirectory unless the --oo or --uu options (respectively) are given. d743 1 a743 1 iinnssttaallll=_i_d_i_r Install the contents of DDEESSTTDDIIRR to _i_d_i_r, using ``make d748 2 a749 2 kkeerrnneell=_k_c_o_n_f Build a new kernel. The _k_c_o_n_f argument is the name of a configuration file suitable for use by config(1). If _k_c_o_n_f d751 4 a754 4 is expected to be found in the KKEERRNNCCOONNFFDDIIRR directory, which is typically ssyyss//aarrcchh//MMAACCHHIINNEE//ccoonnff. The new kernel will be built in a subdirectory of KKEERRNNOOBBJJDDIIRR, which is typically ssyyss//aarrcchh//MMAACCHHIINNEE//ccoommppiillee or an associated object directory. d756 2 a757 2 This command does _n_o_t imply the ttoooollss command; run the ttoooollss command first unless it is _c_e_r_t_a_i_n that the tools d761 1 a761 1 question first unless the --uu option is given. d763 2 a764 2 mmoodduulleess This command will build kernel modules and install them into DDEESSTTDDIIRR. d766 1 a766 1 rreelleeaasseekkeerrnneell=_k_c_o_n_f d768 4 a771 4 kkeerrnneell=_k_c_o_n_f into RREELLEEAASSEEDDIIRR//RREELLEEAASSEEMMAACCHHIINNEEDDIIRR_/_b_i_n_a_r_y_/_k_e_r_n_e_l, usually as _n_e_t_b_s_d_-_k_c_o_n_f_._g_z, although the ``_n_e_t_b_s_d'' prefix is determined from the ``ccoonnffiigg'' directives in _k_c_o_n_f. d773 1 a773 1 sseettss Perform ``make sets''. d775 1 a775 1 ssoouurrcceesseettss Perform ``make sourcesets''. d777 1 a777 1 ssyyssppkkggss Perform ``make syspkgs''. d779 1 a779 1 iissoo--iimmaaggee Perform ``make iso-image''. d781 1 a781 1 iissoo--iimmaaggee--ssoouurrccee d784 1 a784 1 iinnssttaallll--iimmaaggee d787 1 a787 1 lliivvee--iimmaaggee Perform ``make live-image''. d789 1 a789 1 The following command line options alter the behaviour of the bbuuiilldd..sshh d792 1 a792 1 --aa _a_r_c_h Set the value of MMAACCHHIINNEE__AARRCCHH to _a_r_c_h. d794 2 a795 2 --BB _b_u_i_l_d_i_d Set the value of BBUUIILLDDIIDD to _b_u_i_l_d_i_d. This will also append the d798 1 a798 1 ``nnbbmmaakkee--MMAACCHHIINNEE--BBUUIILLDDIIDD''. d800 4 a803 4 --CC _c_d_e_x_t_r_a_s Append _c_d_e_x_t_r_a_s to the CCDDEEXXTTRRAA variable, which is a space- separated list of files or directories that will be added to the CD-ROM image that may be create by the ``iso-image'' or d808 1 a808 1 may be specified via multiple --CC options, or via a single d811 8 a818 8 --DD _d_e_s_t Set the value of DDEESSTTDDIIRR to _d_e_s_t. If a relative path is specified, it will be converted to an absolute path before being used. --EE Set `expert' mode. This overrides various sanity checks, and allows: DDEESSTTDDIIRR does not have to be set to a non-root path for builds, and MMKKUUNNPPRRIIVVEEDD==yyeess does not have to be set when building as a non-root user. d820 1 a820 1 _N_o_t_e: It is highly recommended that you know what you are doing d823 1 a823 1 --hh Print a help message. d825 1 a825 1 --jj _n_j_o_b Run up to _n_j_o_b make(1) subjobs in parallel; passed through to d827 2 a828 2 out of memory while using bbuuiilldd..sshh with --jj, please save complete build logs so the failures can be analyzed. d830 11 a840 12 To achieve the fastest builds, --jj values between (1 + the number of CPUs) and (2 * the number of CPUs) are recommended. Use lower values on machines with limited memory or I/O bandwidth. --MM _o_b_j Set MMAAKKEEOOBBJJDDIIRRPPRREEFFIIXX to _o_b_j. Unsets MMAAKKEEOOBBJJDDIIRR. See ``--OO --oobbjj'' for more information. For instance, if the source directory is _/_u_s_r_/_s_r_c, a setting of ``--MM _/_u_s_r_/_o_b_j'' will place build-time files under _/_u_s_r_/_o_b_j_/_u_s_r_/_s_r_c_/_b_i_n, _/_u_s_r_/_o_b_j_/_u_s_r_/_s_r_c_/_l_i_b, _/_u_s_r_/_o_b_j_/_u_s_r_/_s_r_c_/_u_s_r_._b_i_n, and so forth. d843 6 a848 6 absolute path before being used. bbuuiilldd..sshh imposes the restriction that the argument to the --MM option must not begin with a ``$'' (dollar sign) character; otherwise it would be too difficult to determine whether the value is an absolute or a relative path. If the directory does not already exist, bbuuiilldd..sshh will create it. d850 1 a850 1 --mm _m_a_c_h Set the value of MMAACCHHIINNEE to _m_a_c_h, except in some special cases d852 3 a854 3 MMAACCHHIINNEE__AARRCCHH in the process environment with a value deduced from _m_a_c_h, unless --aa is specified. All cross builds require --mm, but if unset on a NetBSD host, the host's value of MACHINE d857 3 a859 3 Some machines support multiple values for MMAACCHHIINNEE__AARRCCHH. The following special cases for the _m_a_c_h argument are defined to set the listed values of MMAACCHHIINNEE and MMAACCHHIINNEE__AARRCCHH: d861 1 a861 1 mmaacchh MMAACCHHIINNEE MMAACCHHIINNEE__AARRCCHH d875 1 a875 1 --NN _n_o_i_s_e_l_e_v_e_l d877 1 a877 1 MMAAKKEEVVEERRBBOOSSEE to _n_o_i_s_e_l_e_v_e_l. d879 1 a879 1 --nn Show the commands that would be executed by bbuuiilldd..sshh, but do d883 3 a885 3 --OO _o_b_j Create an appropriate transform macro for MMAAKKEEOOBBJJDDIIRR that will place the built object files under _o_b_j. Unsets MMAAKKEEOOBBJJDDIIRRPPRREEFFIIXX. d887 2 a888 2 For instance, a setting of ``--OO _/_u_s_r_/_o_b_j'' will place build- time files under _/_u_s_r_/_o_b_j_/_b_i_n, _/_u_s_r_/_o_b_j_/_l_i_b, _/_u_s_r_/_o_b_j_/_u_s_r_._b_i_n, d892 4 a895 4 absolute path before being used. bbuuiilldd..sshh imposes the restriction that the argument to the --OO option must not contain a ``$'' (dollar sign) character. If the directory does not already exist, bbuuiilldd..sshh will create it. d897 2 a898 2 In normal use, exactly one of the --MM or --OO options should be specified. If neither --MM nor --OO is specified, then a default d905 1 a905 1 --oo Set the value of MMKKOOBBJJDDIIRRSS to ``no''. Otherwise, it will be d907 1 a907 1 behaviour when not using bbuuiilldd..sshh. d909 1 a909 1 --RR _r_e_l Set the value of RREELLEEAASSEEDDIIRR to _r_e_l. If a relative path is d913 1 a913 1 --rr Remove the contents of DDEESSTTDDIIRR and TTOOOOLLDDIIRR before building d915 1 a915 1 DDEESSTTDDIIRR if building on a native system to the root directory. d917 1 a917 1 --SS _s_e_e_d Change the value of BBUUIILLDDSSEEEEDD to _s_e_e_d. This should rarely be d920 17 a936 17 --TT _t_o_o_l_s Set the value of TTOOOOLLDDIIRR to _t_o_o_l_s. If a relative path is specified, it will be converted to an absolute path before being used. If set, the bootstrap ``make'' will only be rebuilt if the source files for make(1) have changed. --UU Set MMKKUUNNPPRRIIVVEEDD==yyeess. --uu Set MMKKUUPPDDAATTEE==yyeess. --VV _v_a_r=[_v_a_l_u_e] Set the environment variable _v_a_r to an optional _v_a_l_u_e. This is propagated to the nnbbmmaakkee wrapper. --ww _w_r_a_p_p_e_r Create the nnbbmmaakkee wrapper script (see below) in a custom location, specified by _w_r_a_p_p_e_r. This allows, for instance, to place the wrapper in PPAATTHH automatically. Note that _w_r_a_p_p_e_r is d941 2 a942 2 --XX _x_1_1_s_r_c Set the value of XX1111SSRRCCDDIIRR to _x_1_1_s_r_c. If a relative path is d946 1 a946 1 --xx Set MMKKXX1111==yyeess. d948 2 a949 2 --ZZ _v_a_r Unset ("zap") the environment variable _v_a_r. This is propagated to the nnbbmmaakkee wrapper. d951 3 a953 3 TThhee ""nnbbmmaakkee--MMAACCHHIINNEE"" wwrraappppeerr ssccrriipptt If using the bbuuiilldd..sshh script to build NetBSD, a nnbbmmaakkee--MMAACCHHIINNEE script will be created in TTOOOOLLDDIIRR//bbiinn upon the first build to assist in building d956 5 a960 5 nnbbmmaakkee--MMAACCHHIINNEE can be invoked in lieu of make(1), and will instead call the up-to-date version of ``nbmake'' installed into TTOOOOLLDDIIRR//bbiinn with several key variables pre-set, including MMAACCHHIINNEE, MMAACCHHIINNEE__AARRCCHH, and TTOOOOLLDDIIRR. nnbbmmaakkee--MMAACCHHIINNEE will also set variables specified with --VV, and unset variables specified with --ZZ. d962 1 a962 1 This script can be symlinked into a directory listed in PPAATTHH, or called d965 1 a965 1 EEXXAAMMPPLLEESS d973 2 a974 2 Using unprivileged mode, build a complete distribution to a DDEESSTTDDIIRR directory that bbuuiilldd..sshh selects (and will display). d978 4 a981 4 As root, install to _/ the distribution that was built by example 2. Even though this is run as root, --UU is required so that the permissions stored in DDEESSTTDDIIRR_/_M_E_T_A_L_O_G are correctly applied to the files as they're copied to _/. d985 3 a987 3 Using unprivileged mode, build a complete release to DDEESSTTDDIIRR and RREELLEEAASSEEDDIIRR directories that bbuuiilldd..sshh selects (and will display). MMKKUUPPDDAATTEE==yyeess (--uu) is set to prevent the ``make cleandir'', so that d991 2 a992 2 OOBBSSOOLLEETTEE VVAARRIIAABBLLEESS NNBBUUIILLDDJJOOBBSS Use the make(1) option --jj instead. d994 1 a994 1 UUSSEE__NNEEWW__TTOOOOLLCCHHAAIINN d996 1 a996 1 TTOOOOLLCCHHAAIINN__MMIISSSSIINNGG==yyeess. d998 1 a998 1 SSEEEE AALLSSOO d1000 1 a1000 1 _p_k_g_s_r_c_/_s_y_s_u_t_i_l_s_/_c_d_r_t_o_o_l_s d1002 3 a1004 3 HHIISSTTOORRYY The bbuuiilldd..sshh based build scheme was introduced for NetBSD 1.6 as UUSSEE__NNEEWW__TTOOOOLLCCHHAAIINN, and re-worked to TTOOOOLLCCHHAAIINN__MMIISSSSIINNGG after that. @ 1.99 log @Add a missing period. @ text @d1 1 a1 1 BUILDING(8) NetBSD System Manager's Manual BUILDING(8) d3 2 a4 2 NAME BUILDING -- Procedure for building NetBSD from source code. d6 1 a6 1 REQUIREMENTS d8 2 a9 2 The basic build procedure is the same whether compiling natively (on the same NetBSD architecture) or cross compiling (on another architecture or d15 1 a15 1 toolchain (make is not required); all other tools are created as part of d19 3 a21 3 FILES Source tree layout doc/BUILDING.mdoc d24 1 a24 1 BUILDING This document (in plaintext). d26 1 a26 1 tools/compat/README d30 1 a30 1 Makefile The main Makefile for NetBSD; should only be run for d33 1 a33 1 on a non-native host, see the build.sh shell script.) d35 1 a35 1 UPDATING Special notes for updating from an earlier revision of d39 1 a39 1 build.sh Bourne-compatible shell script used for building the host d45 11 a55 11 crypto/dist/, dist/, gnu/dist/ Sources imported verbatim from third parties, without man- gling the existing build structure. Other source trees in bin through usr.sbin use the NetBSD make(1) ``reachover'' Makefile semantics when building these programs for a native host. distrib/, etc/ Sources for items used when making a full release snap- shot, such as files installed in DESTDIR/etc on the desti- nation system, boot media, and release notes. d57 1 a57 1 tests/, regress/ d59 2 a60 2 run natively. tests/ uses the atf(7) test framework; regress/ contains older tests that have not yet been d63 1 a63 1 sys/ NetBSD kernel sources. d65 3 a67 3 tools/ ``Reachover'' build structure for the host build tools. This has a special method of determining out-of-date sta- tus. d69 1 a69 1 bin/ ... usr.sbin/ d74 2 a75 2 x11/ ``Reachover'' build structure for X11R6; the source is in X11SRCDIR. d77 1 a77 1 Build tree layout d81 2 a82 2 CONFIGURATION Environment variables d85 1 a85 1 HOST_SH Path name to a shell available on the host system and d90 2 a91 2 functions (which is a widely-implemented but non-stan- dardised feature). d94 1 a94 1 /bin/sh, /usr/xpg4/bin/sh, /bin/ksh (provided it is a d96 1 a96 1 such as ksh88, but not ksh93), or /usr/local/bin/bash. d98 4 a101 4 Most parts of the build require HOST_SH to be an abso- lute path; however, build.sh allows it to be a simple command name, which will be converted to an absolute path by searching the PATH. d103 1 a103 1 HOST_CC Path name to C compiler used to create the toolchain. d105 1 a105 1 HOST_CXX Path name to C++ compiler used to create the toolchain. d107 1 a107 1 MACHINE Machine type, e.g., ``macppc''. d109 1 a109 1 MACHINE_ARCH Machine architecture, e.g., ``powerpc''. d111 1 a111 1 MAKE Path name to invoke make(1) as. d113 4 a116 3 MAKEFLAGS Flags to invoke make(1) with. Note that build.sh ignores the value of MAKEFLAGS passed in the environ- ment, but allows MAKEFLAGS to be set via the -V option. d118 10 a127 10 MAKEOBJDIR Directory to use as the .OBJDIR for the current direc- tory. The value is subjected to variable expansion by make(1). Typical usage is to set this variable to a value involving the use of `${.CURDIR:S...}' or `${.CURDIR:C...}', to derive the value of .OBJDIR from the value of .CURDIR. Used only if MAKEOBJDIRPREFIX is not defined. MAKEOBJDIR can be provided only in the environment or via the -O flag of build.sh; it cannot usefully be set inside a Makefile, including mk.conf or ${MAKECONF}. d129 1 a129 1 MAKEOBJDIRPREFIX Top level directory of the object directory tree. The d131 2 a132 2 build.sh will create the ${MAKEOBJDIRPREFIX} directory if necessary, but if make(1) is used without build.sh, d135 12 a146 12 value is defined and valid, then ${MAKEOBJDIRPRE- FIX}/${.CURDIR} is used as the .OBJDIR for the current directory. The current directory may be read only. MAKEOBJDIRPREFIX can be provided only in the environ- ment or via the -M flag of build.sh; it cannot usefully be set inside a Makefile, including mk.conf or ${MAKECONF}. "make" variables Several variables control the behavior of NetBSD builds. Unless other- wise specified, these variables may be set in either the process environ- ment or the make(1) configuration file specified by MAKECONF. d148 1 a148 1 BUILDID Identifier for the build. The identifier will be appended to d150 2 a151 2 configuration file in order to set additional build parame- ters, such as compiler flags. d153 15 a167 14 BUILDSEED GCC uses random numbers when compiling C++ code. This vari- able seeds the gcc random number generator using the -fran- dom-seed flag with this value. By default, it is set to NetBSD-(majorversion). Using a fixed value causes C++ bina- ries to be the same when built from the same sources, result- ing in identical (reproducible) builds. Additional informa- tion is available in the GCC documentation of -frandom-seed. DESTDIR Directory to contain the built NetBSD system. If set, spe- cial options are passed to the compilation tools to prevent their default use of the host system's /usr/include, /usr/lib, and so forth. This pathname must be an absolute path, and should not end with a slash (/) character. (For installation into the system's root directory, set DESTDIR to d171 2 a172 2 Default: Empty string if USETOOLS is ``yes''; unset other- wise. d174 2 a175 2 Note: build.sh will provide a default of destdir.MACHINE (in the top-level .OBJDIR) unless run in `expert' mode. d177 2 a178 2 MAKECONF The name of the make(1) configuration file. Only settable in the process environment. d180 1 a180 1 Default: ``/etc/mk.conf'' d182 1 a182 1 MAKEVERBOSE d189 2 a190 2 but the actual commands executed by make(1) are not dis- played. d202 1 a202 1 are traced through use of the sh(1) ``-x'' flag. d204 1 a204 1 Default: 2 d206 3 a208 2 MKCATPAGES Can be set to ``yes'' or ``no''. Indicates whether prefor- matted plaintext manual pages will be created during a build. d210 1 a210 1 Default: ``yes'' d212 5 a216 5 MKCRYPTO Can be set to ``yes'' or ``no''. Indicates whether crypto- graphic code will be included in a build; provided for the benefit of countries that do not allow strong cryptography. Will not affect use of the standard low-security password encryption system, crypt(3). d218 1 a218 1 Default: ``yes'' d220 2 a221 2 MKDOC Can be set to ``yes'' or ``no''. Indicates whether system documentation destined for DESTDIR/usr/share/doc will be d224 1 a224 1 Default: ``yes'' d226 2 a227 2 MKHTML Can be set to ``yes'' or ``no''. Indicates whether prefor- matted HTML manual pages will be built and installed d229 1 a229 1 Default: ``yes'' d231 1 a231 1 MKHOSTOBJ Can be set to ``yes'' or ``no''. If set to ``yes'', then for d240 1 a240 1 Default: ``no'' d242 1 a242 1 MKINFO Can be set to ``yes'' or ``no''. Indicates whether GNU Info d246 1 a246 1 Default: ``yes'' d248 1 a248 1 MKKMOD Can be set to ``yes'' or ``no''. Indicates whether kernel d251 1 a251 1 Default: ``yes'' d253 1 a253 1 MKLINT Can be set to ``yes'' or ``no''. Indicates whether lint(1) d256 1 a256 1 DESTDIR/usr/libdata/lint. d258 1 a258 1 Default: ``yes'' d260 1 a260 1 MKMAN Can be set to ``yes'' or ``no''. Indicates whether manual d263 1 a263 1 Default: ``yes'' d265 1 a265 1 MKNLS Can be set to ``yes'' or ``no''. Indicates whether Native d269 1 a269 1 Default: ``yes'' d271 1 a271 1 MKOBJ Can be set to ``yes'' or ``no''. Indicates whether object d276 1 a276 1 Default: ``yes'' d278 1 a278 1 Note that setting MKOBJ to ``no'' is not recommended and may d281 1 a281 1 MKPIC Can be set to ``yes'' or ``no''. Indicates whether shared d286 2 a287 2 Default: Platform dependent. As of this writing, all plat- forms except sh3 default to ``yes''. d289 1 a289 1 MKPICINSTALL d291 1 a291 1 format libraries (lib*_pic.a), used to generate shared d294 1 a294 1 Default: ``yes'' d296 2 a297 2 MKPROFILE Can be set to ``yes'' or ``no''. Indicates whether profiled libraries (lib*_p.a) will be built and installed during a d300 1 a300 1 Default: ``yes''; however, some platforms turn off MKPROFILE d304 8 a311 2 MKSHARE Can be set to ``yes'' or ``no''. Indicates whether files destined to reside in DESTDIR/usr/share will be built and d313 1 a313 1 MKCATPAGES, MKDOC, MKINFO, MKMAN, and MKNLS will be set to d316 1 a316 1 Default: ``yes'' d318 1 a318 1 MKSTRIPIDENT d323 1 a323 1 Default: ``no'' d325 3 a327 3 MKUNPRIVED Can be set to ``yes'' or ``no''. Indicates whether an unprivileged install will occur. The user, group, permis- sions, and file flags, will not be set on the installed d329 1 a329 1 called METALOG in DESTDIR. The contents of METALOG are used d333 1 a333 1 Default: ``no'' d335 2 a336 2 MKUPDATE Can be set to ``yes'' or ``no''. Indicates whether all install operations intended to write to DESTDIR will compare d341 1 a341 1 Default: ``no'' d343 2 a344 2 MKX11 Can be set to ``yes'' or ``no''. Indicates whether X11 is built from X11SRCDIR. d346 1 a346 1 Default: ``no'' d348 1 a348 1 TOOLDIR Directory to hold the host tools, once built. If specified, d350 5 a354 5 a given host system and NetBSD source tree. (However, multi- ple targets may share the same TOOLDIR; the target-dependent files have unique names.) If unset, a default based on the uname(1) information of the host platform will be created in the .OBJDIR of src. d356 1 a356 1 Default: Unset. d358 1 a358 1 USETOOLS Indicates whether the tools specified by TOOLDIR should be d362 1 a362 1 yes Use the tools from TOOLDIR. d364 1 a364 1 no Do not use the tools from TOOLDIR, but refuse to build d368 7 a374 7 never Do not use the tools from TOOLDIR, even when building native tool components. This is similar to the tradi- tional NetBSD build method, but does not verify that the compilation tools in use are up-to-date enough in order to build the tree successfully. This may cause build or runtime problems when building the whole NetBSD source tree. d376 1 a376 1 Default: ``yes'', unless TOOLCHAIN_MISSING is set to ``yes''. d378 1 a378 1 USETOOLS is also set to ``no'' when using outside d381 1 a381 1 X11SRCDIR Directory containing the X11R6 source. If specified, must be d383 1 a383 1 X11SRCDIR/xfree/xc. d385 2 a386 2 Default: NETBSDRCDIR/../xsrc, if that exists; otherwise /usr/xsrc. d388 1 a388 1 X11FLAVOUR The style of X11 cross-built, set to either ``Xorg'' or d391 1 a391 1 Default: ``Xorg'' on amd64, i386, macppc, shark and sparc64 d394 1 a394 1 "make" variables for full builds d398 1 a398 1 INSTALLWORLDDIR Location for the ``make installworld'' target to install d401 1 a401 1 Default: ``/'' d403 1 a403 1 MKOBJDIRS Can be set to ``yes'' or ``no''. Indicates whether d407 1 a407 1 Default: ``no'' d409 2 a410 2 If using build.sh, the default is ``yes''. This may be set back to ``no'' by giving build.sh the -o option. d412 4 a415 4 MKUPDATE Can be set to ``yes'' or ``no''. If set, then in addi- tion to the effects described for MKUPDATE=yes above, this implies the effects of NOCLEANDIR (i.e., ``make cleandir'' is avoided). d417 1 a417 1 Default: ``no'' d419 1 a419 1 If using build.sh, this may be set by giving the -u d422 1 a422 1 NBUILDJOBS Now obsolete. Use the make(1) option -j, instead. See d425 1 a425 1 Default: Unset. d427 1 a427 1 NOCLEANDIR If set, avoids the ``make cleandir'' phase of a full d432 1 a432 1 Default: Unset. d434 1 a434 1 See also MKUPDATE. d436 2 a437 2 NODISTRIBDIRS If set, avoids the ``make distrib-dirs'' phase of a full build. This skips running mtree(8) on DESTDIR, useful d442 1 a442 1 Default: Unset. d444 1 a444 1 NOINCLUDES If set, avoids the ``make includes'' phase of a full d450 1 a450 1 MKUPDATE=yes instead in that case. d452 1 a452 1 Default: Unset. d454 1 a454 1 RELEASEDIR If set, specifies the directory to which a release(7) d458 1 a458 1 Default: Unset. d460 2 a461 2 Note: build.sh will provide a default of releasedir (in the top-level .OBJDIR) unless run in `expert' mode. d463 2 a464 2 BUILDING "make" command line options d468 1 a468 1 -j njob Run up to njob make(1) subjobs in parallel. Makefiles should d472 6 a477 6 -m dir Specify the default directory for searching for system Make- file segments, mainly the files. When building any full NetBSD source tree, this should be set to the ``share/mk'' directory in the source tree. This is set auto- matically when building from the top level, or when using build.sh. d479 1 a479 1 -n Display the commands that would have been executed, but do not d483 1 a483 1 -V var Print make(1)'s idea of the value of var. Does not build any d486 3 a488 3 var=value Set the variable var to value, overriding any setting speci- fied by the process environment, the MAKECONF configuration file, or the system Makefile segments. d490 1 a490 1 "make" targets d496 1 a496 1 all Build programs, libraries, and preformatted documentation. d498 1 a498 1 clean Remove program and library object code files. d500 1 a500 1 cleandir Same as clean, but also remove preformatted documentation, d504 1 a504 1 depend Create dependency files (.depend) containing more detailed d509 1 a509 1 dependall Does a ``make depend'' immediately followed by a ``make all''. d513 1 a513 1 distclean Synonym for cleandir. d515 1 a515 1 includes Build and install system header files. Typically needed d518 3 a520 3 install Install programs, libraries, and documentation into DESTDIR. Few files will be installed to DESTDIR/dev, DESTDIR/etc, DESTDIR/root or DESTDIR/var in order to prevent user supplied d523 1 a523 1 lint Run lint(1) against the C source code, where appropriate, and d526 1 a526 1 obj Create object directories to be used for built files, instead d529 1 a529 1 tags Create ctags(1) searchable function lists usable by the ex(1) d532 1 a532 1 "make" targets for the top level d536 1 a536 1 build Build the entire NetBSD system (except the kernel). This d540 4 a543 4 distribution Do a ``make build'', and then install a full distribution (which does not include a kernel) into DESTDIR, including files in DESTDIR/dev, DESTDIR/etc, DESTDIR/root and DESTDIR/var. d545 2 a546 2 buildworld As per ``make distribution'', except that it ensures that DESTDIR is not the root directory. d548 1 a548 1 installworld Install the distribution from DESTDIR to INSTALLWORLDDIR, d550 2 a551 2 INSTALLWORLDDIR is not the root directory if cross compil- ing. d553 1 a553 1 The INSTALLSETS environment variable may be set to a space- d556 1 a556 1 installed, so most files in INSTALLWORLDDIR/etc will not be d559 2 a560 2 Note: Before performing this operation with INSTALLWORLDDIR=/, it is highly recommended that you d563 1 a563 1 update files in INSTALLWORLDDIR/etc and that you use d567 2 a568 2 sets Create distribution sets from DESTDIR into RELEASEDIR/RELEASEMACHINEDIR/binary/sets. Should be run d572 2 a573 2 sourcesets Create source sets of the source tree into RELEASEDIR/source/sets. d575 2 a576 2 syspkgs Create syspkgs from DESTDIR into RELEASEDIR/RELEASEMACHINEDIR/binary/syspkgs. Should be run d580 1 a580 1 release Do a ``make distribution'', build kernels, distribution d583 1 a583 1 described by release(7). This requires that RELEASEDIR be d586 2 a587 2 iso-image Create a NetBSD installation CD-ROM image in the RELEASEDIR/iso directory. The CD-ROM file system will have d591 5 a595 4 will automatically run the sysinst(8) menu-based installa- tion program, which can be used to install or upgrade a NetBSD system. Bootable CD-ROMs also contain tools that may be useful in repairing a damaged NetBSD installation. d601 4 a604 4 the RELEASEDIR/RELEASEMACHINEDIR/installation/cdrom direc- tory by ``make release''. These smaller images usually contain the same tools as the larger images in RELEASEDIR/iso, but do not contain additional content such d608 3 a610 3 creating CD-ROM images. This requires the mkisofs(1) util- ity, which is not part of NetBSD, but which can be installed from pkgsrc/sysutils/cdrtools. d612 1 a612 1 iso-image-source d614 1 a614 1 RELEASEDIR/iso directory. The CD-ROM file system will have d619 5 a623 4 will automatically run the sysinst(8) menu-based installa- tion program, which can be used to install or upgrade a NetBSD system. Bootable CD-ROMs also contain tools that may be useful in repairing a damaged NetBSD installation. d626 2 a627 2 must be populated by ``make sourcesets release'' or equiva- lent. d630 4 a633 4 the RELEASEDIR/RELEASEMACHINEDIR/installation/cdrom direc- tory by ``make release''. These smaller images usually contain the same tools as the larger images in RELEASEDIR/iso, but do not contain additional content such d637 3 a639 3 creating CD-ROM images. This requires the mkisofs(1) util- ity, which is not part of NetBSD, but which can be installed from pkgsrc/sysutils/cdrtools. d641 1 a641 1 install-image d643 1 a643 1 RELEASEDIR/RELEASEMACHINEDIR/installation/installimage d656 1 a656 1 Before ``make install-image'' is attempted, RELEASEDIR must d658 2 a659 2 must have been performed with MKUNPRIVED=yes because ``make install-image'' relies on information in DESTDIR/METALOG. d662 9 a670 9 RELEASEDIR/RELEASEMACHINEDIR/installation/liveimage direc- tory. The live image contains all necessary files to boot NetBSD up to multi-user mode, including all files which should be extracted during installation, NetBSD disklabel, bootloaders, etc. The live image is suitable for use as a disk image in vir- tual machine environments such as QEMU, and also useful to boot NetBSD from a USB flash memory stick on a real d675 2 a676 2 must have been performed with MKUNPRIVED=yes because ``make install-image'' relies on information in DESTDIR/METALOG. d678 1 a678 1 regression-tests d681 3 a683 3 tests on the local host. Note that most tests are now man- aged instead using atf(7); this target should probably run those as well but currently does not. d685 1 a685 1 The "build.sh" script d687 3 a689 3 system on any host with a suitable modern shell and some common utili- ties. The required shell features are described under the HOST_SH vari- able. d695 1 a695 1 /path/to/suitable/shell build.sh [options] d697 2 a698 2 The above command will usually enable build.sh to automatically set HOST_SH=/path/to/suitable/shell, but if that fails, then the following d701 1 a701 1 HOST_SH=/path/to/suitable/shell d703 1 a703 1 ${HOST_SH} build.sh [options] d705 1 a705 1 If build.sh detects that it is being executed under an unsuitable shell, d707 1 a707 1 If HOST_SH is not set explicitly, then build.sh sets a default using d709 2 a710 2 build.sh is executed (if that can be determined), or using the first copy of sh found in PATH. d713 3 a715 3 should make use of build.sh rather than just running ``make''. This way, the make(1) program will be bootstrapped properly, in case the host sys- tem has an older or incompatible ``make'' program. d717 1 a717 1 When compiling the entire system via build.sh, many make(1) variables are d719 1 a719 1 of options below, variables that are automatically set by build.sh are d722 1 a722 1 The following operations are supported by build.sh: d724 4 a727 4 build Build the system as per ``make build''. Before the main part of the build commences, this command runs the obj operation (unless the -o option is given), ``make cleandir'' (unless the -u option is given), and the tools d730 2 a731 2 distribution Build a full distribution as per ``make distribution''. This command first runs the build operation. d733 2 a734 2 release Build a full release as per ``make release''. This command first runs the distribution operation. d736 2 a737 2 makewrapper Create the nbmake-MACHINE wrapper. This operation is auto- matically performed for any of the other operations. d739 1 a739 1 cleandir Perform ``make cleandir''. d741 1 a741 1 obj Perform ``make obj''. d743 4 a746 4 tools Build and install the host tools from src/tools. This com- mand will first run ``make obj'' and ``make cleandir'' in the tools subdirectory unless the -o or -u options (respec- tively) are given. d748 1 a748 1 install=idir Install the contents of DESTDIR to idir, using ``make d753 2 a754 2 kernel=kconf Build a new kernel. The kconf argument is the name of a configuration file suitable for use by config(1). If kconf d756 4 a759 4 is expected to be found in the KERNCONFDIR directory, which is typically sys/arch/MACHINE/conf. The new kernel will be built in a subdirectory of KERNOBJDIR, which is typically sys/arch/MACHINE/compile or an associated object directory. d761 2 a762 2 This command does not imply the tools command; run the tools command first unless it is certain that the tools d766 1 a766 1 question first unless the -u option is given. d768 2 a769 2 modules This command will build kernel modules and install them into DESTDIR. d771 1 a771 1 releasekernel=kconf d773 4 a776 4 kernel=kconf into RELEASEDIR/RELEASEMACHINEDIR/binary/kernel, usually as netbsd-kconf.gz, although the ``netbsd'' prefix is deter- mined from the ``config'' directives in kconf. d778 1 a778 1 sets Perform ``make sets''. d780 1 a780 1 sourcesets Perform ``make sourcesets''. d782 1 a782 1 syspkgs Perform ``make syspkgs''. d784 1 a784 1 iso-image Perform ``make iso-image''. d786 1 a786 1 iso-image-source d789 1 a789 1 install-image d792 1 a792 1 live-image Perform ``make live-image''. d794 1 a794 1 The following command line options alter the behaviour of the build.sh d797 1 a797 1 -a arch Set the value of MACHINE_ARCH to arch. d799 2 a800 2 -B buildid Set the value of BUILDID to buildid. This will also append the d803 1 a803 1 ``nbmake-MACHINE-BUILDID''. d805 4 a808 4 -C cdextras Append cdextras to the CDEXTRA variable, which is a space-sepa- rated list of files or directories that will be added to the CD-ROM image that may be create by the ``iso-image'' or d813 1 a813 1 may be specified via multiple -C options, or via a single d816 8 a823 8 -D dest Set the value of DESTDIR to dest. If a relative path is speci- fied, it will be converted to an absolute path before being used. -E Set `expert' mode. This overrides various sanity checks, and allows: DESTDIR does not have to be set to a non-root path for builds, and MKUNPRIVED=yes does not have to be set when build- ing as a non-root user. d825 1 a825 1 Note: It is highly recommended that you know what you are doing d828 1 a828 1 -h Print a help message. d830 1 a830 1 -j njob Run up to njob make(1) subjobs in parallel; passed through to d832 2 a833 2 out of memory while using build.sh with -j, please save com- plete build logs so the failures can be analyzed. d835 12 a846 11 To achieve the fastest builds, -j values between (1 + the num- ber of CPUs) and (2 * the number of CPUs) are recommended. Use lower values on machines with limited memory or I/O bandwidth. -M obj Set MAKEOBJDIRPREFIX to obj. Unsets MAKEOBJDIR. See ``-O -obj'' for more information. For instance, if the source directory is /usr/src, a setting of ``-M /usr/obj'' will place build-time files under /usr/obj/usr/src/bin, /usr/obj/usr/src/lib, /usr/obj/usr/src/usr.bin, and so forth. d849 6 a854 6 absolute path before being used. build.sh imposes the restric- tion that the argument to the -M option must not begin with a ``$'' (dollar sign) character; otherwise it would be too diffi- cult to determine whether the value is an absolute or a rela- tive path. If the directory does not already exist, build.sh will create it. d856 1 a856 1 -m mach Set the value of MACHINE to mach, except in some special cases d858 3 a860 3 MACHINE_ARCH in the process environment with a value deduced from mach, unless -a is specified. All cross builds require -m, but if unset on a NetBSD host, the host's value of MACHINE d863 3 a865 3 Some machines support multiple values for MACHINE_ARCH. The following special cases for the mach argument are defined to set the listed values of MACHINE and MACHINE_ARCH: d867 1 a867 1 mach MACHINE MACHINE_ARCH d881 1 a881 1 -N noiselevel d883 1 a883 1 MAKEVERBOSE to noiselevel. d885 1 a885 1 -n Show the commands that would be executed by build.sh, but do d889 3 a891 3 -O obj Create an appropriate transform macro for MAKEOBJDIR that will place the built object files under obj. Unsets MAKEOBJDIRPREFIX. d893 2 a894 2 For instance, a setting of ``-O /usr/obj'' will place build- time files under /usr/obj/bin, /usr/obj/lib, /usr/obj/usr.bin, d898 4 a901 4 absolute path before being used. build.sh imposes the restric- tion that the argument to the -O option must not contain a ``$'' (dollar sign) character. If the directory does not already exist, build.sh will create it. d903 2 a904 2 In normal use, exactly one of the -M or -O options should be specified. If neither -M nor -O is specified, then a default d911 1 a911 1 -o Set the value of MKOBJDIRS to ``no''. Otherwise, it will be d913 1 a913 1 behaviour when not using build.sh. d915 1 a915 1 -R rel Set the value of RELEASEDIR to rel. If a relative path is d919 1 a919 1 -r Remove the contents of DESTDIR and TOOLDIR before building d921 1 a921 1 DESTDIR if building on a native system to the root directory. d923 1 a923 1 -S seed Change the value of BUILDSEED to seed. This should rarely be d926 17 a942 17 -T tools Set the value of TOOLDIR to tools. If a relative path is spec- ified, it will be converted to an absolute path before being used. If set, the bootstrap ``make'' will only be rebuilt if the source files for make(1) have changed. -U Set MKUNPRIVED=yes. -u Set MKUPDATE=yes. -V var=[value] Set the environment variable var to an optional value. This is propagated to the nbmake wrapper. -w wrapper Create the nbmake wrapper script (see below) in a custom loca- tion, specified by wrapper. This allows, for instance, to place the wrapper in PATH automatically. Note that wrapper is d947 2 a948 2 -X x11src Set the value of X11SRCDIR to x11src. If a relative path is d952 1 a952 1 -x Set MKX11=yes. d954 2 a955 2 -Z var Unset ("zap") the environment variable var. This is propagated to the nbmake wrapper. d957 3 a959 3 The "nbmake-MACHINE" wrapper script If using the build.sh script to build NetBSD, a nbmake-MACHINE script will be created in TOOLDIR/bin upon the first build to assist in building d962 5 a966 5 nbmake-MACHINE can be invoked in lieu of make(1), and will instead call the up-to-date version of ``nbmake'' installed into TOOLDIR/bin with sev- eral key variables pre-set, including MACHINE, MACHINE_ARCH, and TOOLDIR. nbmake-MACHINE will also set variables specified with -V, and unset vari- ables specified with -Z. d968 1 a968 1 This script can be symlinked into a directory listed in PATH, or called d971 1 a971 1 EXAMPLES d979 2 a980 2 Using unprivileged mode, build a complete distribution to a DESTDIR directory that build.sh selects (and will display). d984 4 a987 4 As root, install to / the distribution that was built by example 2. Even though this is run as root, -U is required so that the permis- sions stored in DESTDIR/METALOG are correctly applied to the files as they're copied to /. d991 3 a993 3 Using unprivileged mode, build a complete release to DESTDIR and RELEASEDIR directories that build.sh selects (and will display). MKUPDATE=yes (-u) is set to prevent the ``make cleandir'', so that d997 2 a998 2 OBSOLETE VARIABLES NBUILDJOBS Use the make(1) option -j instead. d1000 1 a1000 1 USE_NEW_TOOLCHAIN d1002 1 a1002 1 TOOLCHAIN_MISSING=yes. d1004 1 a1004 1 SEE ALSO d1006 1 a1006 1 pkgsrc/sysutils/cdrtools d1008 3 a1010 3 HISTORY The build.sh based build scheme was introduced for NetBSD 1.6 as USE_NEW_TOOLCHAIN, and re-worked to TOOLCHAIN_MISSING after that. d1012 1 a1012 1 NetBSD September 9, 2011 NetBSD @ 1.98 log @Regen from revision 1.87 of doc/BUILDING.mdoc. @ text @d663 2 a664 2 populated by ``make release'' or equivalent The build must have been performed with MKUNPRIVED=yes because ``make @ 1.98.2.1 log @Pull up following revision(s) (requested by tsutsui in ticket #68): doc/BUILDING.mdoc: revision 1.88 BUILDING: revision 1.99 build.sh: revision 1.254 Add a missing period. Add sanity checks for live-image and install-image targets (which require mtree spec files built with MKUNPRIVED=yes) to avoid unexpected makefs(8) error during image builds: - if release op is specified with live-image or install-image at the same time, make sure -U is also specified for the image builds - before perform live-image and install-image ops check METALOG file in DESTDIR to see if the build have been performed with MKUNPRIVED XXX: Probably toolchain should create consistent spec files in XXX: DESTDIR/etc/mtree dir regardless of MKUNPRIVED settings. @ text @d663 2 a664 2 populated by ``make release'' or equivalent. The build must have been performed with MKUNPRIVED=yes because ``make @ 1.97 log @Add "live-image" and "install-image" target support to build.sh. "live-image" target builds pre-installed disk images that can be used on emulators or boot from USB memory sticks to try NetBSD without installation. Currently amd64, i386, pmax, sparc, sparc64, sun2, sun3, and vax (which have working emulators and don't require extra tools like preparing msdosfs or partitioning MD label structures) support this target. "install-image" target builds an bootable installation disk image that can be used as an install CD but burned into USB memory sticks etc. Current only amd64 and i386 (which would support USB boot) have this target. For more details (and known issue) see following posts on netbsd-bugs@@: http://mail-index.NetBSD.org/netbsd-bugs/2011/08/06/msg023639.html http://mail-index.NetBSD.org/netbsd-bugs/2011/09/23/msg024207.html http://mail-index.NetBSD.org/netbsd-bugs/2011/12/07/msg025166.html http://mail-index.NetBSD.org/netbsd-bugs/2011/12/08/msg025178.html No particular comments about implementation, and "go ahead" comments from mrg@@, riz@@ and christos@@. Closes PR toolchain/45153 and PR misc/45155. @ text @d630 2 a631 1 install-image Create a bootable NetBSD installation disk image in the d633 5 a637 5 directory. The bootable installation disk image is suitable to USB flash memory sticks etc. for machines which may support boot from such USB devices. File system in the bootable disk image will have a layout as described in release(7). d641 3 a643 3 can be used to install or upgrade a NetBSD system. Bootable installation images also contain tools that may be useful in repairing a damaged NetBSD installation. d646 3 a648 3 be populated by ``make release'' or equivalent and RELEASEDIR binaries must be built with ``MKUNPRIVED=yes'' to refer permission information from specfiles. d651 10 a660 9 RELEASEDIR/RELEASEMACHINEDIR/installation/liveimage directory. The live image contains all necessary files to boot NetBSD upto multi user mode, including all files which should be extracted during installation, NetBSD disklabel, and bootloaders etc. The live image is suitable for misc emulators like QEMU, and also usuful to try NetBSD on real machines with USB flash memory sticks without installation. d663 3 a665 3 populated by ``make release'' or equivalent and RELEASEDIR binaries must be built with ``MKUNPRIVED=yes'' to refer permission information from specfiles. d778 2 a779 1 install-image Perform ``make install-image''. @ 1.96 log @Add tests for the shell under which build.sh is run. If the shell fails the tests, then build.sh tries to re-exec itself under a more suitable shell. @ text @d630 35 d776 4 @ 1.96.2.1 log @sync with head @ text @a629 37 install-image Create a bootable NetBSD installation disk image in the RELEASEDIR/RELEASEMACHINEDIR/installation/installimage directory. The installation disk image is suitable for copying to bootable USB flash memory sticks, etc., for machines which are able to boot from such devices. The file system in the bootable disk image will have a layout as described in release(7). The installation image is bootable, and will automatically run the sysinst(8) menu-based installation program, which can be used to install or upgrade a NetBSD system. The image also contains tools that may be useful in repairing a damaged NetBSD installation. Before ``make install-image'' is attempted, RELEASEDIR must be populated by ``make release'' or equivalent. The build must have been performed with MKUNPRIVED=yes because ``make install-image'' relies on information in DESTDIR/METALOG. live-image Create NetBSD live images in the RELEASEDIR/RELEASEMACHINEDIR/installation/liveimage direc- tory. The live image contains all necessary files to boot NetBSD up to multi-user mode, including all files which should be extracted during installation, NetBSD disklabel, bootloaders, etc. The live image is suitable for use as a disk image in vir- tual machine environments such as QEMU, and also useful to boot NetBSD from a USB flash memory stick on a real machine, without the need for installation. Before ``make live-image'' is attempted, RELEASEDIR must be populated by ``make release'' or equivalent. The build must have been performed with MKUNPRIVED=yes because ``make install-image'' relies on information in DESTDIR/METALOG. a740 5 install-image Perform ``make install-image''. live-image Perform ``make live-image''. @ 1.96.2.2 log @sync with head @ text @a300 6 MKREPRO Can be set to ``yes'' or ``no''. Create reproducable builds. This enables different switches to make two builds from the same source tree result in the same build results. Default: ``no'' d310 3 a312 3 Can be set to ``yes'' or ``no''. Indicates whether RCS IDs, for use with ident(1), should be stripped from program bina- ries and shared libraries. d554 3 a556 2 update files in INSTALLWORLDDIR/etc, and postinstall(8) to check for or fix inconsistencies. d1000 1 a1000 1 NetBSD September 19, 2012 NetBSD @ 1.96.2.3 log @sync with (a bit old) head @ text @d207 1 a207 1 Default: ``no'' @ 1.96.2.4 log @sync with head. for a reference, the tree before this commit was tagged as yamt-pagecache-tag8. this commit was splitted into small chunks to avoid a limitation of cvs. ("Protocol error: too many arguments") @ text @d1 1 a1 1 BUILDING(8) System Manager's Manual BUILDING(8) d46 5 a50 5 Sources imported verbatim from third parties, without mangling the existing build structure. Other source trees in bin through usr.sbin use the NetBSD make(1) ``reachover'' Makefile semantics when building these programs for a native host. d53 3 a55 3 Sources for items used when making a full release snapshot, such as files installed in DESTDIR/etc on the destination system, boot media, and release notes. d66 2 a67 2 This has a special method of determining out-of-date status. d90 2 a91 2 functions (which is a widely-implemented but non- standardised feature). d98 4 a101 4 Most parts of the build require HOST_SH to be an absolute path; however, build.sh allows it to be a simple command name, which will be converted to an absolute path by searching the PATH. d114 13 a126 14 ignores the value of MAKEFLAGS passed in the environment, but allows MAKEFLAGS to be set via the -V option. MAKEOBJDIR Directory to use as the .OBJDIR for the current directory. The value is subjected to variable expansion by make(1). Typical usage is to set this variable to a value involving the use of `${.CURDIR:S...}' or `${.CURDIR:C...}', to derive the value of .OBJDIR from the value of .CURDIR. Used only if MAKEOBJDIRPREFIX is not defined. MAKEOBJDIR can be provided only in the environment or via the -O flag of build.sh; it cannot usefully be set inside a Makefile, including mk.conf or ${MAKECONF}. d134 7 a140 7 value is defined and valid, then ${MAKEOBJDIRPREFIX}/${.CURDIR} is used as the .OBJDIR for the current directory. The current directory may be read only. MAKEOBJDIRPREFIX can be provided only in the environment or via the -M flag of build.sh; it cannot usefully be set inside a Makefile, including mk.conf or ${MAKECONF}. d143 3 a145 3 Several variables control the behavior of NetBSD builds. Unless otherwise specified, these variables may be set in either the process environment or the make(1) configuration file specified by MAKECONF. d149 2 a150 2 configuration file in order to set additional build parameters, such as compiler flags. d152 11 a162 12 BUILDSEED GCC uses random numbers when compiling C++ code. This variable seeds the gcc random number generator using the -frandom-seed flag with this value. By default, it is set to NetBSD-(majorversion). Using a fixed value causes C++ binaries to be the same when built from the same sources, resulting in identical (reproducible) builds. Additional information is available in the GCC documentation of -frandom-seed. DESTDIR Directory to contain the built NetBSD system. If set, special options are passed to the compilation tools to prevent their default use of the host system's /usr/include, d169 2 a170 2 Default: Empty string if USETOOLS is ``yes''; unset otherwise. d187 2 a188 2 but the actual commands executed by make(1) are not displayed. d204 2 a205 3 MKCATPAGES Can be set to ``yes'' or ``no''. Indicates whether preformatted plaintext manual pages will be created during a build. d209 5 a213 5 MKCRYPTO Can be set to ``yes'' or ``no''. Indicates whether cryptographic code will be included in a build; provided for the benefit of countries that do not allow strong cryptography. Will not affect use of the standard low- security password encryption system, crypt(3). d223 2 a224 2 MKHTML Can be set to ``yes'' or ``no''. Indicates whether preformatted HTML manual pages will be built and installed d283 2 a284 2 Default: Platform dependent. As of this writing, all platforms except sh3 default to ``yes''. d317 2 a318 2 for use with ident(1), should be stripped from program binaries and shared libraries. d323 2 a324 2 unprivileged install will occur. The user, group, permissions, and file flags, will not be set on the installed d347 5 a351 5 a given host system and NetBSD source tree. (However, multiple targets may share the same TOOLDIR; the target- dependent files have unique names.) If unset, a default based on the uname(1) information of the host platform will be created in the .OBJDIR of src. d366 6 a371 6 native tool components. This is similar to the traditional NetBSD build method, but does not verify that the compilation tools in use are up-to-date enough in order to build the tree successfully. This may cause build or runtime problems when building the whole NetBSD source tree. d409 4 a412 4 MKUPDATE Can be set to ``yes'' or ``no''. If set, then in addition to the effects described for MKUPDATE=yes above, this implies the effects of NOCLEANDIR (i.e., ``make cleandir'' is avoided). d469 5 a473 5 -m dir Specify the default directory for searching for system Makefile segments, mainly the files. When building any full NetBSD source tree, this should be set to the ``share/mk'' directory in the source tree. This is set automatically when building from the top level, or when using d483 3 a485 3 var=value Set the variable var to value, overriding any setting specified by the process environment, the MAKECONF configuration file, or the system Makefile segments. d547 2 a548 2 INSTALLWORLDDIR is not the root directory if cross compiling. d587 4 a590 5 will automatically run the sysinst(8) menu-based installation program, which can be used to install or upgrade a NetBSD system. Bootable CD-ROMs also contain tools that may be useful in repairing a damaged NetBSD installation. d596 3 a598 3 the RELEASEDIR/RELEASEMACHINEDIR/installation/cdrom directory by ``make release''. These smaller images usually contain the same tools as the larger images in d603 2 a604 2 creating CD-ROM images. This requires the mkisofs(1) utility, which is not part of NetBSD, but which can be d614 4 a617 5 will automatically run the sysinst(8) menu-based installation program, which can be used to install or upgrade a NetBSD system. Bootable CD-ROMs also contain tools that may be useful in repairing a damaged NetBSD installation. d620 2 a621 2 must be populated by ``make sourcesets release'' or equivalent. d624 3 a626 3 the RELEASEDIR/RELEASEMACHINEDIR/installation/cdrom directory by ``make release''. These smaller images usually contain the same tools as the larger images in d631 2 a632 2 creating CD-ROM images. This requires the mkisofs(1) utility, which is not part of NetBSD, but which can be d656 9 a664 9 RELEASEDIR/RELEASEMACHINEDIR/installation/liveimage directory. The live image contains all necessary files to boot NetBSD up to multi-user mode, including all files which should be extracted during installation, NetBSD disklabel, bootloaders, etc. The live image is suitable for use as a disk image in virtual machine environments such as QEMU, and also useful to boot NetBSD from a USB flash memory stick on a real d675 3 a677 3 tests on the local host. Note that most tests are now managed instead using atf(7); this target should probably run those as well but currently does not. d681 3 a683 3 system on any host with a suitable modern shell and some common utilities. The required shell features are described under the HOST_SH variable. d708 2 a709 2 the make(1) program will be bootstrapped properly, in case the host system has an older or incompatible ``make'' program. d730 2 a731 2 makewrapper Create the nbmake-MACHINE wrapper. This operation is automatically performed for any of the other operations. d737 4 a740 4 tools Build and install the host tools from src/tools. This command will first run ``make obj'' and ``make cleandir'' in the tools subdirectory unless the -o or -u options (respectively) are given. d769 2 a770 2 netbsd-kconf.gz, although the ``netbsd'' prefix is determined from the ``config'' directives in kconf. d800 3 a802 3 Append cdextras to the CDEXTRA variable, which is a space- separated list of files or directories that will be added to the CD-ROM image that may be create by the ``iso-image'' or d810 3 a812 3 -D dest Set the value of DESTDIR to dest. If a relative path is specified, it will be converted to an absolute path before being used. d816 2 a817 2 builds, and MKUNPRIVED=yes does not have to be set when building as a non-root user. d826 2 a827 2 out of memory while using build.sh with -j, please save complete build logs so the failures can be analyzed. d829 3 a831 4 To achieve the fastest builds, -j values between (1 + the number of CPUs) and (2 * the number of CPUs) are recommended. Use lower values on machines with limited memory or I/O bandwidth. d842 6 a847 6 absolute path before being used. build.sh imposes the restriction that the argument to the -M option must not begin with a ``$'' (dollar sign) character; otherwise it would be too difficult to determine whether the value is an absolute or a relative path. If the directory does not already exist, build.sh will create it. d891 3 a893 3 absolute path before being used. build.sh imposes the restriction that the argument to the -O option must not contain a ``$'' (dollar sign) character. If the directory does not d919 4 a922 4 -T tools Set the value of TOOLDIR to tools. If a relative path is specified, it will be converted to an absolute path before being used. If set, the bootstrap ``make'' will only be rebuilt if the source files for make(1) have changed. d933 2 a934 2 Create the nbmake wrapper script (see below) in a custom location, specified by wrapper. This allows, for instance, to d956 4 a959 4 the up-to-date version of ``nbmake'' installed into TOOLDIR/bin with several key variables pre-set, including MACHINE, MACHINE_ARCH, and TOOLDIR. nbmake-MACHINE will also set variables specified with -V, and unset variables specified with -Z. d978 3 a980 3 Even though this is run as root, -U is required so that the permissions stored in DESTDIR/METALOG are correctly applied to the files as they're copied to /. d1005 1 a1005 1 NetBSD November 8, 2012 NetBSD @ 1.95 log @Revisions 1.92 and 1.93 of src/BUILDING were not reflected in src/doc/BUILDING.mdoc, so those changes were lost when src/BUILDING was regenerated in revision 1.94. Now update src/doc/BUILDING.mdoc and regenerate src/BUILDING to reinstate the lost changes. (I also edited one of the changes, to use the phrase "space-separated list" for consistency with other parts of the document.) The original changes were: ---------------------------- revision 1.93 date: 2011/08/06 19:52:49; author: jnemeth; state: Exp; lines: +5 -0 Add description of MKKMOD, part of PR misc/45216 ---------------------------- revision 1.92 date: 2011/01/29 16:56:26; author: jym; state: Exp; lines: +6 -4 Pass down INSTALLSETS variable to installsets target. Use :Q to escape shell meta-characters, as the variable contains a list of sets, separated by spaces. $ ./build.sh -V INSTALLSETS="base etc" install=idir should now work as expected. Reviewed by apb@@ on tech-toolchain. ---------------------------- @ text @d85 17 a101 11 HOST_SH Path name to a POSIX-compliant shell. If this is not set explicitly, then the default is set using heuris- tics dependent on the host platform, or from the shell under which build.sh is executed (if that can be deter- mined), or using the first copy of sh found in PATH. If the host system's /bin/sh is not POSIX-compliant, we suggest that you build using commands like HOST_SH=/path/to/working/shell export HOST_SH ${HOST_SH} build.sh [options] d638 25 a662 5 This script file is a Bourne shell script designed to build the entire NetBSD system on any host with a Bourne shell in /bin/sh, including many that are not POSIX compliant. Note that if a host system's /bin/sh is unusually old and broken, the Korn Shell (/bin/ksh), if available, may be a usable alternative. @ 1.94 log @Allow MAKEFLAGS to be set via build.sh -V. Somebody asked for this in 2008. Also add comments above a few functions in build.sh, and bump copyright dates. @ text @d239 5 d538 5 a542 4 The INSTALLSETS environment variable may be set to a list of distribution sets to be installed. By default, all sets except ``etc'' and ``xetc'' are installed, so most files in INSTALLWORLDDIR/etc will not be installed or modified. d676 2 a677 1 ``etc'' or ``xetc'' sets will not be installed. @ 1.93 log @Add description of MKKMOD, part of PR misc/45216 @ text @d107 3 a109 1 MAKEFLAGS Flags to invoke make(1) with. a238 5 MKKMOD Can be set to ``yes'' or ``no''. Indicates whether kernel modules are built and installed. Default: ``yes'' d534 3 a536 4 of distribution sets to be installed, separated by spaces. By default, all sets except ``etc'' and ``xetc'' are extracted, so most files in INSTALLWORLDDIR/etc will not be installed or modified. d670 1 a670 2 ``etc'' or ``xetc'' sets will not be installed, unless overridden by the INSTALLSETS environment variable. d925 1 a925 1 NetBSD May 1, 2009 NetBSD @ 1.92 log @Pass down INSTALLSETS variable to installsets target. Use :Q to escape shell meta-characters, as the variable contains a list of sets, separated by spaces. $ ./build.sh -V INSTALLSETS="base etc" install=idir should now work as expected. Reviewed by apb@@ on tech-toolchain. @ text @d237 5 @ 1.91 log @remove the MKSUBPIXEL/MKTTINTERP options; they're going away. regenerate. @ text @d532 4 a535 3 of distribution sets to be installed. By default, all sets except ``etc'' and ``xetc'' are installed, so most files in INSTALLWORLDDIR/etc will not be installed or modified. d669 2 a670 1 ``etc'' or ``xetc'' sets will not be installed. @ 1.91.2.1 log @Sync with HEAD @ text @d532 3 a534 4 of distribution sets to be installed, separated by spaces. By default, all sets except ``etc'' and ``xetc'' are extracted, so most files in INSTALLWORLDDIR/etc will not be installed or modified. d668 1 a668 2 ``etc'' or ``xetc'' sets will not be installed, unless overridden by the INSTALLSETS environment variable. @ 1.90 log @Support "extsrc", externally added programs and libraries. Users can write their own reach-overs, cross-build, install, and get set files just like base and X11 / X.org. (These sets are not included as TNF releases.) @ text @a76 3 extsrc/ ``Reachover'' build structure for externally added programs and libraries; the source is in EXTSRCSRCDIR. a166 7 EXTSRCSRCDIR Directory containing sources of externally added programs and libraries. If specified, must be an absolute path. Default: NETBSDRCDIR/../extsrc, if that exists; otherwise /usr/extsrc. a214 5 MKEXTSRC Can be set to ``yes'' or ``no''. Indicates whether extsrc is built from EXTSRCSRCDIR. Default: ``no'' a302 12 MKSUBPIXEL Can be set to ``yes'' or ``no''. For X builds, decides if subpixel rendering code in FreeType is turned on. Turned off by default because of patent issues. Default: ``no'' MKTTINTERP Can be set to ``yes'' or ``no''. For X builds, decides if the TrueType bytecode interpreter is turned on. See http://www.freetype.org/patents.html for details. Default: ``no'' a864 7 -Y extsrcsrc Set the value of EXTSRCSRCDIR to extsrcsrc. If a relative path is specified, it will be converted to an absolute path before being used. -y Set MKEXTSRC=yes. @ 1.89 log @If ${NETBDSRCDIR}/../xsrc exists, then use it as the default value of X11SRCDIR. If it doesn't exist, then use /usr/xsrc as before. OK mrg @ text @d77 3 d170 7 d225 5 d892 7 @ 1.88 log @* Use a more robust method of creating the top level object directory. Use getmakevar to expand MAKEOBJDIRPREFIX or MAKEOBJDIR, or (if neither of those variables is set) use a non-recursive "make obj" in the top level source directory. * Do not let TOP_objdir default to ${TOP}. It's now set only by the -M or -O command line options, or after using getmakevar to expand MAKEOBJDIRPREFIX or MAKEOBJDIR. * Make try_set_TOOLDIR handle MAKEOBJDIRPERFIX passed from the environment. It runs too early to use getmakevar, so it will not work if the value contains embedded '${...}' variable references. * Use '$TOOLDIR' (with a literal '$') instead of 'nonexistent' in a message when rebuilding make when TOOLDIR is not yet known. @ text @d375 2 a376 1 Default: ``/usr/xsrc'' @ 1.87 log @Allow build.sh "-C cdextra" option to be specified multiple times. @ text @d120 13 a132 8 MAKEOBJDIRPREFIX Top level directory of the object directory tree. If specified, must be an absolute path. If this is defined, ${MAKEOBJDIRPREFIX}/${.CURDIR} is used as the .OBJDIR for the current directory. The current direc- tory may be read only. MAKEOBJDIRPREFIX can be pro- vided only in the environment or via the -M flag of build.sh; it cannot usefully be set inside a Makefile, including mk.conf or ${MAKECONF}. d762 8 a769 4 -M obj Set MAKEOBJDIRPREFIX to obj. For instance, if the source directory is /usr/src, a setting of ``-M /usr/obj'' will place build-time files under /usr/obj/usr/src/bin, /usr/obj/usr/src/lib, /usr/obj/usr/src/usr.bin, and so forth. d771 6 a776 2 absolute path before being used. Unsets MAKEOBJDIR. See ``-O -obj'' for more information. d812 12 a823 5 place the built object files under obj. For instance, a set- ting of ``-O /usr/obj'' will place build-time files under /usr/obj/bin, /usr/obj/lib, /usr/obj/usr.bin, and so forth. If a relative path is specified, it will be converted to an abso- lute path before being used. Unsets MAKEOBJDIRPREFIX. @ 1.86 log @Add a modules operation to build.sh, which builds and installs kernel modules into DESTDIR. This is based on the patch provided by tsutsui@@ on tech-toolchain@@. @ text @d724 9 a732 7 Set the value of CDEXTRA to cdextras which is a space-separated list of files or directories which will be added in order to the CD-ROM image when used in conjunction with ``iso-image'' or ``iso-image-source''. Files will be added to the root of the CD-ROM image, whereas directories will be copied recursively. If relative paths are specified, they will be converted to absolute paths before being used. @ 1.85 log @regen @ text @d691 3 @ 1.84 log @regen @ text @d144 1 a144 1 ing in identical (reproducable) builds. Additional informa- @ 1.83 log @Introduce MKSUBPIXEL, which allows enabling subpixel rendering code in FreeType. @ text @d143 3 a145 3 ries to be the same when built from the same sources. Addi- tional information is available in the GCC documentation of -frandom-seed. @ 1.82 log @be explicit about MAKEOBJDIR and MAKEOBJDIRPREFIX not being for mk.conf or ${MAKECONF}. @ text @d298 6 d909 1 a909 1 NetBSD September 10, 2008 NetBSD @ 1.82.2.1 log @Sync with HEAD. Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html @ text @a297 6 MKSUBPIXEL Can be set to ``yes'' or ``no''. For X builds, decides if subpixel rendering code in FreeType is turned on. Turned off by default because of patent issues. Default: ``no'' d903 1 a903 1 NetBSD May 1, 2009 NetBSD @ 1.81 log @revert sparc back to default of XFree86 at the request of macallan. @ text @d117 2 a118 1 usefully be set inside a Makefile. d126 2 a127 1 build.sh; it cannot usefully be set inside a Makefile. @ 1.80 log @Add support for new MAKEVERBOSE levels 3 and 4. The complete list is now: 0 Minimal output ("quiet") 1 Describe what is occurring 2 Describe what is occurring and echo the actual command 3 Ignore the effect of the "@@" prefix in make commands 4 Trace shell commands using the shell's -x flag The default remains MAKEVERBOSE=2. @ text @d367 2 a368 2 Default: ``Xorg'' on amd64, i386, macppc, shark, sparc and sparc64 platforms, ``XFree86'' on everything else. @ 1.79 log @- retire MKXORG from public use - introduce X11FLAVOUR to choose src/x11 vs src/external/mit/xorg for the X11 to build if MKX11=yes is set. it takes the values of either Xorg or XFree86. - default to Xorg on alpha, i386, macppc, shark, sparc and sparc64 - remove MKXORG_WITH_XSRC_XSERVER, unused and never useful @ text @d168 2 a169 1 0 No descriptive messages are shown. d171 12 a182 1 1 Descriptive messages are shown. d184 2 a185 2 2 Descriptive messages (prefixed with a `#') and command output is not suppressed. @ 1.78 log @regen for recent change to examples and objdir advice, and for the older MKSTRIPIDENT change. @ text @d308 1 a308 1 MKX11 Can be set to ``yes'' or ``no''. Indicates whether X11R6 is a310 9 Mutually exclusive to MKXORG != no. Default: ``no'' MKXORG Can be set to ``yes'' or ``no''. Indicates whether X11R7 (modular Xorg) is built from X11SRCDIR. Mutually exclusive to MKX11 != no. d352 6 @ 1.78.2.1 log @Pull up following revision(s) (requested by mrg in ticket #64): distrib/sets/Makefile: revision 1.64 external/mit/xorg/server/Makefile: revision 1.5 share/mk/bsd.README: revision 1.237 BUILDING: revision 1.79 share/mk/bsd.x11.mk: revision 1.71 share/mk/bsd.own.mk: revision 1.544 usr.bin/ssh/Makefile.inc: revision 1.18 distrib/sets/sets.subr: revision 1.72 share/man/man5/mk.conf.5: revision 1.42 doc/BUILDING.mdoc: revision 1.68 etc/Makefile: revision 1.360 Makefile: revision 1.263 - retire MKXORG from public use - introduce X11FLAVOUR to choose src/x11 vs src/external/mit/xorg for the X11 to build if MKX11=yes is set. it takes the values of either Xorg or XFree86. - default to Xorg on alpha, i386, macppc, shark, sparc and sparc64 - remove MKXORG_WITH_XSRC_XSERVER, unused and never useful @ text @d308 1 a308 1 MKX11 Can be set to ``yes'' or ``no''. Indicates whether X11 is d311 9 a360 6 X11FLAVOUR The style of X11 cross-built, set to either ``Xorg'' or ``XFree86''. Default: ``Xorg'' on amd64, i386, macppc, shark, sparc and sparc64 platforms, ``XFree86'' on everything else. @ 1.78.2.2 log @Pull up following revision(s) (requested by mrg in ticket #64): share/man/man5/mk.conf.5: revision 1.46 share/mk/bsd.own.mk: revision 1.550 doc/BUILDING.mdoc: revision 1.70 BUILDING: revision 1.81 share/mk/bsd.README: revision 1.242 revert sparc back to default of XFree86 at the request of macallan. @ text @d355 2 a356 2 Default: ``Xorg'' on amd64, i386, macppc, shark and sparc64 platforms, ``XFree86'' on everything else. @ 1.78.2.2.4.1 log @sync to netbsd-5 @ text @a283 6 MKSUBPIXEL Can be set to ``yes'' or ``no''. For X builds, decides if subpixel rendering code in FreeType is turned on. Turned off by default because of patent issues. Default: ``no'' d889 1 a889 1 NetBSD May 1, 2009 NetBSD @ 1.78.2.3 log @Pull up following revision(s) (requested by snj in ticket #742): doc/BUILDING.mdoc: revision 1.72 external/mit/xorg/lib/freetype/Makefile: revision 1.5 BUILDING: revision 1.83 Introduce MKSUBPIXEL, which allows enabling subpixel rendering code in FreeType. @ text @a283 6 MKSUBPIXEL Can be set to ``yes'' or ``no''. For X builds, decides if subpixel rendering code in FreeType is turned on. Turned off by default because of patent issues. Default: ``no'' d889 1 a889 1 NetBSD May 1, 2009 NetBSD @ 1.78.2.4 log @Pull up following revision(s) (requested by jym in ticket #1565): Makefile: revision 1.282 via patch BUILDING: revision 1.92 via patch Pass down INSTALLSETS variable to installsets target. Use :Q to escape shell meta-characters, as the variable contains a list of sets, separated by spaces. $ ./build.sh -V INSTALLSETS="base etc" install=idir should now work as expected. Reviewed by apb@@ on tech-toolchain. @ text @d524 3 a526 4 of distribution sets to be installed, separated by spaces. By default, all sets except ``etc'' and ``xetc'' are extracted, so most files in INSTALLWORLDDIR/etc will not be installed or modified. d660 1 a660 2 ``etc'' or ``xetc'' sets will not be installed, unless overridden by the INSTALLSETS environment variable. @ 1.77 log @regen for MKHTML @ text @d277 7 d784 6 a789 4 specified. If the source directory is /usr/src and neither -M nor -O is specified, then a default object directory will be chosen according to rules in ; this default is usu- ally either /usr/obj or /usr/obj.MACHINE. d852 1 a852 1 1. % ./build.sh tools kernel=GENERIC d857 1 a857 1 2. % ./build.sh -U distribution d862 1 a862 1 3. # ./build.sh -U install=/ d869 1 a869 1 4. % ./build.sh -U -u release d892 1 a892 1 NetBSD August 18, 2008 NetBSD @ 1.76 log @Improve support for MKXORG!=no to enable builds into external/mit/xorg. This will be mutually exclusive to MKX11!=no. @ text @d196 5 @ 1.75 log @Document "build.sh cleandir". Fix formatting nit. Remove BUGS; all the in-tree platforms are using build.sh now. @ text @d299 9 @ 1.74 log @* Suggest a "-j" value between 1+NCPU and 2*NCPU for the fastest builds. * Remove some duplicated content that appeared in both the section about make's -j flag and the section about build.sh's -j flag. @ text @d625 2 d869 1 a869 4 BUGS A few platforms are not yet using this build system. NetBSD August 11, 2008 NetBSD @ 1.73 log @* Add more detail for build.sh -M and -O options. * Mention new default when source is /usr/src but build.sh is run with neither -M nor -O. @ text @d416 1 a416 3 enforce build ordering. If you see build failures with -j, please save complete build logs so the failures can be ana- lyzed. d704 7 a710 4 make(1). Makefiles should use .WAIT or have explicit dependan- cies as necessary to enforce build ordering. If you see build failures with -j, please save complete build logs so the fail- ures can be analyzed. d870 1 a870 1 NetBSD August 5, 2008 NetBSD @ 1.72 log @Builds now use "BUILDSEED" so that c++ binaries are reproduceable. By default BUILDSEED is set to NetBSD-{majorversion} -- a -S flag may be used to change it. Discussed on tech-toolchain. @ text @d111 7 a117 3 make(1). Used only if MAKEOBJDIRPREFIX is not defined. MAKEOBJDIR can only be provided in the environment or via the -O flag of build.sh. d123 3 a125 3 tory may be read only. MAKEOBJDIRPREFIX can only be provided in the environment or via the -M flag of build.sh. d711 7 a717 3 -M obj Set MAKEOBJDIRPREFIX to obj. If a relative path is specified, it will be converted to an absolute path before being used. Unsets MAKEOBJDIR. d753 11 a763 5 place the built object files under obj. If a relative path is specified, it will be converted to an absolute path before being used. For instance, a setting of /usr/obj will place build-time files under /usr/obj/bin, /usr/obj/lib, /usr/obj/usr.bin, and so forth. Unsets MAKEOBJDIRPREFIX. d869 1 a869 1 NetBSD March 18, 2008 NetBSD @ 1.71 log @Correct/clarify the default setting of USETOOLS in the previous version. Noted by apb. @ text @d133 8 d763 3 @ 1.71.4.1 log @Sync with wrstuden-revivesa-base-2. @ text @d111 3 a113 7 make(1). Typical usage is to set this variable to a value involving the use of `${.CURDIR:S...}' or `${.CURDIR:C...}', to derive the value of .OBJDIR from the value of .CURDIR. Used only if MAKEOBJDIRPREFIX is not defined. MAKEOBJDIR can be provided only in the environment or via the -O flag of build.sh; it cannot usefully be set inside a Makefile. d119 3 a121 3 tory may be read only. MAKEOBJDIRPREFIX can be pro- vided only in the environment or via the -M flag of build.sh; it cannot usefully be set inside a Makefile. a132 8 BUILDSEED GCC uses random numbers when compiling C++ code. This vari- able seeds the gcc random number generator using the -fran- dom-seed flag with this value. By default, it is set to NetBSD-(majorversion). Using a fixed value causes C++ bina- ries to be the same when built from the same sources. Addi- tional information is available in the GCC documentation of -frandom-seed. a183 5 MKHTML Can be set to ``yes'' or ``no''. Indicates whether prefor- matted HTML manual pages will be built and installed Default: ``yes'' a286 9 Mutually exclusive to MKXORG != no. Default: ``no'' MKXORG Can be set to ``yes'' or ``no''. Indicates whether X11R7 (modular Xorg) is built from X11SRCDIR. Mutually exclusive to MKX11 != no. d404 3 a406 1 enforce build ordering. a614 2 cleandir Perform ``make cleandir''. d694 8 a701 15 make(1). If you see failures for reasons other than running out of memory while using build.sh with -j, please save com- plete build logs so the failures can be analyzed. To achieve the fastest builds, -j values between (1 + the num- ber of CPUs) and (2 * the number of CPUs) are recommended. Use lower values on machines with limited memory or I/O bandwidth. -M obj Set MAKEOBJDIRPREFIX to obj. For instance, if the source directory is /usr/src, a setting of ``-M /usr/obj'' will place build-time files under /usr/obj/usr/src/bin, /usr/obj/usr/src/lib, /usr/obj/usr/src/usr.bin, and so forth. If a relative path is specified, it will be converted to an absolute path before being used. Unsets MAKEOBJDIR. See ``-O -obj'' for more information. d737 5 a741 11 place the built object files under obj. For instance, a set- ting of ``-O /usr/obj'' will place build-time files under /usr/obj/bin, /usr/obj/lib, /usr/obj/usr.bin, and so forth. If a relative path is specified, it will be converted to an abso- lute path before being used. Unsets MAKEOBJDIRPREFIX. In normal use, exactly one of the -M or -O options should be specified. If the source directory is /usr/src and neither -M nor -O is specified, then a default object directory will be chosen according to rules in ; this default is usu- ally either /usr/obj or /usr/obj.MACHINE. a754 3 -S seed Change the value of BUILDSEED to seed. This should rarely be necessary. d841 4 a844 1 NetBSD August 18, 2008 NetBSD @ 1.70 log @Assorted updates and clarifications, grammar fixes and wording improvements, and so on. Significant highlights: - mention src/tests and reference atf; - provide examples of MACHINE and MACHINE_ARCH; - mention that MKOBJ=no is not recommended; - correct the description of the default setting of USETOOLS; - document the interactions of build.sh -[uo] with various things; - document the interactions of build.sh tools and kernel=FOO; - use a lot fewer parentheses. Discussed on netbsd-docs. @ text @d317 4 a320 1 Default: ``yes'' @ 1.69 log @Consistently document RELEASEDIR/RELEASEMACHINEDIR. @ text @d57 5 a61 2 regress/ Regression test harness. Can be cross-compiled, but only run natively. d101 1 a101 1 MACHINE Machine type. d103 1 a103 1 MACHINE_ARCH Machine architecture. d146 1 a146 1 the top-level .OBJDIR) unless run in `expert' mode d226 3 d317 1 a317 4 Default: ``yes'' if building all or part of a whole NetBSD source tree (detected automatically); ``no'' otherwise (to preserve traditional semantics of the make(1) include files). d340 3 d350 5 a354 2 NBUILDJOBS Now obsolete. Use the make(1) option -j, instead (see below) d365 2 d381 1 a381 1 MKUPDATE=yes in that case. d392 1 a392 1 the top-level .OBJDIR) unless run in `expert' mode d408 3 a410 2 ``share/mk'' directory in the source tree. (This is set auto- matically when building from the top level.) d481 2 a482 2 installworld Install the distribution from DESTDIR to INSTALLWORLDDIR (which defaults to the root directory). Ensures that d488 2 a489 2 except ``etc'' and ``xetc'' are installed (so most files in INSTALLWORLDDIR/etc will not be installed or modified). d501 2 a502 2 after ``make distribution'' (as ``make build'' does not install all of the required files). d509 2 a510 2 after ``make distribution'' (as ``make build'' does not install all of the required files). d573 4 a576 2 directory ``regress''. Runs the compiled regression tests on the local host. d597 5 a601 2 build Build the system as per ``make build''. This option implies the obj and tools operations. d604 1 a604 1 This option implies the build operation. d606 2 a607 2 release Build a full release as per ``make release''. This option implies the distribution operation. d614 4 a617 1 tools Build and install the host tools from src/tools. d630 7 a636 3 In order to ensure that the kernel is built using up-to- date tools, it is strongly recommended that the tools be rebuilt (using the tools operation). d639 1 a639 1 Install a gzip(1)ed copy of the kernel built by d690 5 a694 4 -j njob Passed through to make(1). Makefiles should use .WAIT or have explicit dependancies as necessary to enforce build ordering. If you see build failures with -j, please save complete build logs so the failures can be analyzed. d741 2 a742 2 automatically set to ``yes'' (which is opposite to the default behaviour). d754 2 a755 2 used. If set, the bootstrap ``make'' will only be rebuilt as needed (when the source files for make(1) change). d791 2 a792 2 build.sh will also set variables specified with -V, and unset variables specified with -Z. d824 1 a824 1 NBUILDJOBS Use the make(1) option -j, instead. @ 1.68 log @Mention that "build" and "distribution" do not build nor install (to DESTDIR) a kernel. @ text @d488 3 a490 3 RELEASEDIR/MACHINE/binary/sets. Should be run after ``make distribution'' (as ``make build'' does not install all of the required files). d496 3 a498 3 RELEASEDIR/MACHINE/binary/syspkgs. Should be run after ``make distribution'' (as ``make build'' does not install all of the required files). d520 5 a524 5 the RELEASEDIR/MACHINE/installation/cdrom directory by ``make release''. These smaller images usually contain the same tools as the larger images in RELEASEDIR/iso, but do not contain additional content such as the distribution sets. d548 5 a552 5 the RELEASEDIR/MACHINE/installation/cdrom directory by ``make release''. These smaller images usually contain the same tools as the larger images in RELEASEDIR/iso, but do not contain additional content such as the distribution sets. d616 4 a619 3 kernel=kconf into RELEASEDIR/MACHINE/binary/kernel, usually as netbsd-kconf.gz, although the ``netbsd'' prefix is determined from the ``config'' directives in kconf. d816 1 a816 1 NetBSD March 8, 2008 NetBSD @ 1.67 log @Add support for CDBUILDEXTRA which acts like CDEXTRA to add extra items to the CD-ROM image. Make CDEXTRA and CDBUILDEXTRA be able to contain lists of files and directories which are added in turn. Add support for CDEXTRA_SKIP which contains a list of fnmatch(3) items to skip during the copy. This is _very_ useful for skipping CVS dirs for example. CDBUILDEXTRA and CDEXTRA_SKIP are to be used in Makefiles creating the images, CDEXTRA remains to be used from build.sh. Update documentation and build.sh help text to show that -C can be used to specify a list of files and directories rather than just a single dir. @ text @d457 3 a459 3 build Build the entire NetBSD system. This orders portions of the source tree such that prerequisites will be built in the proper order. d462 3 a464 2 into DESTDIR, including files in DESTDIR/dev, DESTDIR/etc, DESTDIR/root and DESTDIR/var. d815 1 a815 1 NetBSD September 1, 2007 NetBSD @ 1.67.4.1 log @sync with head. @ text @d457 3 a459 3 build Build the entire NetBSD system (except the kernel). This orders portions of the source tree such that prerequisites will be built in the proper order. d462 2 a463 3 (which does not include a kernel) into DESTDIR, including files in DESTDIR/dev, DESTDIR/etc, DESTDIR/root and DESTDIR/var. d487 3 a489 3 RELEASEDIR/RELEASEMACHINEDIR/binary/sets. Should be run after ``make distribution'' (as ``make build'' does not install all of the required files). d495 3 a497 3 RELEASEDIR/RELEASEMACHINEDIR/binary/syspkgs. Should be run after ``make distribution'' (as ``make build'' does not install all of the required files). d519 5 a523 5 the RELEASEDIR/RELEASEMACHINEDIR/installation/cdrom direc- tory by ``make release''. These smaller images usually contain the same tools as the larger images in RELEASEDIR/iso, but do not contain additional content such as the distribution sets. d547 5 a551 5 the RELEASEDIR/RELEASEMACHINEDIR/installation/cdrom direc- tory by ``make release''. These smaller images usually contain the same tools as the larger images in RELEASEDIR/iso, but do not contain additional content such as the distribution sets. d615 3 a617 4 kernel=kconf into RELEASEDIR/RELEASEMACHINEDIR/binary/kernel, usually as netbsd-kconf.gz, although the ``netbsd'' prefix is deter- mined from the ``config'' directives in kconf. d814 1 a814 1 NetBSD March 18, 2008 NetBSD @ 1.66 log @Convert build.sh iso-dir=directory option to -C cddir as per jmmv@@ on source-changes. @ text @d637 1 a637 1 build idenfitier to the name of the ``make'' wrapper script so d641 8 a648 5 -C cddir Set the value of CDEXTRA to cddir. If a relative path is spec- ified, it will be converted to an absolute path before being used. When combined with ``iso-image'' or ``iso-image-source'', it will cause the contents of cddir to be added to the CD-ROM image. @ 1.65 log @Add an iso-dir=directory option. When combined with iso-image or iso-image-source, it will cause directory to be added to the CD-ROM image. @ text @a629 6 iso-dir=directory When combined with ``iso-image'' or ``iso-image-source'', it will cause directory to be added to the CD-ROM image. If directory does not start with ``/'' then it will be made relative to RELEASEDIR. d641 6 @ 1.64 log @describe new iso-image-source target @ text @d627 9 d811 1 a811 1 NetBSD August 30, 2007 NetBSD @ 1.63 log @Remove STATUS paragraph which makes it sound like the build system is half baked. @ text @d530 28 d802 1 a802 1 NetBSD April 13, 2007 NetBSD @ 1.62 log @Document recent changes to "make iso-image". @ text @a5 15 STATUS This document is a work-in-progress. As such, the information described here may not match the reality of the build system as of this writing. Once this document is completely in sync with reality, this paragraph will be removed. Discrepancies between this documentation and the current reality of implementation are noted specially, as with the note below: Note: This document applies only to platforms which use the new toolchain as indicated by the default setting of TOOLCHAIN_MISSING in . Platforms which have not yet been switched to the new toolchain should continue building traditionally, using the notes specified in the file UPDATING. @ 1.62.4.1 log @sync with HEAD @ text @d6 15 a544 28 iso-image-source Create a NetBSD installation CD-ROM image in the RELEASEDIR/iso directory. The CD-ROM file system will have a layout as described in release(7). It will have top level directories for the machine type and source. For most machine types, the CD-ROM will be bootable, and will automatically run the sysinst(8) menu-based installa- tion program, which can be used to install or upgrade a NetBSD system. Bootable CD-ROMs also contain tools that may be useful in repairing a damaged NetBSD installation. Before ``make iso-image-source'' is attempted, RELEASEDIR must be populated by ``make sourcesets release'' or equiva- lent. Note that other, smaller, CD-ROM images may be created in the RELEASEDIR/MACHINE/installation/cdrom directory by ``make release''. These smaller images usually contain the same tools as the larger images in RELEASEDIR/iso, but do not contain additional content such as the distribution sets. Note that the mac68k port still uses an older method of creating CD-ROM images. This requires the mkisofs(1) util- ity, which is not part of NetBSD, but which can be installed from pkgsrc/sysutils/cdrtools. a613 3 iso-image-source Perform ``make iso-image-source''. a624 6 -C cddir Set the value of CDEXTRA to cddir. If a relative path is spec- ified, it will be converted to an absolute path before being used. When combined with ``iso-image'' or ``iso-image-source'', it will cause the contents of cddir to be added to the CD-ROM image. d789 1 a789 1 NetBSD September 1, 2007 NetBSD @ 1.62.4.2 log @sync with HEAD @ text @d637 1 a637 1 build identifier to the name of the ``make'' wrapper script so d641 5 a645 8 -C cdextras Set the value of CDEXTRA to cdextras which is a space-separated list of files or directories which will be added in order to the CD-ROM image when used in conjunction with ``iso-image'' or ``iso-image-source''. Files will be added to the root of the CD-ROM image, whereas directories will be copied recursively. If relative paths are specified, they will be converted to absolute paths before being used. @ 1.62.4.3 log @sync with HEAD @ text @d457 3 a459 3 build Build the entire NetBSD system (except the kernel). This orders portions of the source tree such that prerequisites will be built in the proper order. d462 2 a463 3 (which does not include a kernel) into DESTDIR, including files in DESTDIR/dev, DESTDIR/etc, DESTDIR/root and DESTDIR/var. d487 3 a489 3 RELEASEDIR/RELEASEMACHINEDIR/binary/sets. Should be run after ``make distribution'' (as ``make build'' does not install all of the required files). d495 3 a497 3 RELEASEDIR/RELEASEMACHINEDIR/binary/syspkgs. Should be run after ``make distribution'' (as ``make build'' does not install all of the required files). d519 5 a523 5 the RELEASEDIR/RELEASEMACHINEDIR/installation/cdrom direc- tory by ``make release''. These smaller images usually contain the same tools as the larger images in RELEASEDIR/iso, but do not contain additional content such as the distribution sets. d547 5 a551 5 the RELEASEDIR/RELEASEMACHINEDIR/installation/cdrom direc- tory by ``make release''. These smaller images usually contain the same tools as the larger images in RELEASEDIR/iso, but do not contain additional content such as the distribution sets. d615 3 a617 4 kernel=kconf into RELEASEDIR/RELEASEMACHINEDIR/binary/kernel, usually as netbsd-kconf.gz, although the ``netbsd'' prefix is deter- mined from the ``config'' directives in kconf. d814 1 a814 1 NetBSD March 18, 2008 NetBSD @ 1.61 log @Document the fact that "make installworld" and "build.sh installworld=..." do not install the etc or xetc sets. Suggest using etcupdate(8) and postinstall(8) after installworld. @ text @d520 24 a543 6 iso-image Create a CD-ROM image in RELEASEDIR/MACHINE/installation/cdrom. RELEASEDIR must already have been populated by ``make release'' or equiva- lent. This requires the mkisofs(1) utility, which is not part of NetBSD, but which can be installed from pkgsrc/sysutils/cdrtools. d779 1 a779 1 make(1), hier(7), release(7), etcupdate(8), postinstall(8), d789 1 a789 1 NetBSD March 27, 2007 NetBSD @ 1.60 log @Try to clarify the description of build.sh -m mach. Document new evbarm-eb and evbarm-el aliases. @ text @d488 12 a499 2 Note: It is highly recommended that you upgrade your kernel and reboot before performing this operation. d568 2 a569 1 installworld''. d761 2 a762 1 make(1), hier(7), release(7), pkgsrc/sysutils/cdrtools d771 1 a771 1 NetBSD January 4, 2006 NetBSD @ 1.59 log @Clarify that DESTDIR/OBJDIR/etc are absolute paths, but build.sh -D/-O/etc allows relative paths. Closes PR 32345 by Andre Luiz de Oliveira. @ text @d619 10 a628 10 -m mach Set the value of MACHINE to mach. This will also override any value of MACHINE_ARCH in the process environment with a value deduced from mach, unless -a is specified, or mach is a special case listed below. All cross builds require -m, but if unset on a NetBSD host, the host's value of MACHINE will be detected and used automatically. Some machines support multiple values for MACHINE_ARCH. For a given value of mach, the following MACHINE and MACHINE_ARCH values will result: d631 3 @ 1.59.2.1 log @Pull up following revision(s) (requested by apb in ticket #572): BUILDING: revision 1.61 doc/BUILDING.mdoc: revision 1.48 Improve documentation for "make installworld". @ text @d488 2 a489 12 The INSTALLSETS environment variable may be set to a list of distribution sets to be installed. By default, all sets except ``etc'' and ``xetc'' are installed (so most files in INSTALLWORLDDIR/etc will not be installed or modified). Note: Before performing this operation with INSTALLWORLDDIR=/, it is highly recommended that you upgrade your kernel and reboot. After performing this operation, it is recommended that you use etcupdate(8) to update files in INSTALLWORLDDIR/etc and that you use postinstall(8) to check for inconsistencies (and possibly to fix them). d558 1 a558 2 installworld''. Note that files that are part of the ``etc'' or ``xetc'' sets will not be installed. d747 1 a747 2 make(1), hier(7), release(7), etcupdate(8), postinstall(8), pkgsrc/sysutils/cdrtools d756 1 a756 1 NetBSD March 27, 2007 NetBSD @ 1.59.2.2 log @Pull up following revision(s) (requested by apb in ticket #573): share/man/man8/sysinst.8: revision 1.1 distrib/sets/lists/man/mi: revision 1.987 share/man/man8/Makefile: revision 1.89 BUILDING: revision 1.62 share/man/man7/release.7: revision 1.22 doc/BUILDING.mdoc: revision 1.49 Improve documentation for "make iso-image" and release(7), and add a rudimentary man page for sysinst(8). @ text @d520 6 a525 24 iso-image Create a NetBSD installation CD-ROM image in the RELEASEDIR/iso directory. The CD-ROM file system will have a layout as described in release(7). For most machine types, the CD-ROM will be bootable, and will automatically run the sysinst(8) menu-based installa- tion program, which can be used to install or upgrade a NetBSD system. Bootable CD-ROMs also contain tools that may be useful in repairing a damaged NetBSD installation. Before ``make iso-image'' is attempted, RELEASEDIR must be populated by ``make release'' or equivalent. Note that other, smaller, CD-ROM images may be created in the RELEASEDIR/MACHINE/installation/cdrom directory by ``make release''. These smaller images usually contain the same tools as the larger images in RELEASEDIR/iso, but do not contain additional content such as the distribution sets. Note that the mac68k port still uses an older method of creating CD-ROM images. This requires the mkisofs(1) util- ity, which is not part of NetBSD, but which can be installed from pkgsrc/sysutils/cdrtools. d758 1 a758 1 make(1), hier(7), release(7), etcupdate(8), postinstall(8), sysinst(8), d768 1 a768 1 NetBSD April 13, 2007 NetBSD @ 1.59.2.2.2.1 log @Catch up w/ last night's netbsd-4 @ text @a544 28 iso-image-source Create a NetBSD installation CD-ROM image in the RELEASEDIR/iso directory. The CD-ROM file system will have a layout as described in release(7). It will have top level directories for the machine type and source. For most machine types, the CD-ROM will be bootable, and will automatically run the sysinst(8) menu-based installa- tion program, which can be used to install or upgrade a NetBSD system. Bootable CD-ROMs also contain tools that may be useful in repairing a damaged NetBSD installation. Before ``make iso-image-source'' is attempted, RELEASEDIR must be populated by ``make sourcesets release'' or equiva- lent. Note that other, smaller, CD-ROM images may be created in the RELEASEDIR/MACHINE/installation/cdrom directory by ``make release''. These smaller images usually contain the same tools as the larger images in RELEASEDIR/iso, but do not contain additional content such as the distribution sets. Note that the mac68k port still uses an older method of creating CD-ROM images. This requires the mkisofs(1) util- ity, which is not part of NetBSD, but which can be installed from pkgsrc/sysutils/cdrtools. a613 3 iso-image-source Perform ``make iso-image-source''. a624 6 -C cddir Set the value of CDEXTRA to cddir. If a relative path is spec- ified, it will be converted to an absolute path before being used. When combined with ``iso-image'' or ``iso-image-source'', it will cause the contents of cddir to be added to the CD-ROM image. d786 1 a786 1 NetBSD September 1, 2007 NetBSD @ 1.59.2.3 log @Pull up following revision(s) (requested by jnemeth in ticket #864): distrib/common/Makefile.bootcd: revision 1.9 distrib/common/Makefile.bootcd: revision 1.10 distrib/common/Makefile.bootcd: revision 1.11 doc/BUILDING.mdoc: revision 1.51 doc/BUILDING.mdoc: revision 1.52 doc/BUILDING.mdoc: revision 1.53 build.sh: revision 1.172 build.sh: revision 1.173 build.sh: revision 1.174 build.sh: revision 1.175 BUILDING: revision 1.64 BUILDING: revision 1.65 BUILDING: revision 1.66 share/man/man7/release.7: revision 1.23 share/man/man7/release.7: revision 1.24 Makefile: revision 1.248 Add an iso-dir=directory option. When combined with iso-image or iso-image-source, it will cause directory to be added to the CD-ROM image. Convert build.sh iso-dir=directory option to -C cddir as per jmmv@@ on source-changes. @ text @a544 28 iso-image-source Create a NetBSD installation CD-ROM image in the RELEASEDIR/iso directory. The CD-ROM file system will have a layout as described in release(7). It will have top level directories for the machine type and source. For most machine types, the CD-ROM will be bootable, and will automatically run the sysinst(8) menu-based installa- tion program, which can be used to install or upgrade a NetBSD system. Bootable CD-ROMs also contain tools that may be useful in repairing a damaged NetBSD installation. Before ``make iso-image-source'' is attempted, RELEASEDIR must be populated by ``make sourcesets release'' or equiva- lent. Note that other, smaller, CD-ROM images may be created in the RELEASEDIR/MACHINE/installation/cdrom directory by ``make release''. These smaller images usually contain the same tools as the larger images in RELEASEDIR/iso, but do not contain additional content such as the distribution sets. Note that the mac68k port still uses an older method of creating CD-ROM images. This requires the mkisofs(1) util- ity, which is not part of NetBSD, but which can be installed from pkgsrc/sysutils/cdrtools. a613 3 iso-image-source Perform ``make iso-image-source''. a624 6 -C cddir Set the value of CDEXTRA to cddir. If a relative path is spec- ified, it will be converted to an absolute path before being used. When combined with ``iso-image'' or ``iso-image-source'', it will cause the contents of cddir to be added to the CD-ROM image. d786 1 a786 1 NetBSD September 1, 2007 NetBSD @ 1.58 log @Use ${HOST_SH} instead of the host system's /bin/sh wherever possible: * Describe the HOST_SH variable, and the way build.sh attempts to set it. * Suggest passing HOST_SH in the environment if /bin/sh is not a working shell. @ text @d122 2 a123 1 tory. Used only if MAKEOBJDIRPREFIX is not defined. d128 5 a132 4 this is defined, ${MAKEOBJDIRPREFIX}/${.CURDIR} is used as the .OBJDIR for the current directory. The current directory may be read only. MAKEOBJDIRPREFIX can only be provided in the environment or via the -M flag of d148 5 a152 5 /usr/lib, and so forth. This pathname should not end with a slash (/) character (for installation into the system's root directory, set DESTDIR to an empty string). The directory must reside on a file system which supports long file names and hard links. d298 7 a304 6 TOOLDIR Directory to hold the host tools, once built. This directory should be unique to a given host system and NetBSD source tree. (However, multiple targets may share the same TOOLDIR; the target-dependent files have unique names.) If unset, a default based on the uname(1) information of the host plat- form will be created in the .OBJDIR of src. d331 3 a333 2 X11SRCDIR Directory containing the X11R6 source. The main X11R6 source is found in X11SRCDIR/xfree/xc. d342 1 a342 1 to. d391 1 d596 3 a598 1 -D dest Set the value of DESTDIR to dest. d615 3 a617 1 -M obj Set MAKEOBJDIRPREFIX to obj. Unsets MAKEOBJDIR. d650 5 a654 4 place the built object files under obj. For instance, a set- ting of /usr/obj will place build-time files under /usr/obj/bin, /usr/obj/lib, /usr/obj/usr.bin, and so forth. Unsets MAKEOBJDIRPREFIX. d660 3 a662 1 -R rel Set the value of RELEASEDIR to rel. d668 4 a671 3 -T tools Set the value of TOOLDIR to tools. If set, the bootstrap ``make'' will only be rebuilt as needed (when the source files for make(1) change). d685 3 a687 1 the full name of the file, not just a directory name. d690 3 a692 1 Set the value of X11SRCDIR to x11src. @ 1.57 log @mkisofs is in pkgsrc/sysutils/cdrtools now, not pkgsrc/sysutils/cdrecord. Reported by Jukka Salmi. @ text @d97 12 @ 1.56 log @* Add an "iso-image" target in the top level Makefile, which invokes make iso-image in the etc directory. * Add an "iso-image" action in build.sh, which invokes make iso-image. * Document the above in doc/BUILDING.mdoc. * Re-generate BUILDING. Approved by christos @ text @d498 1 a498 1 pkgsrc/sysutils/cdrecord. d718 1 a718 1 make(1), hier(7), release(7), pkgsrc/sysutils/cdrecord @ 1.55 log @Bump date for syspkgs. @ text @d493 7 d566 2 d718 1 a718 1 make(1), hier(7), release(7) @ 1.54 log @Document "make syspkgs" and "build.sh syspkgs". Reviewed by agc @ text @d718 1 a718 1 NetBSD February 6, 2003 NetBSD @ 1.53 log @Document the environment variables for if you need to override or manually select your compilers. (And regen BUILDING from doc/BUILDING.mdoc.) @ text @d482 5 d537 1 a537 1 configuration file suitable for use by config(8). If kconf d557 2 @ 1.52 log @Fix some typo's/bad wording as highlighted in PR#27219 @ text @d31 2 a32 1 the NetBSD build process. d97 4 @ 1.51 log @regen (Document -h. From Karsten Kruse in PR 25974. While here, remove a duplicate sentence). @ text @d4 1 a4 1 BUILDING - Procedure for building NetBSD from source code. d258 5 a262 5 sions, and file flags, will not be set on the installed item; instead the information will be appended to a file called METALOG in DESTDIR. The contents of METALOG is used during the generation of the distribution tar files to ensure that the appropriate file ownership is stored. d378 2 a379 2 This is only a summary of options available to make(1); only the options used most frequently with NetBSD builds are listed here. d382 1 a382 1 use .WAIT or have explicit dependancies as necessary to d463 1 a463 1 INSTALLWORLDDIR is the not root directory if cross compil- @ 1.50 log @Document MKTTINTERP. @ text @d547 2 a548 3 The following command line options alter the behaviour of the above oper- ations: The following command line options alter the behaviour of the build.sh operations described above: d568 2 @ 1.49 log @* Document build.sh -X and -x * Document MKX11 and X11SRCDIR * Remove note warning against cross-building from systems other than NetBSD; it works on many other platforms. @ text @d250 6 @ 1.48 log @Note tools/compat/README as the place to get notes from non-native cross builds @ text @a32 5 Note: A couple of host toolchain components are not yet available in the tools directory. Also, some tools use non-POSIX, non-ANSI C extensions and need to be standardized. As a result, cross-compil- ing from systems other than NetBSD is not currently supported. d85 3 d268 5 d305 5 d410 1 a410 3 files known to be created at build time. ``make distclean'' may be used as a synonym, for familiarity with a similar well- known convention. d421 2 d634 5 d699 1 a699 1 NetBSD December 19, 2003 NetBSD @ 1.47 log @Change -v to -V in the following section: "Print make(1)'s idea of the value of var. Does not build any targets." To reflect reality. Found by Tomasz Marciniak , thanks! @ text @d45 4 @ 1.46 log @Improve how build.sh -N and MAKEVERBOSE interoperate; rather than adding '-s' to make's command line in the makewrapper, use the .SILENT target based on MAKEVERBOSE's value. This means that you can do: ./build.sh -N 1 makewrapper $TOOLDIR/bin/nbmake-$MACHINE # runs at MAKEVERBOSE==1, with command lines suppressed $TOOLDIR/bin/nbmake-$MACHINE MAKEVERBOSE=2 # runs at MAKEVERBOSE==2 for this invocation, with command lines shown @ text @d379 1 a379 1 -v var Print make(1)'s idea of the value of var. Does not build any d682 1 a682 1 NetBSD October 25, 2003 NetBSD @ 1.45 log @Implement build -N noisy, which sets MAKEVERBOSE to noisy and adds `-s' to MAKEFLAGS for noisy < 2. @ text @d581 2 a582 8 Set the ``noisyness'' level of the build Supported values of noiselevel are: 0 Quiet build. 1 Operations are described, command lines are suppressed. 2 Noisy build. This is the default. @ 1.44 log @regenerate for "%" prompt update @ text @d144 12 d580 10 d688 1 a688 1 NetBSD August 7, 2003 NetBSD @ 1.43 log @Backout the previous commit @ text @d12 2 a13 2 Discrepancies between this documentation and the current reality of im- plementation are noted specially, as with the note below: d45 2 a46 2 Makefile The main Makefile for NetBSD; should only be run for na- tive builds with an appropriately up-to-date version of d64 2 a65 2 Makefile semantics when building these programs for a na- tive host. d152 2 a153 2 Will not affect use of the standard low-security password en- cryption system, crypt(3). d158 2 a159 2 documentation destined for DESTDIR/usr/share/doc will be in- stalled during a build. d193 2 a194 2 Language System locale zone files will be compiled and in- stalled during a build. d215 2 a216 2 format libraries (lib*_pic.a), used to generate shared li- braries, are installed during a build. d229 2 a230 2 destined to reside in DESTDIR/usr/share will be built and in- stalled during a build. If set to ``no'', then all of d236 4 a239 4 MKUNPRIVED Can be set to ``yes'' or ``no''. Indicates whether an un- privileged install will occur. The user, group, permissions, and file flags, will not be set on the installed item; in- stead the information will be appended to a file called d246 2 a247 2 MKUPDATE Can be set to ``yes'' or ``no''. Indicates whether all in- stall operations intended to write to DESTDIR will compare d249 2 a250 2 if the destination files are up-to-date. This also has im- plications on full builds (see next subsection). d283 2 a284 2 preserve traditional semantics of the make(1) in- clude files). d295 2 a296 2 MKOBJDIRS Can be set to ``yes'' or ``no''. Indicates whether ob- ject directories will be created automatically (via a d330 2 a331 2 thinking that some programs are out-of-date simply be- cause the system include files have changed. However, d352 2 a353 2 use .WAIT or have explicit dependancies as necessary to en- force build ordering. If you see build failures with -j, d384 2 a385 2 cleandir Same as clean, but also remove preformatted documentation, de- pendency files generated by ``make depend'', and any other d390 2 a391 2 depend Create dependency files (.depend) containing more detailed in- formation about the dependencies of source code on header d399 2 a400 2 includes Build and install system header files. Typically needed be- fore any system libraries or programs can be built. d447 4 a450 4 release Do a ``make distribution'', build kernels, distribution me- dia, and install sets (this as per ``make sets''), and then package the system into a standard release layout as de- scribed by release(7). This requires that RELEASEDIR be d477 2 a478 2 build Build the system as per ``make build''. This option im- plies the obj and tools operations. d510 2 a511 2 as netbsd-kconf.gz, although the ``netbsd'' prefix is de- termined from the ``config'' directives in kconf. d624 1 a624 1 1. ./build.sh tools kernel=GENERIC d629 1 a629 1 2. ./build.sh -U distribution d641 1 a641 1 4. ./build.sh -U -u release @ 1.42 log @Remove # from the example. @ text @d634 1 a634 1 3. ./build.sh -U install=/ @ 1.41 log @fix description of MAKEOBJDIR. from Martin Husemann @ text @d634 1 a634 1 3. # ./build.sh -U install=/ @ 1.40 log @Add build.sh -Z var, to unset a variable and ensure it's unset in makewrapper. For -M MAKEOBJDIRPREFIX, unset MAKEOBJDIR. For -O MAKEOBJDIR, unset MAKEOBJDIRPREFIX. @ text @d105 1 a105 1 via the -M flag of build.sh. d666 1 a666 1 NetBSD July 29, 2003 NetBSD @ 1.39 log @fix default location of TOOLDIR @ text @d544 1 a544 1 -M obj Set MAKEOBJDIRPREFIX to obj. d575 2 a576 1 /usr/obj/bin, /usr/obj/lib, and so forth. d597 2 a598 1 Set the variable var to value (which is optional). d606 3 d617 3 d666 1 a666 1 NetBSD July 18, 2003 NetBSD @ 1.38 log @Update for the MKUNPRIVED/MKUPDATE changes. @ text @d259 1 a259 1 form will be created in the .OBJDIR of src/tools. @ 1.37 log @rebuild with new groff @ text @d236 18 a262 17 UNPRIVED If set, then an unprivileged install will occur. The user, group, permissions, and file flags, will not be set on the installed item; instead the information will be appended to a file called METALOG in DESTDIR. The contents of METALOG is used during the generation of the distribution tar files to ensure that the appropriate file ownership is stored. Default: Unset. UPDATE If set, then all install operations intended to write to DESTDIR will compare file timestamps before installing, and skip the install phase if the destination files are up-to- date. This also has implications on full builds (see next subsection). Default: Unset. d301 7 d334 1 a334 1 UPDATE in that case. a345 4 UPDATE If set, then in addition to the effects described for UPDATE above, this implies the effects of NOCLEANDIR (i.e., ``make cleandir'' is avoided). d533 2 a534 2 builds, and UNPRIVED does not have to be set when building as a non-root user. d591 1 a591 1 -U Set the UNPRIVED variable. d593 1 a593 1 -u Set the UPDATE variable. d637 3 a639 3 UPDATE (-u) is set to prevent the ``make cleandir'', so that if this is run after example 2, it doesn't need to redo that portion of the release build. d658 1 a658 1 NetBSD July 3, 2003 NetBSD @ 1.36 log @attempt to clarify how MAKEOBJDIR{,PREFIX} may be provided ... (this document needs a rototill, which i may get to whilst writing a paper about build.sh) @ text @a39 1 d522 2 a523 2 that the resulting name is of the form ``nbmake-MACHINE- BUILDID''. d654 1 a654 1 NetBSD July 3, 2003 10 @ 1.35 log @all: * add "releasekernel=conf", to install a gzipped copy of the kernels built by "kernel=conf" to RELEASEDIR/MACHINE/binary/kernel build.sh: * be more consistent in various status messages * move the {release,}kernel=conf conf parsing code into getkernelconf() and use in both buildkernel() and releasekernel() * only warn once when building multiple kernels without updating the tools @ text @d105 2 a106 1 MAKEOBJDIR can only be provided in the environment. d112 2 a113 1 be provided in the environment. d655 1 a655 1 NetBSD May 25, 2003 10 @ 1.34 log @For normal builds, MKOBJDIRS default to `no' (not `yes'). It's only build.sh that sets this to `yes' by default. Noted by OGAWA Takaya in [toolchain/19823] @ text @d488 3 d502 5 a506 2 install=idir Install the contents of DESTDIR to idir, using ``make installworld''. d653 1 a653 1 NetBSD May 18, 2003 10 @ 1.33 log @improve description of how "build.sh -m mach" sets the default MACHINE_ARCH, and list the special cases that this does not occur for. @ text @d297 1 a297 1 Default: ``yes'' d566 3 a568 1 -o Set the value of MKOBJDIRS to ``no''. d647 1 a647 1 NetBSD May 17, 2003 10 @ 1.32 log @crank date for previous @ text @d537 19 a555 3 deduced from mach, unless -a is specified. All cross builds require -m, but if unset on a NetBSD host, the host's value of MACHINE will be detected and used automatically. d645 1 a645 1 NetBSD May 10, 2003 10 @ 1.31 log @Add "sourcesets" argument/target, which builds source sets into RELEASEDIR/source/sets @ text @d629 1 a629 1 NetBSD May 8, 2003 10 @ 1.30 log @build.sh now provides defaults for DESTDIR and RELEASEDIR if not expert mode. Remove -D and -R from EXAMPLES since they're not necessary any more. @ text @d439 3 d503 2 @ 1.29 log @Fix example 3; the build.sh target is "install" not "installworld". Improve description. Noted by Valeriy Ushakov (uwe@@) in private email. @ text @d135 3 d334 3 d587 1 a587 1 2. ./build.sh -U -D /path/to/destdir distribution d589 2 a590 2 Using unprivileged mode, build a complete distribution in /path/to/destdir. d592 1 a592 1 3. # ./build.sh -U -D /path/to/destdir install=/ d596 2 a597 2 sions stored in /path/to/destdir/METALOG are correctly applied to the files as they're copied to /. d599 1 a599 1 4. ./build.sh -U -u -D /path/to/destdir -R /path/to/releasedir release d601 5 a605 4 Using unprivileged mode, build a complete release in /path/to/dir/releasedir. UPDATE (-u) is set to prevent the ``make cleandir'', so that if this is run after example 2, it doesn't need to redo that portion of the release build. d624 1 a624 1 NetBSD February 8, 2003 10 @ 1.28 log @attempt to further improve and clarify the examples... @ text @d586 1 a586 1 3. # ./build.sh -U -D /path/to/destdir installworld=/ d588 4 a591 4 As root, install the distribution that was built by example 2 into /path/to/destdir to /. Even though this is run as root, -U is re- quired so that the permissions stored in /path/to/destdir/METALOG are correctly applied to the files as they're copied to /. d617 1 a617 1 NetBSD February 2, 2003 10 @ 1.27 log @Prefix various paths with 'DESTDIR', to highlight that the DESTDIR is taken into account. @ text @d332 2 a333 1 UPDATE above, this implies the effects of NOCLEANDIR. d576 23 a598 18 ./build.sh tools kernel=GENERIC Build a new toolchain, and use the new toolchain to configure and build a new GENERIC kernel. ./build.sh -U -D /path/to/destdir distribution Using unprivileged mode, build a complete distribution in /path/to/destdir. # ./build.sh -U -D /path/to/destdir installworld=/ As root, install the distribution that was built with unprivi- leged mode from /path/to/destdir to /. (Even though this is run as root, -U is required so that the permissions stored in /path/to/destdir/METALOG are correctly applied to the files as they're copied to /). ./build.sh -U -D /path/to/destdir -R /path/to/releasedir release Using unprivileged mode, build a complete release in /path/to/dir/releasedir. d617 1 a617 1 NetBSD January 30, 2003 10 @ 1.26 log @allow toolprefix to be easily changed @ text @d70 2 a71 2 shot, such as files installed in /etc on the destination system, boot media, and release notes. d154 2 a155 2 documentation destined for /usr/share/doc will be installed during a build. d179 1 a179 1 /usr/libdata/lint. d225 4 a228 4 destined to reside in /usr/share will be built and installed during a build. If set to ``no'', then all of MKCATPAGES, MKDOC, MKINFO, MKMAN, and MKNLS will be set to ``no'' uncon- ditionally. d391 3 a393 3 Few files will be installed to /dev, /etc, /root or /var in order to prevent user supplied configuration data from being overwritten. d413 2 a414 2 into DESTDIR, including files in /dev, /etc, /root and /var. d579 1 a579 1 ./build.sh -U -D /path/to/DESTDIR distribution d581 1 a581 1 /path/to/DESTDIR. d583 1 a583 1 # ./build.sh -U -D /path/to/DESTDIR installworld=/ d585 1 a585 1 leged mode from /path/to/DESTDIR to /. (Even though this is d587 1 a587 1 /path/to/DESTDIR/METALOG are correctly applied to the files as d590 1 a590 1 ./build.sh -U -D /path/to/DESTDIR -R /path/to/RELEASE release d592 1 a592 1 /path/to/dir/RELEASE. @ 1.25 log @Various improvements per discussion with Alan Barrett. @ text @d611 1 a611 1 NetBSD January 26, 2003 10 @ 1.24 log @- Add "sets" top-level Makefile target and build.sh operation. [Latter suggested by Julio Merino in private email] - Add "help" build.sh operation. @ text @d427 5 d433 4 a436 3 dia, and install sets, and then package the system into a standard release layout as described by release(7). This requires that RELEASEDIR be set (see above). a442 5 sets Create distribution sets from DESTDIR into RELEASEDIR/MACHINE/binary/sets. Should be run after ``make distribution'' (as ``make build'' does not install all of the required files). d577 1 a577 2 and build a new GENERIC kernel. This is a simpler way to achieve what the first three examples do. d579 1 a579 1 ./build.sh -U -D /some/DESTDIR distribution d581 1 a581 1 /some/DESTDIR. d583 1 a583 1 # ./build.sh -U -D /some/DESTDIR installworld=/ d585 3 a587 3 leged mode from /some/DESTDIR to /. (Even though this is run as root, -U is required so that the permissions stored in /some/DESTDIR/METALOG are correctly applied to the files as d590 1 a590 1 ./build.sh -U -D /some/dir/DESTDIR -R /some/dir/RELEASE release d592 1 a592 1 /some/dir/RELEASE. @ 1.23 log @Change build.sh so that at least one operation is required. Add "makewrapper" operation to build.sh. [The above changes were suggested by Alan Barrett on current-users@@] Fail if building as non-root unless: UNPRIVED is set, -U is given, or -E (expert mode) is given. [Suggested by James Wetterau in private email] Improve the examples in BUILDING. @ text @d437 5 d490 2 @ 1.22 log @Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE}) @ text @d465 3 d500 7 a506 2 -E Set `expert' mode; DESTDIR does not have to be set to a non- root path for builds when this is set. d547 1 a547 3 Set the variable var to value (which is optional). This is useful for setting RELEASEDIR without actually building a re- lease. a566 10 ./build.sh tools Build a new toolchain. cd ${KERNCONFDIR} ; ${TOOLDIR}/bin/nbconfig GENERIC Use the new version of config(8) to prepare to build a new GENERIC kernel. cd ${KERNOBJDIR}/GENERIC ; ${TOOLDIR}/bin/nbmake-${MACHINE} dependall Use the new toolchain to build a new GENERIC kernel. d572 1 a572 1 ./build.sh -U distribution d574 1 a574 1 DESTDIR. d576 1 a576 1 # ./build.sh -U installworld=/ d578 8 a585 8 leged mode from DESTDIR to /. (Even though this is run as root, -U is required so that the permissions stored in DESTDIR/METALOG are correctly applied to the files as they're copied to /). ./build.sh -U -R /some/dir/RELEASE release Using unprivileged mode, build a complete release in the speci- fied release directory. d604 1 a604 1 NetBSD January 24, 2003 10 @ 1.21 log @Add "-V var=[value]", for setting arbitrary variables which will also be added to the nbmake-${MACHINE} wrapper. Useful for setting RELEASEDIR, without -R's habit of building a release. @ text @d33 2 a34 2 Note: A couple host toolchain components are not yet available in the tools directory. Also, some tools use non-POSIX, non-ANSI C d413 2 a414 1 into DESTDIR. d427 4 a430 3 release Do a ``make build'', then package the system into a stan- dard release layout as described by release(7). This re- quires that RELEASEDIR be set (see above). d454 32 a485 2 The following are available command line options that may be supplied to build.sh: a494 3 -b Bootstrap ``make'' and create a nbmake-MACHINE script (see be- low). a496 5 -d Build a full distribution. This differs from a default build in that files will also be installed to /dev, /etc, /root and /var. Note this does not build a ``release''; no release sets are placed in ${RELEASEDIR}. -d is implied by -R. a499 5 -i installworlddir Install the contents of DESTDIR to installworlddir after all other operations have completed, using the top level ``installworld'' target. a504 14 -k kernel Build a new kernel. The kernel argument is the name of a con- figuration file suitable for use by config(8). If kernel does not contain any `/' characters, the configuration file is ex- pected to be found in the KERNCONFDIR directory, which is typi- cally sys/arch/MACHINE/conf. The new kernel will be built in a subdirectory of KERNOBJDIR, which is typically sys/arch/MACHINE/compile or an associated object directory. In order to ensure that the kernel is built using up-to-date tools, it is strongly recommended that the tools be rebuilt (using the -t option) in a separate invocation of build.sh pri- or to using the -k option, or that the -t and -k options be used together in a single invocation of build.sh. d524 1 a524 3 -R rel Set the value of RELEASEDIR to rel. Setting this option will cause build.sh to run ``make release'' instead of ``make build''. a533 3 -t Build and install the host tools from src/tools only. This op- tion implies -b. d561 1 a561 1 ./build.sh -t d571 1 a571 1 ./build.sh -t -k GENERIC d573 2 a574 1 and build a new GENERIC kernel. d576 1 a576 1 ./build.sh -U -d d580 8 a587 1 ./build.sh -U -R /some/dir/RELEASE d608 1 a608 1 NetBSD January 4, 2003 10 @ 1.20 log @Document: * build.sh -i idir * top level targets: distribution, buildworld, installworld * top level variables: INSTALLWORLDDIR @ text @d538 5 d600 1 a600 1 NetBSD December 25, 2002 9 @ 1.19 log @Add -E - "expert mode". If this is not specified, builds to DESTDIR=/ are not permitted. By using this flag, you are taking responsibility for any issues that may occur because of this... @ text @d285 2 a286 3 MKOBJDIRS Can be set to ``yes'' or ``no''. Indicates whether object directories will be created automatically (via a ``make obj'' pass) at the start of a build. d288 1 a288 1 Default: ``yes'' d290 3 a292 2 NBUILDJOBS Now obsolete. Use the make(1) option -j, instead (see be- low) d294 1 a294 1 Default: Unset. d296 2 a297 4 NOCLEANDIR If set, avoids the ``make cleandir'' phase of a full build. This has the effect of allowing only changed files in a source tree to be recompiled. This can speed up builds when updating only a few files in the tree. d299 1 a299 1 Default: Unset. d301 4 a304 5 NODISTRIBDIRS If set, avoids the ``make distrib-dirs'' phase of a full build. This skips running mtree(8) on DESTDIR, useful on systems where building as an unprivileged user, or where it is known that the system-wide mtree files have not changed. d306 1 a306 1 Default: Unset. d308 5 a312 7 NOINCLUDES If set, avoids the ``make includes'' phase of a full build. This has the effect of preventing make(1) from thinking that some programs are out-of-date simply because the system include files have changed. However, this op- tion should not be used when updating the entire NetBSD source tree arbitrarily; it is suggested to use UPDATE in that case. d314 1 a314 1 Default: Unset. d316 7 a322 2 RELEASEDIR If set, specifies the directory to which a release(7) lay- out will be written at the end of a ``make release''. d324 1 a324 1 Default: Unset. d326 7 a332 2 UPDATE If set, then in addition to the effects described for UP- DATE above, this implies the effects of NOCLEANDIR. d408 21 a428 7 build Build the entire NetBSD system. This orders portions of the source tree such that prerequisites will be built in the prop- er order. release Do a ``make build'', then package the system into a standard release layout as described by release(7). This requires that RELEASEDIR be set (see above). d431 3 a433 3 Can only be run after building the regression tests in the di- rectory ``regress''. Runs the compiled regression tests on the local host. d476 5 d595 1 a595 1 NetBSD December 8, 2002 9 @ 1.18 log @- be consistent about option ordering in build.sh usage display - use Fl and Ar instead of Sy and Em to format options @ text @d454 3 @ 1.17 log @Update location of BUILDING.mdoc. @ text @d447 2 d473 2 d485 5 d492 4 d500 4 d507 2 a516 19 -D dest Set the value of DESTDIR to dest. -M obj Set MAKEOBJDIRPREFIX to obj. -O obj Create an appropriate transform macro for MAKEOBJDIR that will place the built object files under obj. For instance, a set- ting of /usr/obj will place build-time files under /usr/obj/bin, /usr/obj/lib, and so forth. -R rel Set the value of RELEASEDIR to rel. Setting this option will cause build.sh to run ``make release'' instead of ``make build''. -T tools Set the value of TOOLDIR to tools. If set, the bootstrap ``make'' will only be rebuilt as needed (when the source files for make(1) change). -U Set the UNPRIVED variable. d568 1 a568 1 NetBSD October 21, 2002 9 @ 1.16 log @regen for build.sh -k @ text @d41 2 a42 1 BUILDING.mdoc This document (in -mdoc troff format; the original copy). @ 1.15 log @regen for: USE_NEW_TOOLCHAIN was replaced with TOOLCHAIN_MISSING @ text @d456 14 d527 23 d567 1 a567 1 NetBSD September 21, 2002 8 @ 1.14 log @Expand on the difference between ``build.sh -d'' and ``make install'', as requested by Brian Stark in PR toolchain/18228 (which this closes). @ text @d16 1 a16 1 as indicated by the default setting of USE_NEW_TOOLCHAIN in . d514 5 a518 1 NBUILDJOBS Now obsolete. Use the make(1) option -j, instead. d524 2 a525 2 The USE_NEW_TOOLCHAIN based build scheme was introduced in the ``NetBSD- current'' development sources between NetBSD 1.5 and NetBSD 1.6. d528 1 a528 1 A few platforms are not yet using the USE_NEW_TOOLCHAIN system. d530 1 a530 1 NetBSD May 3, 2002 8 @ 1.13 log @Remove duplicate 'files'. From Ryo HAYASAKA in toolchain/17674. @ text @d385 3 d446 4 a449 4 -d Build a full distribution. This differs from a normal build in that etc files will also be installed. Note this does not build a ``release''; no release sets are placed in ${RE- LEASEDIR}. @ 1.12 log @add "-M makeobjdirprefix" to build.sh @ text @d486 1 a486 1 ting of /usr/obj will place build-time files files under @ 1.12.2.1 log @Regen. @ text @a509 27 EXAMPLES 1. % ./build.sh -U Using unprivileged mode, build a complete distribution to a DESTDIR directory that build.sh selects (and will display). 2. # ./build.sh -U -d -D / As root, install to / a complete distribution. Even though this is run as root, -U is required so that the permissions stored in DESTDIR/METALOG are correctly applied to the files as they're copied to /. 3. % ./build.sh -U -u -R Using unprivileged mode, build a complete release to a DESTDIR di- rectory that build.sh selects (and will display), and to a user specified RELEASEDIR. MKUPDATE=yes (-u) is set to prevent the ``make cleandir'', so that if this is run after example 1, it doesn't need to redo that portion of the release build. 4. % ./build.sh -t Perform a build that builds and installs the cross tools only. These are installed into a TOOLDIR directory that build.sh selects (and will display). d523 1 a523 1 NetBSD May 3, 2002 9 @ 1.12.2.2 log @Pullup via hand patch (requested by zuntum in ticket #1582) Change -v to -V in the following section: Print make(1)'s idea of the value of var. Does not build any targets. To reflect reality. @ text @d349 1 a349 1 -V var Print make(1)'s idea of the value of var. Does not build any d550 1 a550 1 NetBSD Dec 23, 2003 9 @ 1.11 log @Move the METALOG from ${_SRC_TOP_OBJ_} to ${DESTDIR}. There were too many synchronisation problems with using the former; including situations such as a "make clean" performed between two installs to the same DESTDIR would result in a truncated METALOG and the resultant sets would be missing stuff such as include files that don't get reinstalled if they haven't changed, even with !UPDATE. @ text @d482 2 @ 1.10 log @Re-gen. @ text @d243 3 a245 4 file called METALOG in the .OBJDIR of src. The contents of METALOG is used during the generation of the distribution tar files to ensure that the appropriate file ownership is stored. d521 1 a521 1 NetBSD March 5, 2002 8 @ 1.9 log @Add a -B option to set the BUILDID for the build. This also causes the make(1) wrapper script to be named "nbmake-MACHINE-BUILDID". @ text @d291 2 a292 6 NBUILDJOBS If set, specifies the number of parallel make(1) processes that should be run simultaneously. This can speed up builds on SMP machines, or machines with much more CPU power than I/O availability. This should be used instead of the make(1) option -j, in order to ensure proper order- ing of build components. d334 6 d379 2 a380 2 This combined target recurses as an atomic unit, so that the ``make depend'' phase can participate in make -j parallelism. d449 4 a452 3 -j njob Set the value of NBUILDJOBS to njob. This provides similar functionality to the familiar ``make -j'', but preserves the ordering of the top level ``make build''. d509 3 d520 1 a520 1 Many platforms are not yet using the USE_NEW_TOOLCHAIN system. @ 1.8 log @document various supported environment variables, including MAKEOBJDIRPREFIX @ text @d117 5 d432 6 @ 1.7 log @document: - make's UNPRIVED support - build.sh's -U support - the build system currently needs to build onto a file system with long file name and hard link support @ text @d91 21 d505 1 a505 1 NetBSD March 4, 2002 8 @ 1.6 log @Document the -d option to build.sh @ text @d101 3 a103 1 directory, set DESTDIR to an empty string). d214 10 d256 2 a257 2 These variables only affect the top level ``Makefile'' and do not manual- ly building subtrees of the NetBSD source code. d461 2 d484 1 a484 1 NetBSD November 12, 2001 8 @ 1.5 log @Note only as the authority for determining whether the new BUILDING instructions should be used. @ text @d398 5 @ 1.4 log @Turn off host-specific objdirs by default. Set MKHOSTOBJ=yes to enable. @ text @d16 4 a19 4 as indicated by the setting of USE_NEW_TOOLCHAIN in /etc/mk.conf or . Platforms which have not yet been switched to the new toolchain should continue building traditionally, using the notes speci- fied in the file UPDATING. @ 1.3 log @Major overhaul of src/tools and host toolchain. Summary of changes: * Rewrite src/tools Make logic to work like the rest of the tree wrt "dependall" and "install". The old "make build" hack is gone. * Remove the MKTOOLS logic. This was linked to the "make build" hack, and was only needed because TOOLDIR originally had no writable default. * Redo the GNU configure/make logic to make it fit reasonably in a BSD make wrapper. Use new ${.ALLTARGETS} variable to scan for targets in $(srcdir), and mark them with .MADE: to prevent rebuilding. * Only build cross tools in src/tools; remove some messy logic in src/usr.* and src/gnu/usr.* that would do target filename rewriting (improves consistency and readability). * Add the ability to build cross gdb at tool build time by setting MKCROSSGDB (default no) to "yes" in mk.conf. * Add src/tools/groff and set up paths to work with this cross groff. @ text @d130 11 d465 1 a465 1 NetBSD November 12, 2001 7 @ 1.2 log @Remove mention of BUILDLING.html, and follow rename of BUILDING.txt to BUILDING. Noted by Love on tech-toolchain. @ text @a241 17 MKTOOLS Indicates whether the host tools will be built and in- stalled automatically if they are out-of-date. yes Build tools as needed into TOOLDIR, but only if the tools in question are out-of-date. no Do not update the tools in TOOLDIR; halt the build as a safety precaution if tools are out-of-date. always Always rebuild the tools in TOOLDIR from scratch during a build. This is similar to the standard NetBSD source tree build method, but is not typi- cally required for host tools. Default: ``yes'' d454 1 a454 1 NetBSD October 29, 2001 8 @ 1.1 log @By popular demand, one preformatted version of BUILDING, plaintext, no CRs. @ text @d43 1 a43 3 BUILDING.html This document (in formatted HTML). BUILDING.txt This document (in plaintext). @