head 1.149; access; symbols netbsd-10-0-RELEASE:1.135 netbsd-10-0-RC6:1.135 netbsd-10-0-RC5:1.135 netbsd-10-0-RC4:1.135 netbsd-10-0-RC3:1.135 netbsd-10-0-RC2:1.135 netbsd-10-0-RC1:1.135 netbsd-10:1.135.0.2 netbsd-10-base:1.135 netbsd-9-3-RELEASE:1.126 cjep_sun2x-base1:1.133 cjep_sun2x:1.133.0.4 cjep_sun2x-base:1.133 cjep_staticlib_x-base1:1.133 netbsd-9-2-RELEASE:1.126 cjep_staticlib_x:1.133.0.2 cjep_staticlib_x-base:1.133 netbsd-9-1-RELEASE:1.126 phil-wifi-20200421:1.126 phil-wifi-20200411:1.126 is-mlppp:1.126.0.4 is-mlppp-base:1.126 phil-wifi-20200406:1.126 netbsd-8-2-RELEASE:1.120 netbsd-9-0-RELEASE:1.126 netbsd-9-0-RC2:1.126 netbsd-9-0-RC1:1.126 phil-wifi-20191119:1.126 netbsd-9:1.126.0.2 netbsd-9-base:1.126 phil-wifi-20190609:1.126 netbsd-8-1-RELEASE:1.120 netbsd-8-1-RC1:1.120 pgoyette-compat-merge-20190127:1.124.2.1 pgoyette-compat-20190127:1.125 pgoyette-compat-20190118:1.125 pgoyette-compat-1226:1.125 pgoyette-compat-1126:1.125 pgoyette-compat-1020:1.125 pgoyette-compat-0930:1.125 pgoyette-compat-0906:1.125 netbsd-7-2-RELEASE:1.104.2.2 pgoyette-compat-0728:1.124 netbsd-8-0-RELEASE:1.120 phil-wifi:1.124.0.4 phil-wifi-base:1.124 pgoyette-compat-0625:1.124 netbsd-8-0-RC2:1.120 pgoyette-compat-0521:1.124 pgoyette-compat-0502:1.124 pgoyette-compat-0422:1.124 netbsd-8-0-RC1:1.120 pgoyette-compat-0415:1.124 pgoyette-compat-0407:1.124 pgoyette-compat-0330:1.124 pgoyette-compat-0322:1.124 pgoyette-compat-0315:1.124 netbsd-7-1-2-RELEASE:1.104.2.2 pgoyette-compat:1.124.0.2 pgoyette-compat-base:1.124 netbsd-7-1-1-RELEASE:1.104.2.2 matt-nb8-mediatek:1.120.0.4 matt-nb8-mediatek-base:1.120 netbsd-8:1.120.0.2 netbsd-8-base:1.120 prg-localcount2-base3:1.119 prg-localcount2-base2:1.119 prg-localcount2-base1:1.119 prg-localcount2:1.119.0.2 prg-localcount2-base:1.119 pgoyette-localcount-20170426:1.119 bouyer-socketcan-base1:1.118 pgoyette-localcount-20170320:1.116 netbsd-7-1:1.104.2.2.0.6 netbsd-7-1-RELEASE:1.104.2.2 netbsd-7-1-RC2:1.104.2.2 netbsd-7-nhusb-base-20170116:1.104.2.2 bouyer-socketcan:1.115.0.4 bouyer-socketcan-base:1.115 pgoyette-localcount-20170107:1.115 netbsd-7-1-RC1:1.104.2.2 pgoyette-localcount-20161104:1.115 netbsd-7-0-2-RELEASE:1.104.2.2 localcount-20160914:1.115 netbsd-7-nhusb:1.104.2.2.0.4 netbsd-7-nhusb-base:1.104.2.2 pgoyette-localcount-20160806:1.115 pgoyette-localcount-20160726:1.115 pgoyette-localcount:1.115.0.2 pgoyette-localcount-base:1.115 netbsd-7-0-1-RELEASE:1.104.2.2 netbsd-7-0:1.104.2.2.0.2 netbsd-7-0-RELEASE:1.104.2.2 netbsd-7-0-RC3:1.104.2.2 netbsd-7-0-RC2:1.104.2.2 netbsd-7-0-RC1:1.104.2.2 netbsd-5-2-3-RELEASE:1.67.2.3 netbsd-5-1-5-RELEASE:1.67.2.3 netbsd-6-0-6-RELEASE:1.87.2.1 netbsd-6-1-5-RELEASE:1.87.2.1 netbsd-7:1.104.0.2 netbsd-7-base:1.104 yamt-pagecache-base9:1.95 yamt-pagecache-tag8:1.85.2.3 netbsd-6-1-4-RELEASE:1.87.2.1 netbsd-6-0-5-RELEASE:1.87.2.1 tls-earlyentropy:1.95.0.2 tls-earlyentropy-base:1.104 riastradh-xf86-video-intel-2-7-1-pre-2-21-15:1.95 riastradh-drm2-base3:1.95 netbsd-6-1-3-RELEASE:1.87.2.1 netbsd-6-0-4-RELEASE:1.87.2.1 netbsd-5-2-2-RELEASE:1.67.2.3 netbsd-5-1-4-RELEASE:1.67.2.3 netbsd-6-1-2-RELEASE:1.87.2.1 netbsd-6-0-3-RELEASE:1.87.2.1 netbsd-5-2-1-RELEASE:1.67.2.3 netbsd-5-1-3-RELEASE:1.67.2.3 netbsd-6-1-1-RELEASE:1.87.2.1 riastradh-drm2-base2:1.94 riastradh-drm2-base1:1.94 riastradh-drm2:1.94.0.2 riastradh-drm2-base:1.94 netbsd-6-1:1.87.2.1.0.6 netbsd-6-0-2-RELEASE:1.87.2.1 netbsd-6-1-RELEASE:1.87.2.1 khorben-n900:1.93.0.6 netbsd-6-1-RC4:1.87.2.1 netbsd-6-1-RC3:1.87.2.1 agc-symver:1.93.0.4 agc-symver-base:1.93 netbsd-6-1-RC2:1.87.2.1 netbsd-6-1-RC1:1.87.2.1 yamt-pagecache-base8:1.93 netbsd-5-2:1.67.2.3.0.6 netbsd-6-0-1-RELEASE:1.87.2.1 yamt-pagecache-base7:1.93 netbsd-5-2-RELEASE:1.67.2.3 netbsd-5-2-RC1:1.67.2.3 matt-nb6-plus-nbase:1.87.2.1 yamt-pagecache-base6:1.92 netbsd-6-0:1.87.2.1.0.4 netbsd-6-0-RELEASE:1.87.2.1 netbsd-6-0-RC2:1.87.2.1 tls-maxphys:1.89.0.2 tls-maxphys-base:1.104 matt-nb6-plus:1.87.2.1.0.2 matt-nb6-plus-base:1.87.2.1 netbsd-6-0-RC1:1.87.2.1 yamt-pagecache-base5:1.88 yamt-pagecache-base4:1.88 netbsd-6:1.87.0.2 netbsd-6-base:1.87 netbsd-5-1-2-RELEASE:1.67.2.3 netbsd-5-1-1-RELEASE:1.67.2.3 yamt-pagecache-base3:1.85 yamt-pagecache-base2:1.85 yamt-pagecache:1.85.0.2 yamt-pagecache-base:1.85 cherry-xenmp:1.81.0.4 cherry-xenmp-base:1.81 bouyer-quota2-nbase:1.81 bouyer-quota2:1.81.0.2 bouyer-quota2-base:1.81 matt-mips64-premerge-20101231:1.81 matt-nb5-mips64-premerge-20101231:1.67.2.2 matt-nb5-pq3:1.67.2.3.0.4 matt-nb5-pq3-base:1.67.2.3 netbsd-5-1:1.67.2.3.0.2 netbsd-5-1-RELEASE:1.67.2.3 netbsd-5-1-RC4:1.67.2.3 matt-nb5-mips64-k15:1.67.2.2 netbsd-5-1-RC3:1.67.2.3 netbsd-5-1-RC2:1.67.2.3 netbsd-5-1-RC1:1.67.2.3 netbsd-5-0-2-RELEASE:1.67.2.2 matt-nb5-mips64-premerge-20091211:1.67.2.2 matt-premerge-20091211:1.80 matt-nb5-mips64-u2-k2-k4-k7-k8-k9:1.67.2.2 matt-nb4-mips64-k7-u2a-k9b:1.67.2.2 matt-nb5-mips64-u1-k1-k5:1.67.2.2 matt-nb5-mips64:1.67.2.2.0.4 netbsd-5-0-1-RELEASE:1.67.2.2 jym-xensuspend-nbase:1.72 netbsd-5-0:1.67.2.2.0.2 netbsd-5-0-RELEASE:1.67.2.2 netbsd-5-0-RC4:1.67.2.2 netbsd-5-0-RC3:1.67.2.2 netbsd-5-0-RC2:1.67.2.2 jym-xensuspend:1.71.0.2 jym-xensuspend-base:1.72 netbsd-5-0-RC1:1.67.2.2 netbsd-5:1.67.0.2 netbsd-5-base:1.67 matt-mips64-base2:1.67 matt-mips64:1.49.0.6 netbsd-4-0-1-RELEASE:1.46.2.3 wrstuden-revivesa-base-3:1.66 wrstuden-revivesa-base-2:1.65 wrstuden-fixsa-newbase:1.46.2.3 wrstuden-revivesa-base-1:1.59 yamt-pf42-base4:1.59 yamt-pf42-base3:1.59 hpcarm-cleanup-nbase:1.59 yamt-pf42-baseX:1.58 yamt-pf42-base2:1.59 wrstuden-revivesa:1.59.0.4 wrstuden-revivesa-base:1.59 mjf-devfs2:1.59.0.2 mjf-devfs2-base:1.67 yamt-pf42:1.58.0.2 yamt-pf42-base:1.58 keiichi-mipv6:1.54.0.4 keiichi-mipv6-base:1.56 matt-armv6-nbase:1.56 matt-armv6-prevmlocking:1.49.4.1 wrstuden-fixsa-base-1:1.46.2.3 netbsd-4-0:1.46.2.3.0.2 netbsd-4-0-RELEASE:1.46.2.3 cube-autoconf:1.54.0.2 cube-autoconf-base:1.54 netbsd-4-0-RC5:1.46.2.3 netbsd-4-0-RC4:1.46.2.3 netbsd-4-0-RC3:1.46.2.3 netbsd-4-0-RC2:1.46.2.3 netbsd-4-0-RC1:1.46.2.2 matt-armv6:1.49.0.4 matt-armv6-base:1.54 matt-mips64-base:1.49 hpcarm-cleanup:1.49.0.2 hpcarm-cleanup-base:1.54 netbsd-3-1-1-RELEASE:1.38 netbsd-3-0-3-RELEASE:1.38 wrstuden-fixsa:1.46.2.2.0.2 wrstuden-fixsa-base:1.46.2.3 abandoned-netbsd-4-base:1.43 abandoned-netbsd-4:1.43.0.2 netbsd-3-1:1.38.0.6 netbsd-3-1-RELEASE:1.38 netbsd-3-0-2-RELEASE:1.38 netbsd-3-1-RC4:1.38 netbsd-3-1-RC3:1.38 netbsd-3-1-RC2:1.38 netbsd-3-1-RC1:1.38 netbsd-4:1.46.0.2 netbsd-4-base:1.46 netbsd-3-0-1-RELEASE:1.38 netbsd-3-0:1.38.0.4 netbsd-3-0-RELEASE:1.38 netbsd-3-0-RC6:1.38 netbsd-3-0-RC5:1.38 netbsd-3-0-RC4:1.38 netbsd-3-0-RC3:1.38 netbsd-3-0-RC2:1.38 netbsd-3-0-RC1:1.38 netbsd-2-0-3-RELEASE:1.35 netbsd-2-1:1.35.0.6 netbsd-2-1-RELEASE:1.35 netbsd-2-1-RC6:1.35 netbsd-2-1-RC5:1.35 netbsd-2-1-RC4:1.35 netbsd-2-1-RC3:1.35 netbsd-2-1-RC2:1.35 netbsd-2-1-RC1:1.35 netbsd-2-0-2-RELEASE:1.35 netbsd-3:1.38.0.2 netbsd-3-base:1.38 netbsd-2-0-1-RELEASE:1.35 netbsd-2:1.35.0.4 netbsd-2-base:1.35 netbsd-2-0-RELEASE:1.35 netbsd-2-0-RC5:1.35 netbsd-2-0-RC4:1.35 netbsd-2-0-RC3:1.35 netbsd-2-0-RC2:1.35 netbsd-2-0-RC1:1.35 netbsd-2-0:1.35.0.2 netbsd-2-0-base:1.35 fvdl_fs64_base:1.7; locks; strict; comment @# @; 1.149 date 2023.07.22.18.50.04; author lukem; state Exp; branches; next 1.148; commitid M3mEjZectMFywPxE; 1.148 date 2023.07.21.22.07.59; author lukem; state Exp; branches; next 1.147; commitid 74fkWvm4yGNrEIxE; 1.147 date 2023.07.19.15.40.38; author lukem; state Exp; branches; next 1.146; commitid bFCanGmh77BtzqxE; 1.146 date 2023.07.18.16.59.57; author lukem; state Exp; branches; next 1.145; commitid RmfejxFuWRlK2jxE; 1.145 date 2023.07.05.16.41.12; author lukem; state Exp; branches; next 1.144; commitid zEYZ7EVK6ypemDvE; 1.144 date 2023.06.11.20.34.14; author lukem; state Exp; branches; next 1.143; commitid LRxwdixWRpj0qzsE; 1.143 date 2023.06.11.10.49.44; author lukem; state Exp; branches; next 1.142; commitid j0SCtZ2V7kMtbwsE; 1.142 date 2023.06.11.10.43.51; author lukem; state Exp; branches; next 1.141; commitid dLx41wijlXPs9wsE; 1.141 date 2023.06.05.22.36.17; author lukem; state Exp; branches; next 1.140; commitid L6kHjhqh6VnPhOrE; 1.140 date 2023.06.04.20.08.21; author lukem; state Exp; branches; next 1.139; commitid 4nwhtsMbfMx4vFrE; 1.139 date 2023.06.02.20.48.41; author lukem; state Exp; branches; next 1.138; commitid zosSIgiL3u9TMprE; 1.138 date 2023.05.18.14.22.53; author lukem; state Exp; branches; next 1.137; commitid xcdz3ppPTMa38spE; 1.137 date 2023.05.16.21.39.26; author lukem; state Exp; branches; next 1.136; commitid zapp6iX9R0ZEBepE; 1.136 date 2023.05.16.21.21.38; author lukem; state Exp; branches; next 1.135; commitid IWN0NJ9UsEK6vepE; 1.135 date 2022.08.21.07.10.03; author lukem; state Exp; branches; next 1.134; commitid 0Ie3kKNxYR5noIQD; 1.134 date 2022.05.28.21.54.56; author andvar; state Exp; branches; next 1.133; commitid SJHTz5xyL7aO2SFD; 1.133 date 2020.11.10.21.47.49; author kamil; state Exp; branches; next 1.132; commitid cOSRAAXLjROf8ovC; 1.132 date 2020.11.08.14.52.35; author kamil; state Exp; branches; next 1.131; commitid xCWymCS2aKmTP5vC; 1.131 date 2020.10.13.01.59.32; author thorpej; state Exp; branches; next 1.130; commitid LrWhmRlICzwlsGrC; 1.130 date 2020.10.12.21.14.37; author uwe; state Exp; branches; next 1.129; commitid Nq9R9ipX5hoRSErC; 1.129 date 2020.10.12.21.12.34; author uwe; state Exp; branches; next 1.128; commitid IeYKnqdkCqIfSErC; 1.128 date 2020.10.12.21.05.54; author uwe; state Exp; branches; next 1.127; commitid hl8PRf856EetPErC; 1.127 date 2020.06.30.21.22.19; author riastradh; state Exp; branches; next 1.126; commitid yaFTUrBfClxGgieC; 1.126 date 2019.05.08.14.03.57; author leot; state Exp; branches; next 1.125; commitid t4JD65wSpu7bjpmB; 1.125 date 2018.07.29.20.53.29; author sevan; state Exp; branches; next 1.124; commitid T6t9IGaebiASF4MA; 1.124 date 2018.02.16.10.05.01; author leot; state Exp; branches 1.124.2.1 1.124.4.1; next 1.123; commitid Ca8G3sHjn4vck4rA; 1.123 date 2017.12.29.03.04.56; author sevan; state Exp; branches; next 1.122; commitid NANyiYQDmMDqzJkA; 1.122 date 2017.10.21.22.03.01; author sevan; state Exp; branches; next 1.121; commitid jDxbqZBBwbBX3YbA; 1.121 date 2017.10.21.21.16.07; author sevan; state Exp; branches; next 1.120; commitid eS7TnLqBJbHpPXbA; 1.120 date 2017.05.21.15.28.38; author riastradh; state Exp; branches; next 1.119; commitid qFvwLLy2KgFGNgSz; 1.119 date 2017.04.22.07.48.19; author plunky; state Exp; branches; next 1.118; commitid OfupJpfK7PEddvOz; 1.118 date 2017.04.20.09.47.41; author wiz; state Exp; branches; next 1.117; commitid pgKDjuJoGxWfWfOz; 1.117 date 2017.04.20.09.29.10; author ozaki-r; state Exp; branches; next 1.116; commitid I4z1bW76wU8VPfOz; 1.116 date 2017.02.20.20.56.30; author christos; state Exp; branches; next 1.115; commitid Aqs2LC5MB9MgxJGz; 1.115 date 2016.01.29.13.51.13; author wiz; state Exp; branches 1.115.2.1 1.115.4.1; next 1.114; commitid aLChxCKlZbtDEPSy; 1.114 date 2015.07.23.08.03.25; author mrg; state Exp; branches; next 1.113; commitid nfGa2DVpEPUUPnuy; 1.113 date 2015.06.07.05.30.18; author pgoyette; state Exp; branches; next 1.112; commitid sXBNuOyNutGWssoy; 1.112 date 2015.04.08.05.47.43; author wiz; state Exp; branches; next 1.111; commitid YMSDtamzUmcAuKgy; 1.111 date 2015.01.08.23.59.26; author riastradh; state Exp; branches; next 1.110; commitid 5ku4IpAcvdLmqh5y; 1.110 date 2014.11.30.15.53.29; author uebayasi; state Exp; branches; next 1.109; commitid bXy2o4AuUrNyZd0y; 1.109 date 2014.11.16.06.10.31; author uebayasi; state Exp; branches; next 1.108; commitid qyAJDgYqlFTtdnYx; 1.108 date 2014.11.16.05.44.57; author uebayasi; state Exp; branches; next 1.107; commitid DF0Z77LBXxVH4nYx; 1.107 date 2014.11.13.08.25.31; author apb; state Exp; branches; next 1.106; commitid QPE4vhgNGpYL30Yx; 1.106 date 2014.11.06.06.41.23; author uebayasi; state Exp; branches; next 1.105; commitid r0ThpWmPSz4ZH5Xx; 1.105 date 2014.11.05.08.15.04; author snj; state Exp; branches; next 1.104; commitid 2pVLRGVvnT24gYWx; 1.104 date 2014.08.07.21.45.27; author apb; state Exp; branches 1.104.2.1; next 1.103; commitid ftQYDq0swXN8BtLx; 1.103 date 2014.08.07.21.32.11; author apb; state Exp; branches; next 1.102; commitid NQiLBYEZlaYSytLx; 1.102 date 2014.08.03.09.25.02; author apb; state Exp; branches; next 1.101; commitid AowbFwWQqd7pFTKx; 1.101 date 2014.08.03.09.24.08; author apb; state Exp; branches; next 1.100; commitid zpXTMt7NqJdVETKx; 1.100 date 2014.06.14.12.20.17; author apb; state Exp; branches; next 1.99; commitid UNuoorHHv8g8fuEx; 1.99 date 2014.05.21.13.11.25; author wiz; state Exp; branches; next 1.98; commitid EXk4QHw79zDzipBx; 1.98 date 2014.05.19.10.12.19; author martin; state Exp; branches; next 1.97; commitid HH4esFX77EY1n8Bx; 1.97 date 2014.05.19.09.56.17; author martin; state Exp; branches; next 1.96; commitid W9LMJnHOXNUAh8Bx; 1.96 date 2014.05.19.09.49.07; author martin; state Exp; branches; next 1.95; commitid BDNXM9l4ixy8f8Bx; 1.95 date 2013.12.24.20.10.29; author uwe; state Exp; branches 1.95.2.1; next 1.94; commitid cZzMz4vFhaujnqix; 1.94 date 2013.05.29.14.45.55; author wiz; state Exp; branches; next 1.93; commitid a4j5wIPzavdtixRw; 1.93 date 2012.11.08.15.24.40; author dholland; state Exp; branches; next 1.92; 1.92 date 2012.09.19.23.31.36; author abs; state Exp; branches; next 1.91; 1.91 date 2012.09.19.23.08.37; author abs; state Exp; branches; next 1.90; 1.90 date 2012.09.19.23.06.22; author abs; state Exp; branches; next 1.89; 1.89 date 2012.05.25.10.47.25; author wiz; state Exp; branches 1.89.2.1; next 1.88; 1.88 date 2012.02.23.13.34.16; author tsutsui; state Exp; branches; next 1.87; 1.87 date 2012.02.14.21.32.07; author apb; state Exp; branches 1.87.2.1; next 1.86; 1.86 date 2012.02.14.21.19.19; author apb; state Exp; branches; next 1.85; 1.85 date 2011.09.09.18.48.34; author apb; state Exp; branches 1.85.2.1; next 1.84; 1.84 date 2011.09.09.14.23.38; author apb; state Exp; branches; next 1.83; 1.83 date 2011.09.09.14.01.28; author apb; state Exp; branches; next 1.82; 1.82 date 2011.09.09.13.29.23; author apb; state Exp; branches; next 1.81; 1.81 date 2010.07.25.07.19.00; author mrg; state Exp; branches; next 1.80; 1.80 date 2009.10.10.19.05.29; author apb; state Exp; branches; next 1.79; 1.79 date 2009.10.02.07.43.01; author cegger; state Exp; branches; next 1.78; 1.78 date 2009.10.02.07.17.16; author cegger; state Exp; branches; next 1.77; 1.77 date 2009.09.27.18.08.24; author apb; state Exp; branches; next 1.76; 1.76 date 2009.09.27.17.28.38; author apb; state Exp; branches; next 1.75; 1.75 date 2009.09.27.16.44.40; author apb; state Exp; branches; next 1.74; 1.74 date 2009.07.12.14.16.36; author hubertf; state Exp; branches; next 1.73; 1.73 date 2009.07.12.12.14.51; author hubertf; state Exp; branches; next 1.72; 1.72 date 2009.05.01.19.42.18; author snj; state Exp; branches; next 1.71; 1.71 date 2008.12.02.22.28.21; author mrg; state Exp; branches 1.71.2.1; next 1.70; 1.70 date 2008.11.15.11.27.49; author mrg; state Exp; branches; next 1.69; 1.69 date 2008.11.13.20.40.11; author apb; state Exp; branches; next 1.68; 1.68 date 2008.11.09.23.02.29; author mrg; state Exp; branches; next 1.67; 1.67 date 2008.09.24.07.36.52; author apb; state Exp; branches 1.67.2.1; next 1.66; 1.66 date 2008.09.10.11.16.41; author joerg; state Exp; branches; next 1.65; 1.65 date 2008.09.06.23.22.46; author lukem; state Exp; branches; next 1.64; 1.64 date 2008.08.28.07.21.49; author lukem; state Exp; branches; next 1.63; 1.63 date 2008.08.18.05.27.05; author lukem; state Exp; branches; next 1.62; 1.62 date 2008.08.11.08.22.40; author apb; state Exp; branches; next 1.61; 1.61 date 2008.08.05.22.40.33; author apb; state Exp; branches; next 1.60; 1.60 date 2008.08.05.19.43.33; author perry; state Exp; branches; next 1.59; 1.59 date 2008.04.30.13.10.49; author martin; state Exp; branches 1.59.2.1 1.59.4.1; next 1.58; 1.58 date 2008.03.29.05.22.42; author dholland; state Exp; branches 1.58.2.1; next 1.57; 1.57 date 2008.03.28.05.23.44; author dholland; state Exp; branches; next 1.56; 1.56 date 2008.03.18.04.24.38; author lukem; state Exp; branches; next 1.55; 1.55 date 2008.03.08.14.48.57; author reed; state Exp; branches; next 1.54; 1.54 date 2007.11.23.16.19.28; author sborrill; state Exp; branches 1.54.4.1; next 1.53; 1.53 date 2007.09.01.09.32.19; author jnemeth; state Exp; branches; next 1.52; 1.52 date 2007.09.01.08.15.27; author jnemeth; state Exp; branches; next 1.51; 1.51 date 2007.08.30.10.29.02; author jnemeth; state Exp; branches; next 1.50; 1.50 date 2007.08.30.00.35.11; author ad; state Exp; branches; next 1.49; 1.49 date 2007.04.13.19.43.38; author apb; state Exp; branches 1.49.4.1; next 1.48; 1.48 date 2007.03.26.17.35.06; author apb; state Exp; branches; next 1.47; 1.47 date 2007.01.27.11.47.36; author apb; state Exp; branches; next 1.46; 1.46 date 2006.10.08.17.54.30; author apb; state Exp; branches 1.46.2.1; next 1.45; 1.45 date 2006.10.04.22.28.24; author apb; state Exp; branches; next 1.44; 1.44 date 2006.09.29.19.57.04; author apb; state Exp; branches; next 1.43; 1.43 date 2006.01.29.14.03.59; author apb; state Exp; branches; next 1.42; 1.42 date 2006.01.28.21.34.08; author apb; state Exp; branches; next 1.41; 1.41 date 2006.01.12.21.22.30; author wiz; state Exp; branches; next 1.40; 1.40 date 2006.01.04.15.35.20; author apb; state Exp; branches; next 1.39; 1.39 date 2005.06.20.13.25.23; author peter; state Exp; branches; next 1.38; 1.38 date 2005.02.15.18.41.18; author reed; state Exp; branches; next 1.37; 1.37 date 2004.10.12.04.07.09; author jmc; state Exp; branches; next 1.36; 1.36 date 2004.06.25.15.04.02; author wiz; state Exp; branches; next 1.35; 1.35 date 2004.03.19.12.34.40; author wiz; state Exp; branches; next 1.34; 1.34 date 2004.02.06.23.22.44; author lukem; state Exp; branches; next 1.33; 1.33 date 2003.12.29.07.10.24; author jmc; state Exp; branches; next 1.32; 1.32 date 2003.12.19.12.06.45; author zuntum; state Exp; branches; next 1.31; 1.31 date 2003.10.26.02.17.46; author lukem; state Exp; branches; next 1.30; 1.30 date 2003.10.25.03.46.09; author lukem; state Exp; branches; next 1.29; 1.29 date 2003.09.29.07.55.17; author lukem; state Exp; branches; next 1.28; 1.28 date 2003.08.08.01.52.24; author lukem; state Exp; branches; next 1.27; 1.27 date 2003.07.29.10.07.16; author lukem; state Exp; branches; next 1.26; 1.26 date 2003.07.18.16.30.48; author lukem; state Exp; branches; next 1.25; 1.25 date 2003.07.18.08.38.45; author lukem; state Exp; branches; next 1.24; 1.24 date 2003.07.18.01.55.08; author lukem; state Exp; branches; next 1.23; 1.23 date 2003.07.03.05.52.48; author lukem; state Exp; branches; next 1.22; 1.22 date 2003.05.25.12.34.28; author lukem; state Exp; branches; next 1.21; 1.21 date 2003.05.18.11.18.02; author lukem; state Exp; branches; next 1.20; 1.20 date 2003.05.17.08.10.39; author lukem; state Exp; branches; next 1.19; 1.19 date 2003.05.10.07.15.52; author lukem; state Exp; branches; next 1.18; 1.18 date 2003.05.10.07.12.39; author lukem; state Exp; branches; next 1.17; 1.17 date 2003.05.08.14.42.06; author lukem; state Exp; branches; next 1.16; 1.16 date 2003.02.08.10.00.34; author lukem; state Exp; branches; next 1.15; 1.15 date 2003.02.02.12.37.42; author lukem; state Exp; branches; next 1.14; 1.14 date 2003.01.30.02.52.40; author lukem; state Exp; branches; next 1.13; 1.13 date 2003.01.29.22.50.10; author lukem; state Exp; branches; next 1.12; 1.12 date 2003.01.26.13.15.17; author lukem; state Exp; branches; next 1.11; 1.11 date 2003.01.26.06.19.14; author lukem; state Exp; branches; next 1.10; 1.10 date 2003.01.26.05.34.32; author lukem; state Exp; branches; next 1.9; 1.9 date 2003.01.23.16.24.08; author lukem; state Exp; branches; next 1.8; 1.8 date 2003.01.04.12.55.33; author lukem; state Exp; branches; next 1.7; 1.7 date 2002.12.25.00.58.01; author lukem; state Exp; branches; next 1.6; 1.6 date 2002.12.18.19.46.48; author wiz; state Exp; branches; next 1.5; 1.5 date 2002.12.08.22.14.02; author lukem; state Exp; branches; next 1.4; 1.4 date 2002.12.08.08.42.52; author lukem; state Exp; branches; next 1.3; 1.3 date 2002.11.25.19.18.45; author wiz; state Exp; branches; next 1.2; 1.2 date 2002.10.20.15.48.02; author lukem; state Exp; branches; next 1.1; 1.1 date 2002.09.21.08.19.29; author lukem; state Exp; branches; next ; 1.124.2.1 date 2018.09.06.06.51.43; author pgoyette; state Exp; branches; next ; commitid HCi1bXD317XIK0RA; 1.124.4.1 date 2019.06.10.21.42.38; author christos; state Exp; branches; next ; commitid jtc8rnCzWiEEHGqB; 1.115.2.1 date 2017.03.20.06.52.12; author pgoyette; state Exp; branches; next 1.115.2.2; commitid jjw7cAwgyKq7RfKz; 1.115.2.2 date 2017.04.26.02.52.18; author pgoyette; state Exp; branches; next ; commitid ojV02aOSdzvBqZOz; 1.115.4.1 date 2017.04.21.16.51.16; author bouyer; state Exp; branches; next ; commitid dUG7nkTKALCadqOz; 1.104.2.1 date 2014.11.14.14.58.28; author martin; state Exp; branches; next 1.104.2.2; commitid Hpu5xAPRIrrzcaYx; 1.104.2.2 date 2015.03.18.08.27.34; author snj; state Exp; branches; next ; commitid TvCHDRcfkfvk34ey; 1.95.2.1 date 2014.08.10.07.03.02; author tls; state Exp; branches; next ; commitid fmmi5hfkHs1OEMLx; 1.89.2.1 date 2012.11.20.02.57.55; author tls; state Exp; branches; next 1.89.2.2; 1.89.2.2 date 2013.06.23.06.26.21; author tls; state Exp; branches; next 1.89.2.3; commitid OnlO1cBgtQRcIHUw; 1.89.2.3 date 2014.08.19.23.45.49; author tls; state Exp; branches; next ; commitid jTnpym9Qu0o4R1Nx; 1.87.2.1 date 2012.03.02.16.48.10; author riz; state Exp; branches; next 1.87.2.2; 1.87.2.2 date 2015.04.14.13.34.30; author msaitoh; state Exp; branches; next ; commitid Nk6ZASArWONQSyhy; 1.85.2.1 date 2012.04.17.00.02.55; author yamt; state Exp; branches; next 1.85.2.2; 1.85.2.2 date 2012.10.30.18.48.57; author yamt; state Exp; branches; next 1.85.2.3; 1.85.2.3 date 2013.01.16.05.26.12; author yamt; state Exp; branches; next 1.85.2.4; 1.85.2.4 date 2014.05.22.11.27.14; author yamt; state Exp; branches; next ; commitid kc78LVNHdxORGwBx; 1.71.2.1 date 2009.05.13.19.18.01; author jym; state Exp; branches; next ; 1.67.2.1 date 2008.11.15.22.05.12; author snj; state Exp; branches; next 1.67.2.2; 1.67.2.2 date 2008.11.15.22.10.33; author snj; state Exp; branches 1.67.2.2.4.1; next 1.67.2.3; 1.67.2.3 date 2009.05.11.19.40.22; author bouyer; state Exp; branches; next ; 1.67.2.2.4.1 date 2011.05.20.08.11.16; author matt; state Exp; branches; next ; 1.59.2.1 date 2008.04.30.13.10.49; author mjf; state dead; branches; next 1.59.2.2; 1.59.2.2 date 2008.10.05.20.11.18; author mjf; state Exp; branches; next ; 1.59.4.1 date 2008.09.18.04.40.18; author wrstuden; state Exp; branches; next 1.59.4.2; 1.59.4.2 date 2008.09.24.16.32.55; author wrstuden; state Exp; branches; next ; 1.58.2.1 date 2008.05.18.12.29.42; author yamt; state Exp; branches; next ; 1.54.4.1 date 2008.03.24.07.14.40; author keiichi; state Exp; branches; next ; 1.49.4.1 date 2007.11.06.23.10.20; author matt; state Exp; branches; next 1.49.4.2; 1.49.4.2 date 2008.01.09.01.29.25; author matt; state Exp; branches; next 1.49.4.3; 1.49.4.3 date 2008.03.23.00.23.07; author matt; state Exp; branches; next ; 1.46.2.1 date 2007.04.16.19.46.55; author bouyer; state Exp; branches; next 1.46.2.2; 1.46.2.2 date 2007.04.16.19.52.26; author bouyer; state Exp; branches 1.46.2.2.2.1; next 1.46.2.3; 1.46.2.3 date 2007.09.29.11.10.56; author xtraeme; state Exp; branches; next ; 1.46.2.2.2.1 date 2007.09.30.20.27.49; author wrstuden; state Exp; branches; next ; desc @@ 1.149 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 @.\" $NetBSD: BUILDING.mdoc,v 1.148 2023/07/21 22:07:59 lukem Exp $ .\" .\" Copyright (c) 2001-2023 The NetBSD Foundation, Inc. .\" All rights reserved. .\" .\" This code is derived from software contributed to The NetBSD Foundation .\" by Todd Vierling and Luke Mewburn. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" .\" NOTE: After changing this file, run "make regen" in the src/doc .\" directory, and check in both src/BUILDING and src/doc/BUILDING.mdoc. .\" .\" Toolchain prefix for commands .ds toolprefix nb . .Dd July 21, 2023 .Dt BUILDING 8 .Os NetBSD .\" turn off hyphenation .hym 999 . .\" if this file is processed with real roff (doc.tmac) .\" now that the tmac files have been lazily read, .\" we can override ``quotes'' with "quotes" for ascii output .ie '\*[Lq]'``' \{\ .ds Lq \*q .ds Rq \*q .\} .\" and disable hyphenation .nr hyphen-flags 0 . .Sh NAME . .Nm BUILDING .Nd Procedure for building .Nx from source code . .Sh REQUIREMENTS . .Nx is designed to be buildable on most POSIX-compliant host systems. The basic build procedure is the same whether compiling .Em natively (on the same .Nx architecture) or .Em cross compiling (on another architecture or OS). .Pp This source tree contains the .Sy build.sh shell script which supports both native and cross builds of .Nx . .Pp This source tree contains a special subtree, .Dq 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 .Xr ( make 1 is not required); all other tools (including .Xr make 1 as .Sy \*[toolprefix]make ) are created as part of the .Nx build process. (See the .Sx Environment variables section below if you need to override or manually select your compilers.) .Pp .Em Note : Within this document, cross-references to manual pages are to the .Nx manual pages, not the host system manual pages. The .Xr mdoc 7 source to the .Nx manual pages can be found within the source tree, and these and can be formatted with .Xr mandoc 1 or .Xr nroff 1 if those are available on the host system. The .Nx manual pages are also available at .Lk https://man.netbsd.org . .Sh FILES . .Ss Source tree layout . .Bl -tag -width "BUILDING.mdoc" . .It Pa BUILDING This document (in plaintext). Generated from .Pa doc/BUILDING.mdoc . . .It Pa Makefile The main Makefile for .Nx ; should only be run for native builds with an appropriately up-to-date version of .Nx .Xr make 1 . Intended for expert use with knowledge of its shortcomings, it has been superseded by the .Sy build.sh shell script as the recommended means for building .Nx . . .It Pa UPDATING Special notes for updating from an earlier revision of .Nx . It is important to read this file before every build of an updated source tree. . .It Pa build.sh Bourne-compatible shell script used for building the host build tools and the .Nx system from scratch. Can be used for both native and cross builds, and should be used instead of .Xr make 1 as it performs additional checks to prevent common issues going undetected, such as building with an outdated version of .Xr make 1 . . .It Pa crypto/dist/ , dist/ , gnu/dist/ Sources imported verbatim from third parties, without mangling the existing build structure. Other source trees in .Pa bin through .Pa usr.sbin use the .Nx .Xr make 1 .Dq reachover Makefile semantics when building these programs for a native host. . .It Pa distrib/ , etc/ Sources for items used when making a full release snapshot, such as files installed in .Sy DESTDIR Ns Pa /etc on the destination system, boot media, and release notes. . .It Pa doc/BUILDING.mdoc The source to this document, in .Xr mdoc 7 format. Used to generate .Pa BUILDING . . .It Pa external/ , sys/external/ Sources and build infrastructure for components imported (mostly) unchanged from upstream maintainers, sorted by applicable license. This is (slowly) replacing the .Pa crypto/dist , .Pa dist , and .Pa gnu/dist directories. . .It Pa external/mit/xorg/ .Dq Reachover build structure for modular Xorg; the source is in .Sy X11SRCDIR . . .It Pa mk.conf Optional source tree specific .Xr mk.conf 5 , used (if present) instead of .Pa /etc/mk.conf unless .Sy MAKECONF is defined. .Pp .Em Note : Not part of the .Nx source repository. . .It Pa regress/ , tests/ Regression test harness. Can be cross-compiled, but only run natively. .Pa tests/ uses the .Xr atf 7 test framework; .Pa regress/ contains older tests that have not yet been migrated to .Xr atf 7 . . .It Pa sys/ .Nx kernel sources. . .It Pa tools/ .Dq Reachover build structure for the host build tools. This has a special method of determining out-of-date status. . .It Pa tools/compat/README Special notes for cross-hosting a NetBSD build on non-NetBSD platforms. . .It Other directories including Pa bin/ ... usr.sbin/ Sources to the .Nx userland (non-kernel) programs. If any of these directories are missing, they will be skipped during the build. . .El . .Ss Build tree layout . The .Nx build tree is described in .Xr hier 7 (whose .Xr mdoc 7 source is in .Pa share/man/man7/hier.7 ) , and the release layout is described in .Xr release 7 (whose .Xr mdoc 7 source is in .Pa share/man/man7/release.7 ) . . .Sh CONFIGURATION . .Ss Environment variables . .de DFLT .Pp .Em Default : .. .de DFLTn .DFLT .Dq no . .. .de DFLTu .DFLT Unset. .. .de DFLTy .DFLT .Dq yes . .. .de NODEF .Pp Forced to .Dq no if .Sy \\$* is defined, usually in the Makefile before any .Xr make 1 .Cm \&.include directives. .. .de NOVAR .Pp Forced to .Dq no if .Sy \\$* . .. .de YorN Can be set to .Dq yes or .Dq no . .. . Several environment variables control the behaviour of .Nx builds. . .Bl -tag -width 14n . .\" These entries are sorted alphabetically. . .It Sy HOST_CC Path name to C compiler used to create the toolchain. .DFLT .Dq cc . . .It Sy HOST_CFLAGS Flags passed to the host C compiler. .DFLT .Dq \&-O . . .It Sy HOST_CPPFLAGS Flags passed to the host C/C++ pre-processor. .DFLTu . .It Sy HOST_CXX Path name to C++ compiler used to create the toolchain. .DFLT Unset, but defaults to .Dq c++ where required. . .It Sy HOST_CXXFLAGS Flags passed to the host C++ compiler. .DFLTu . .It Sy HOST_SH Path name to a shell available on the host system and suitable for use during the build. The .Nx build system requires a modern Bourne-like shell with POSIX-compliant features, and also requires support for the .Dq local keyword to declare local variables in shell functions (which is a widely-implemented but non-standardised feature). .Pp Depending on the host system, a suitable shell may be .Pa /bin/sh , .Pa /usr/xpg4/bin/sh , .Pa /bin/ksh (provided it is a variant of ksh that supports the .Dq local keyword, such as ksh88, but not ksh93), or .Pa /usr/local/bin/bash . .Pp Most parts of the build require .Sy HOST_SH to be an absolute path; however, .Sy build.sh allows it to be a simple command name, which will be converted to an absolute path by searching the .Ev PATH . .DFLT .Dq sh . . .It Sy INSTALLBOOT_UBOOT_PATHS A colon-separated list of search paths used by .Xr installboot 8 to find U-Boot packages. .DFLTu . .It Sy MACHINE Machine type, e.g., .Dq macppc . .DFLTu . .It Sy MACHINE_ARCH Machine architecture, e.g., .Dq powerpc . .DFLTu . .It Sy MAKE Path name to invoke .Xr make 1 as. .DFLT .Dq make . . .It Sy MAKECONF The name of the .Xr make 1 configuration file. See .Sx make variables and .Xr mk.conf 5 . .Pp .Em Note : Only settable in the process environment. .DFLT .Dq Pa /etc/mk.conf , although .Sy build.sh will set the default to the full path to .Pa mk.conf if the latter is present in the same directory as .Sy build.sh . . .It Sy MAKEFLAGS Flags to invoke .Xr make 1 with. .Pp .Em Note : .Sy build.sh ignores the value of .Sy MAKEFLAGS passed in the environment, but allows .Sy MAKEFLAGS to be set via the .Fl V option. .DFLT .Dq \&-X on systems with a small .Dv ARG_MAX (Cygwin, Darwin, FreeBSD); otherwise unset. . .It Sy MAKEOBJDIR Directory to use as the .Sy .OBJDIR for the current directory. The value is subjected to variable expansion by .Xr make 1 . Typical usage is to set this variable to a value involving the use of .Sq ${.CURDIR:S...} or .Sq ${.CURDIR:C...} , to derive the value of .Sy .OBJDIR from the value of .Sy .CURDIR . Used only if .Sy MAKEOBJDIRPREFIX is not defined. .Pp .Em Note : .Sy MAKEOBJDIR can be provided only in the environment or via the .Fl O flag of .Sy build.sh ; it cannot usefully be set inside a Makefile, including in .Xr mk.conf 5 or .Sy MAKECONF . .DFLTu . .It Sy MAKEOBJDIRPREFIX Top level directory of the object directory tree. The value is subjected to variable expansion by .Xr make 1 . .Sy build.sh will create the ${MAKEOBJDIRPREFIX} directory if necessary, but if .Xr make 1 is used without .Sy build.sh , then rules in .Aq bsd.obj.mk 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 .Sy .OBJDIR for the current directory. The current directory may be read only. .Pp .Em Note : .Sy MAKEOBJDIRPREFIX can be provided only in the environment or via the .Fl M flag of .Sy build.sh ; it cannot usefully be set inside a Makefile, including in .Xr mk.conf 5 or .Sy MAKECONF . .DFLTu . .It Ev TMPDIR Top-level directory to store temporary directories used by .Sy build.sh before paths to other directories such as .Sy .OBJDIR can be determined. .Pp .Em Note : Must support execution of binaries. I.e., without .Xr mount 8 Ns 's .Fl o .Cm noexec option. .DFLT .Dq Pa /tmp . . .El . .Ss make variables . Variables that control the behavior of .Nx builds are documented in .Xr mk.conf 5 (whose .Xr mdoc 7 source is in .Pa share/man/man5/mk.conf.5 ) . .Pp Unless otherwise specified, these variables may be set in either the process environment or the .Xr make 1 configuration file .Xr mk.conf 5 specified by .Sy MAKECONF . .Pp .Em Note : Variables set in the environment, either directly or via .Sy build.sh options to set specific values in the .Sy \*[toolprefix]make- Ns Sy MACHINE wrapper script do not override variables set in the .Xr mk.conf 5 file. To allow variables in .Xr mk.conf 5 to be overridden by the environment or .Sy build.sh options, define the variables using the .Dq Li ?= .Xr make 1 variable assignment operator. For example, .Bd -unfilled -offset indent .Li MAKEVERBOSE?=1 .Ed .Pp The supported .Xr mk.conf 5 make variables are: .\" Keep in sync with share/man/man5/mk.conf.5 section NETBSD SYSTEM VARIABLES .Bd -ragged -offset indent .Sy BSDOBJDIR , .Sy BSDSRCDIR , .Sy BUILD , .Sy BUILDID , .Sy BUILDINFO , .Sy BUILDSEED , .Sy CDEXTRA , .Sy CONFIGOPTS , .Sy COPTS , .Sy CPUFLAGS , .Sy DESTDIR , .Sy EXTERNAL_TOOLCHAIN , .Sy INSTALLBOOT_BOARDS , .Sy INSTALLWORLDDIR , .Sy KERNARCHDIR , .Sy KERNCONFDIR , .Sy KERNEL_DIR , .Sy KERNOBJDIR , .Sy KERNSRCDIR , .Sy LOCALTIME , .Sy MAKEVERBOSE , .Sy MKAMDGPUFIRMWARE , .Sy MKARGON2 , .Sy MKARZERO , .Sy MKATF , .Sy MKBINUTILS , .Sy MKBSDGREP , .Sy MKBSDTAR , .Sy MKCATPAGES , .Sy MKCLEANSRC , .Sy MKCLEANVERIFY , .Sy MKCOMPAT , .Sy MKCOMPATMODULES , .Sy MKCOMPATTESTS , .Sy MKCOMPATX11 , .Sy MKCOMPLEX , .Sy MKCROSSGDB , .Sy MKCTF , .Sy MKCVS , .Sy MKCXX , .Sy MKDEBUG , .Sy MKDEBUGKERNEL , .Sy MKDEBUGLIB , .Sy MKDEBUGTOOLS , .Sy MKDEPINCLUDES , .Sy MKDOC , .Sy MKDTB , .Sy MKDTC , .Sy MKDTRACE , .Sy MKDYNAMICROOT , .Sy MKFIRMWARE , .Sy MKGCC , .Sy MKGCCCMDS , .Sy MKGDB , .Sy MKGROFF , .Sy MKGROFFHTMLDOC , .Sy MKHESIOD , .Sy MKHOSTOBJ , .Sy MKHTML , .Sy MKIEEEFP , .Sy MKINET6 , .Sy MKINFO , .Sy MKIPFILTER , .Sy MKISCSI , .Sy MKKERBEROS , .Sy MKKMOD , .Sy MKKYUA , .Sy MKLDAP , .Sy MKLIBCSANITIZER , .Sy MKLIBCXX , .Sy MKLIBSTDCXX , .Sy MKLINKLIB , .Sy MKLINT , .Sy MKLLVM , .Sy MKLLVMRT , .Sy MKLVM , .Sy MKMAKEMANDB , .Sy MKMAN , .Sy MKMANDOC , .Sy MKMANZ , .Sy MKMDNS , .Sy MKNLS , .Sy MKNOUVEAUFIRMWARE , .Sy MKNPF , .Sy MKNSD , .Sy MKOBJ , .Sy MKOBJDIRS , .Sy MKPAM , .Sy MKPCC , .Sy MKPF , .Sy MKPIC , .Sy MKPICINSTALL , .Sy MKPICLIB , .Sy MKPIE , .Sy MKPIGZGZIP , .Sy MKPOSTFIX , .Sy MKPROFILE , .Sy MKRADEONFIRMWARE , .Sy MKRELRO , .Sy MKREPRO , .Sy MKREPRO_TIMESTAMP , .Sy MKRUMP , .Sy MKSANITIZER , .Sy MKSHARE , .Sy MKSKEY , .Sy MKSLJIT , .Sy MKSOFTFLOAT , .Sy MKSTATICLIB , .Sy MKSTATICPIE , .Sy MKSTRIPIDENT , .Sy MKSTRIPSYM , .Sy MKTEGRAFIRMWARE , .Sy MKTPM , .Sy MKUNBOUND , .Sy MKUNPRIVED , .Sy MKUPDATE , .Sy MKX11 , .Sy MKX11FONTS , .Sy MKX11MOTIF , .Sy MKXORG_SERVER , .Sy MKYP , .Sy MKZFS , .Sy NETBSDSRCDIR , .Sy NETBSD_OFFICIAL_RELEASE , .Sy NOCLEANDIR , .Sy NODISTRIBDIRS , .Sy NOINCLUDES , .Sy OBJMACHINE , .Sy RELEASEDIR , .Sy RUMPUSER_THREADS , .Sy RUMP_CURLWP , .Sy RUMP_DEBUG , .Sy RUMP_DIAGNOSTIC , .Sy RUMP_KTRACE , .Sy RUMP_LOCKDEBUG , .Sy RUMP_LOCKS_UP , .Sy RUMP_NBCOMPAT , .Sy RUMP_VIRTIF , .Sy RUMP_VNODE_LOCKDEBUG , .Sy TOOLCHAIN_MISSING , .Sy TOOLDIR , .Sy USETOOLS , .Sy USE_FORT , .Sy USE_HESIOD , .Sy USE_INET6 , .Sy USE_JEMALLOC , .Sy USE_KERBEROS , .Sy USE_LDAP , .Sy USE_LIBCSANITIZER , .Sy USE_PAM , .Sy USE_PIGZGZIP , .Sy USE_SANITIZER , .Sy USE_SKEY , .Sy USE_SSP , .Sy USE_XZ_SETS , .Sy USE_YP , .Sy X11MOTIFPATH , .Sy X11SRCDIR . .Ed .Pp The obsolete .Xr mk.conf 5 make variables are: .\" Keep in sync with share/man/man5/mk.conf.5 section OBSOLETE VARIABLES .Bd -ragged -offset indent .Sy EXTSRCSRCDIR , .Sy MKBFD , .Sy MKCRYPTO , .Sy MKEXTSRC , .Sy MKKDEBUG , .Sy MKKERBEROS4 , .Sy MKLLD , .Sy MKLLDB , .Sy MKMCLINKER , .Sy MKPERFUSE , .Sy MKTOOLSDEBUG , .Sy NBUILDJOBS , .Sy SHAREDSTRINGS , .Sy USE_COMBINE , .Sy USE_NEW_TOOLCHAIN . .Ed . .Sh BUILDING . .Ss make command line options This is not a summary of all the options available to .Xr make 1 ; only the options used most frequently with .Nx builds are listed here. . .Bl -tag -width "var=value" . .It Fl j Ar njob Run up to .Ar njob .Xr make 1 subjobs in parallel. Makefiles should use .WAIT or have explicit dependencies as necessary to enforce build ordering. . .It Fl m Ar dir Specify the default directory for searching for system Makefile segments, mainly the .Aq bsd.*.mk files. When building any full .Nx source tree, this should be set to the .Dq Pa share/mk directory in the source tree. This is set automatically when building from the top level, or when using .Sy build.sh . . .It Fl n Show the commands that would have been executed, but do not actually execute them. This will still cause recursion to take place. . .It Fl V Ar var Show .Xr make 1 Ns 's idea of the value of .Ar var . Does not build any targets. . .It Ar var Ns Sy = Ns Ar value Set the variable .Ar var to .Ar value , overriding any setting specified by the process environment, the .Sy MAKECONF configuration file, or the system Makefile segments. . .El . .Ss make targets . These default targets may be built by running .Xr make 1 in any subtree of the .Nx source code. It is recommended that none of these be used from the top level Makefile; as a specific exception, .Dq make obj and .Dq make cleandir are useful in that context. . .Bl -tag -width "dependall" . .It Sy all Build programs, libraries, and preformatted documentation. . .It Sy clean Remove program and library object code files. . .It Sy cleandir Same as .Sy clean , but also remove preformatted documentation, dependency files generated by .Dq make depend , and any other files known to be created at build time. . .It Sy depend Create dependency files .Pa ( .depend ) containing more detailed information about the dependencies of source code on header files. Allows programs to be recompiled automatically when a dependency changes. . .It Sy dependall Does a .Dq make depend immediately followed by a .Dq make all . This improves cache locality of the build since both passes read the source files in their entirety. . .It Sy distclean Synonym for .Sy cleandir . . .It Sy includes Build and install system header files. Typically needed before any system libraries or programs can be built. . .It Sy install Install programs, libraries, and documentation into .Sy DESTDIR . Few files will be installed to .Sy DESTDIR Ns Pa /dev , .Sy DESTDIR Ns Pa /etc , .Sy DESTDIR Ns Pa /root or .Sy DESTDIR Ns Pa /var in order to prevent user supplied configuration data from being overwritten. .It Sy lint Run .Xr lint 1 against the C source code, where appropriate, and generate system-installed lint libraries. . .It Sy obj Create object directories to be used for built files, instead of building directly in the source tree. . .It Sy tags Create .Xr ctags 1 searchable function lists usable by the .Xr ex 1 and .Xr vi 1 text editors. . .El . .Ss make targets for the top level . Additional .Xr make 1 targets are usable specifically from the top source level to facilitate building the entire .Nx source tree. . .Bl -tag -width "distribution" . .It Sy build Build the entire .Nx system (except the kernel). This orders portions of the source tree such that prerequisites will be built in the proper order. . .It Sy distribution Do a .Dq make build , and then install a full distribution (which does not include a kernel) into .Sy DESTDIR , including files in .Sy DESTDIR Ns Pa /dev , .Sy DESTDIR Ns Pa /etc , .Sy DESTDIR Ns Pa /root and .Sy DESTDIR Ns Pa /var . . .It Sy buildworld As per .Dq make distribution , except that it ensures that .Sy DESTDIR is not the root directory. . .It Sy installworld Install the distribution from .Sy DESTDIR to .Sy INSTALLWORLDDIR , which defaults to the root directory. Ensures that .Sy INSTALLWORLDDIR is not the root directory if cross compiling. .Pp The .Sy INSTALLSETS environment variable may be set to a space-separated list of distribution sets to be installed. By default, all sets except .Dq etc and .Dq xetc are installed, so most files in .Sy INSTALLWORLDDIR Ns Pa /etc will not be installed or modified. .Pp .Em Note : Before performing this operation with .Sy INSTALLWORLDDIR Ns = Ns Pa / , it is highly recommended that you upgrade your kernel and reboot. After performing this operation, it is recommended that you use .Xr etcupdate 8 to update files in .Sy INSTALLWORLDDIR Ns Pa /etc , and .Xr postinstall 8 to check for or fix inconsistencies. .It Sy sets Create distribution sets from .Sy DESTDIR into .Sy RELEASEDIR/RELEASEMACHINEDIR Ns Pa /binary/sets . Should be run after .Dq make distribution , as .Dq make build alone does not install all of the required files. . .It Sy sourcesets Create source sets of the source tree into .Sy RELEASEDIR Ns Pa /source/sets . . .It Sy syspkgs Create syspkgs from .Sy DESTDIR into .Sy RELEASEDIR/RELEASEMACHINEDIR Ns Pa /binary/syspkgs . Should be run after .Dq make distribution , as .Dq make build alone does not install all of the required files. . .It Sy release Do a .Dq make distribution , build kernels, distribution media, and install sets (this as per .Dq make sets ) , and then package the system into a standard release layout as described by .Xr release 7 . This requires that .Sy RELEASEDIR be set (see above). . .It Sy iso-image Create a .Nx installation CD-ROM image in the .Sy RELEASEDIR Ns Pa /images directory. The CD-ROM file system will have a layout as described in .Xr release 7 . .Pp For most machine types, the CD-ROM will be bootable, and will automatically run the .Xr sysinst 8 menu-based installation program, which can be used to install or upgrade a .Nx system. Bootable CD-ROMs also contain tools that may be useful in repairing a damaged .Nx installation. .Pp Before .Dq make iso-image is attempted, RELEASEDIR must be populated by .Dq make release or equivalent. .Pp .Em Note : Other, smaller, CD-ROM images may be created in the .Sy RELEASEDIR/RELEASEMACHINEDIR Ns Pa /installation/cdrom directory by .Dq "make release" . These smaller images usually contain the same tools as the larger images in .Sy RELEASEDIR Ns Pa /images , but do not contain additional content such as the distribution sets. .Pp .Em Note : The mac68k port still uses an older method of creating CD-ROM images. This requires the .Xr mkisofs 1 utility, which is not part of .Nx , but which can be installed from .Pa pkgsrc/sysutils/cdrtools . . .It Sy iso-image-source Create a .Nx installation CD-ROM image in the .Sy RELEASEDIR Ns Pa /images directory. The CD-ROM file system will have a layout as described in .Xr release 7 . It will have top level directories for the machine type and source. .Pp For most machine types, the CD-ROM will be bootable, and will automatically run the .Xr sysinst 8 menu-based installation program, which can be used to install or upgrade a .Nx system. Bootable CD-ROMs also contain tools that may be useful in repairing a damaged .Nx installation. .Pp Before .Dq make iso-image-source is attempted, RELEASEDIR must be populated by .Dq make sourcesets release or equivalent. .Pp .Em Note : Other, smaller, CD-ROM images may be created in the .Sy RELEASEDIR/RELEASEMACHINEDIR Ns Pa /installation/cdrom directory by .Dq make release . These smaller images usually contain the same tools as the larger images in .Sy RELEASEDIR Ns Pa /images , but do not contain additional content such as the distribution sets. .Pp .Em Note : The mac68k port still uses an older method of creating CD-ROM images. This requires the .Xr mkisofs 1 utility, which is not part of .Nx , but which can be installed from .Pa pkgsrc/sysutils/cdrtools . . .It Sy install-image Create a bootable .Nx installation disk image in the .Sy RELEASEDIR Ns Pa /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 .Xr release 7 . .Pp The installation image is bootable, and will automatically run the .Xr sysinst 8 menu-based installation program, which can be used to install or upgrade a .Nx system. The image also contains tools that may be useful in repairing a damaged .Nx installation. .Pp Before .Dq make install-image is attempted, .Sy RELEASEDIR must be populated by .Dq make release or equivalent. The build must have been performed with .Sy MKUNPRIVED=yes because .Dq make install-image relies on information in .Sy DESTDIR Ns Pa /METALOG . . .It Sy live-image Create .Nx live images in the .Sy RELEASEDIR/images directory. The live image contains all necessary files to boot .Nx up to multi-user mode, including all files which should be extracted during installation, .Nx disklabel, bootloaders, etc. .Pp The live image is suitable for use as a disk image in virtual machine environments such as QEMU, and also useful to boot .Nx from a USB flash memory stick on a real machine, without the need for installation. .Pp Before .Dq make live-image is attempted, RELEASEDIR must be populated by .Dq make release or equivalent. The build must have been performed with .Sy MKUNPRIVED=yes because .Dq make install-image relies on information in .Sy DESTDIR Ns Pa /METALOG . . .It Sy regression-tests Can only be run after building the regression tests in the directory .Dq regress . Runs those compiled regression tests on the local host. .Pp .Em Note : Most tests are now managed instead using .Xr atf 7 ; this target should probably run those as well but currently does not. . .El . .Ss The build.sh script . This script file is a shell script designed to build the entire .Nx system on any host with a suitable modern shell and some common utilities. The required shell features are described under the .Sy HOST_SH variable. .Pp 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 .Bd -unfilled -offset indent .Li /path/to/suitable/shell build.sh Op Ar options .Ed .Pp The above command will usually enable .Sy build.sh to automatically set .Sy HOST_SH Ns Cm = Ns Pa /path/to/suitable/shell , but if that fails, then the following set of commands may be used instead: .Bd -unfilled -offset indent .Li HOST_SH= Ns Va /path/to/suitable/shell .Li export HOST_SH .Li ${HOST_SH} build.sh Op Ar options .Ed .Pp If .Sy 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 .Sy HOST_SH is not set explicitly, then .Sy build.sh sets a default using heuristics dependent on the host platform, or from the shell under which .Sy build.sh is executed (if that can be determined), or using the first copy of .Pa sh found in .Ev PATH . .Pp All cross-compile builds, and most native builds, of the entire system should make use of .Sy build.sh rather than just running .Dq make . This way, the .Xr make 1 program will be bootstrapped properly, in case the host system has an older or incompatible .Dq make program. .Pp When compiling the entire system via .Sy build.sh , many .Xr 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 .Sy build.sh are noted where applicable. . .Pp The following operations are supported by .Sy build.sh : . .Bl -tag -width "distribution" . .It Sy build Build the system as per .Dq make build . Before the main part of the build commences, this command runs the .Sy obj operation (unless the .Fl o option is given), .Dq make cleandir (unless the .Fl u option is given), and the .Sy tools operation. . .It Sy distribution Build a full distribution as per .Dq make distribution . This command first runs the .Sy build operation. . .It Sy release Build a full release as per .Dq make release . This command first runs the .Sy distribution operation. . .It Sy help Show a help message, and exit. . .It Sy makewrapper Create the .Sy \*[toolprefix]make- Ns Sy MACHINE wrapper script. This operation is automatically performed for any of the other operations. . .It Sy cleandir Perform .Dq make cleandir . . .It Sy obj Perform .Dq make obj . . .It Sy tools Build and install the host tools from .Pa src/tools . This command will first run .Dq make obj and .Dq make cleandir in the .Pa tools subdirectory unless the .Fl o or .Fl u options (respectively) are given. . .It Sy install Ns = Ns Ar idir Install the contents of .Sy DESTDIR to .Ar idir , using .Dq make installworld . .Pp .Em Note : Files that are part of the .Dq etc or .Dq xetc sets will not be installed, unless overridden by the INSTALLSETS environment variable. . .It Sy kernel Ns = Ns Ar kconf Build a new kernel. The .Ar kconf argument is the name of a configuration file suitable for use by .Xr config 1 . If .Ar kconf does not contain any .Sq / characters, the configuration file is expected to be found in the .Sy KERNCONFDIR directory, which is typically .Pa sys/arch/MACHINE/conf . The new kernel will be built in a subdirectory of .Sy KERNOBJDIR , which is typically .Pa sys/arch/ Ns Sy MACHINE Ns Pa /compile or an associated object directory. .Pp This command does .Em not imply the .Sy tools command; run the .Sy tools command first unless it is .Em certain that the tools already exist and are up to date. .Pp This command will run .Dq make cleandir on the kernel in question first unless the .Fl u option is given. . .It Sy kernel.gdb Ns = Ns Ar kconf Build a new kernel with debug information. Similar to the above .Sy kernel Ns = Ns Ar kconf operation, but creates a .Pa netbsd.gdb file alongside of the kernel .Pa netbsd , which contains a full symbol table and can be used for debugging (for example with a cross-gdb built by .Sy MKCROSSGDB ) . .It Sy kernels This command will build all kernels defined in port specific release build procedure. .Pp This command internally calls the .Sy kernel Ns = Ns Ar kconf operation for each found kernel configuration file. .It Sy modules This command will build kernel modules and install them into .Sy DESTDIR . . .It Sy releasekernel Ns = Ns Ar kconf Install a .Xr gzip 1 Ns ed copy of the kernel previously built by .Sy kernel Ns = Ns Ar kconf into .Sy RELEASEDIR Ns Pa / Ns Sy RELEASEMACHINEDIR Ns Pa /binary/kernel , usually as .Pa netbsd- Ns Ar kconf Ns Pa .gz , although the .Dq Pa netbsd prefix is determined from the .Dq Sy config directives in .Ar kconf . . .It Sy sets Perform .Dq make sets . . .It Sy sourcesets Perform .Dq make sourcesets . . .It Sy syspkgs Perform .Dq make syspkgs . . .It Sy iso-image Perform .Dq make iso-image . . .It Sy iso-image-source Perform .Dq make iso-image-source . . .It Sy install-image Perform .Dq make install-image . . .It Sy live-image Perform .Dq make live-image . . .It Sy list-arch Show a list of valid .Sy MACHINE and .Sy MACHINE_ARCH settings, the default .Sy MACHINE_ARCH for each .Sy MACHINE , and aliases for .Sy MACHINE Ns No / Ns Sy MACHINE_ARCH pairs, and then exits. The .Fl m or .Fl a options (or both) may be used to specify glob patterns that will be used to narrow the list of results; for example, .Dq Li build.sh -m 'evb*' -a '*arm*' list-arch will list all known .Sy MACHINE Ns No / Ns Sy MACHINE_ARCH values in which either .Sy MACHINE or .Sy ALIAS matches the pattern .Ql evb* , and .Sy MACHINE_ARCH matches the pattern .Ql *arm* . . .El . .Pp The following command line options alter the behaviour of the .Sy build.sh operations described above: . .Bl -tag -width "-T tools" . .It Fl a Ar arch Set the value of .Sy MACHINE_ARCH to .Ar arch . See the .Fl m option for more information. . .It Fl B Ar buildid Set the value of .Sy BUILDID to .Ar buildid . This will also append the build identifier to the name of the .Sy \*[toolprefix]make- Ns Sy MACHINE wrapper script so that the resulting name is of the form .Dq Sy \*[toolprefix]make- Ns Sy MACHINE Ns Sy -BUILDID . . .It Fl C Ar cdextras Append .Ar cdextras to the .Sy 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 .Dq iso-image or .Dq 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 .Fl C options, or via a single option whose argument contains multiple space-separated paths. . .It Fl c Ar compiler Select the compiler for the toolchain to build .Nx and for inclusion in the .Nx distribution. Supported choices: .Bl -inset -offset indent .It clang .It gcc [default] .El .Pp The compiler used to build the toolchain can be different; see .Sy HOST_CC and .Sy HOST_CXX . .It Fl D Ar dest Set the value of .Sy DESTDIR to .Ar dest . If a relative path is specified, it will be converted to an absolute path before being used. . .It Fl E Set .Sq expert mode. This overrides various sanity checks, and allows: .Sy DESTDIR does not have to be set to a non-root path for builds, and .Sy MKUNPRIVED=yes does not have to be set when building as a non-root user. .Pp .Em Note : It is highly recommended that you know what you are doing when you use this option. . .It Fl h Show a help message, and exit. . .It Fl j Ar njob Run up to .Ar njob .Xr make 1 subjobs in parallel; passed through to .Xr make 1 . If you see failures for reasons other than running out of memory while using .Sy build.sh with .Fl j , please save complete build logs so the failures can be analyzed. .Pp To achieve the fastest builds, .Fl 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. . .It Fl M Ar obj Set .Sy MAKEOBJDIRPREFIX to .Ar obj . Unsets .Sy MAKEOBJDIR . See .Dq Fl O Ar obj for more information. .Pp For instance, if the source directory is .Pa /usr/src , a setting of .Dq Fl M Pa /usr/obj will place build-time files under .Pa /usr/obj/usr/src/bin , .Pa /usr/obj/usr/src/lib , .Pa /usr/obj/usr/src/usr.bin , and so forth. .Pp If a relative path is specified, it will be converted to an absolute path before being used. .Sy build.sh imposes the restriction that the argument to the .Fl M option must not begin with a .Dq \&$ (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, .Sy build.sh will create it. . .It Fl m Ar mach Set the value of .Sy MACHINE to .Ar mach , unless the .Ar mach argument is an alias that refers to a .Sy MACHINE Ns No / Ns Sy MACHINE_ARCH pair, in which case both .Sy MACHINE and .Sy MACHINE_ARCH are set from the alias. Such aliases are interpreted entirely by .Sy build.sh ; they are not used by any other part of the build system. The .Sy MACHINE_ARCH setting implied by .Ar mach will override any value of .Sy MACHINE_ARCH in the process environment, but will not override a value set by the .Fl a option. All cross builds require .Fl m , but if unset on a NetBSD host, the host's value of MACHINE will be detected and used automatically. .Pp See the .Cm list-arch operation for a way to get a list of valid .Sy MACHINE and .Sy MACHINE_ARCH settings. . .It Fl N Ar noiselevel Set the .Dq noisyness level of the build, by setting .Sy MAKEVERBOSE to .Ar noiselevel . . .It Fl n Show the commands that would be executed by .Sy build.sh , but do not make any changes. This is similar in concept to .Dq make -n . . .It Fl O Ar obj Create an appropriate transform macro for .Sy MAKEOBJDIR that will place the built object files under .Ar obj . Unsets .Sy MAKEOBJDIRPREFIX . .Pp For instance, a setting of .Dq Fl O Pa /usr/obj will place build-time files under .Pa /usr/obj/bin , .Pa /usr/obj/lib , .Pa /usr/obj/usr.bin , and so forth. .Pp If a relative path is specified, it will be converted to an absolute path before being used. .Sy build.sh imposes the restriction that the argument to the .Fl O option must not contain a .Dq \&$ (dollar sign) character. If the directory does not already exist, .Sy build.sh will create it. .Pp In normal use, exactly one of the .Fl M or .Fl O options should be specified. If neither .Fl M nor .Fl O is specified, then a default object directory will be chosen according to rules in .Aq bsd.obj.mk . 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. .Pp .Em Note : Placing the .Ar obj directory location outside of the default source tree hierarchy makes it easier to manually clear out old files in the event the .Dq make cleandir operation is unable to do so. (See .Sx CAVEATS below.) .Pp .Em Note : The use of one of .Fl M or .Fl 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 .Ar obj locations for each). . .It Fl o Set the value of .Sy MKOBJDIRS to .Dq no . Otherwise, it will be automatically set to .Dq yes . This default is opposite to the behaviour when not using .Sy build.sh . . .It Fl P Set the value of .Sy MKREPRO and .Sy MKREPRO_TIMESTAMP to the latest source CVS timestamp for reproducible builds. . .It Fl R Ar rel Set the value of .Sy RELEASEDIR to .Ar rel . If a relative path is specified, it will be converted to an absolute path before being used. . .It Fl r Remove the contents of .Sy DESTDIR and .Sy TOOLDIR before building (provides a clean starting point). This will skip deleting .Sy DESTDIR if building on a native system to the root directory. . .It Fl S Ar seed Change the value of .Sy BUILDSEED to .Ar seed . This should rarely be necessary. . .It Fl T Ar tools Set the value of .Sy TOOLDIR to .Ar tools . If a relative path is specified, it will be converted to an absolute path before being used. If set, the bootstrap .Dq make will only be rebuilt if the source files for .Xr make 1 have changed. . .It Fl U Set .Sy MKUNPRIVED=yes . . .It Fl u Set .Sy MKUPDATE=yes . . .It Xo .Fl V .Sm off .Ar var .Li = .Op Ar value .Sm on .Xc Set the environment variable .Ar var to an optional .Ar value . This is propagated to the .Sy \*[toolprefix]make- Ns Sy MACHINE wrapper script. . .It Fl w Ar wrapper Create the .Sy \*[toolprefix]make- Ns Sy MACHINE wrapper script (see below) in a custom location, specified by .Ar wrapper . This allows, for instance, to place the wrapper script in .Ev PATH automatically. .Pp .Em Note : .Ar 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. . .It Fl X Ar x11src Set the value of .Sy X11SRCDIR to .Ar x11src . If a relative path is specified, it will be converted to an absolute path before being used. . .It Fl x Set .Sy MKX11=yes . . .It Fl Z Ar var Unset ("zap") the environment variable .Ar var . This is propagated to the .Sy \*[toolprefix]make- Ns Sy MACHINE wrapper script. . .It Fl ? Show a help message, and exit. . .El . .Ss The \*[toolprefix]make-MACHINE wrapper script . If using the .Sy build.sh script to build .Nx , a .Sy \*[toolprefix]make-MACHINE wrapper script will be created in .Sy TOOLDIR Ns Pa /bin upon the first build to assist in building subtrees on a cross-compile host. .Pp The .Sy \*[toolprefix]make-MACHINE wrapper script can be invoked in lieu of .Xr make 1 , and will instead call the up-to-date version of .Dq \*[toolprefix]make installed into .Sy TOOLDIR Ns Pa /bin with several key variables pre-set, including .Sy MACHINE , MACHINE_ARCH , and .Sy TOOLDIR . .Sy \*[toolprefix]make-MACHINE will also set variables specified with .Fl V , and unset variables specified with .Fl Z . Note that by default these variables will not override .Xr mk.conf 5 ; see .Sx make variables for more details. .Pp This wrapper script can be symlinked into a directory listed in .Ev PATH , or called with an absolute path. . .Sh EXAMPLES . .Bl -enum . .It .Li "% ./build.sh [OPTIONS] tools kernel=GENERIC" .Pp Build a new toolchain, and use the new toolchain to configure and build a new GENERIC kernel. . .It .Li "% ./build.sh [OPTIONS] -U distribution" .Pp Using unprivileged mode, build a complete distribution to a .Sy DESTDIR directory that .Sy build.sh selects (and will show). . .It .Li "# ./build.sh [OPTIONS] -U install=/" .Pp As root, install to .Pa / the distribution that was built by example 2. Even though this is run as root, .Fl U is required so that the permissions stored in .Sy DESTDIR Ns Pa /METALOG are correctly applied to the files as they're copied to .Pa / . . .It .Li "% ./build.sh [OPTIONS] -U -u release" .Pp Using unprivileged mode, build a complete release to .Sy DESTDIR and .Sy RELEASEDIR directories that .Sy build.sh selects (and will show). .Sy MKUPDATE=yes .Pq Fl u is set to prevent the .Dq make cleandir , so that if this is run after example 2, it doesn't need to redo that portion of the release build. .El . .Sh SEE ALSO .Xr config 1 , .Xr ctags 1 , .Xr ex 1 , .Xr gzip 1 , .Xr lint 1 , .Xr make 1 , .Xr mandoc 1 , .Xr mkisofs 1 , .Xr nroff 1 , .Xr vi 1 , .Xr mk.conf 5 , .Xr atf 7 , .Xr hier 7 , .Xr mdoc 7 , .Xr release 7 , .Xr etcupdate 8 , .Xr installboot 8 , .Xr mount 8 , .Xr postinstall 8 , .Xr sysinst 8 , .Pa pkgsrc/sysutils/cdrtools .Pp .Em Note : The .Nx manual pages are also available at .Lk https://man.netbsd.org . .Sh HISTORY . The .Sy build.sh based build scheme was introduced for .Nx 1.6 as .Sy USE_NEW_TOOLCHAIN , and re-worked to .Sy TOOLCHAIN_MISSING after that. . .Sh CAVEATS . After significant updates to third-party components in the source tree, the .Dq 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 .Pa UPDATING file for notices concerning this. @ 1.148 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 @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.147 2023/07/19 15:40:38 lukem Exp $ d400 1 a400 1 .Sx \*qmake\*q variables d520 1 a520 1 .Ss \*qmake\*q variables d559 187 d749 1 a749 1 .Ss \*qmake\*q command line options d802 1 a802 1 .Ss \*qmake\*q targets d886 1 a886 1 .Ss \*qmake\*q targets for the top level d1170 1 a1170 1 .Ss The \*qbuild.sh\*q script d1848 1 a1848 1 .Ss The \*q\*[toolprefix]make-MACHINE\*q wrapper script d1881 1 a1881 1 .Sx \*qmake\*q variables @ 1.147 log @BUILDING: consistency fix @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.146 2023/07/18 16:59:57 lukem Exp $ d36 1 a36 1 .Dd July 18, 2023 d538 21 d1093 1 a1093 1 wrapper. d1296 1 a1296 1 .Dq make d1618 2 a1619 2 .Sy \*[toolprefix]make wrapper. d1623 1 a1623 1 .Sy \*[toolprefix]make d1627 1 a1627 1 This allows, for instance, to place the wrapper in d1653 2 a1654 2 .Sy \*[toolprefix]make wrapper. d1669 1 a1669 1 script will be created in d1674 1 d1676 1 a1676 1 can be invoked in lieu of d1691 5 d1697 1 a1697 1 This script can be symlinked into a directory listed in @ 1.146 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 @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.145 2023/07/05 16:41:12 lukem Exp $ d183 1 a183 1 .It Pa external , sys/external @ 1.145 log @BUILDING: wording tweaks @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.144 2023/06/11 20:34:14 lukem Exp $ d36 1 a36 1 .Dd July 5, 2023 d71 5 d82 7 a88 2 .Nm ( make is not required); all other tools are created as part of the d136 1 a136 1 .Nm build.sh d161 1 a161 1 .Sy bin d163 1 a163 1 .Sy usr.sbin d198 14 d365 1 a365 1 .Nm build.sh d407 7 a413 1 .Dq Pa /etc/mk.conf . d459 1 a459 1 .Nm build.sh ; d494 1 a494 1 .Nm build.sh ; d513 1 a513 1 .Sy noexec d626 1 a626 1 .Sy ( .depend ) d981 1 a981 1 .Nm build.sh d998 1 a998 1 .Nm build.sh d1001 1 a1001 1 .Nm build.sh d1759 1 a1759 1 .Nm build.sh @ 1.144 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 @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.143 2023/06/11 10:49:44 lukem Exp $ d36 1 a36 1 .Dd June 11, 2023 d225 3 a227 2 .Xr ( mdoc 7 source in d231 3 a233 2 .Xr ( mdoc 7 source in d492 1 a492 1 Variables control the behavior of d496 3 a498 2 .Xr ( mdoc 7 source in @ 1.143 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 @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.142 2023/06/11 10:43:51 lukem Exp $ d85 20 d167 3 a169 1 This document, in -mdoc troff format; the original copy. d224 4 a227 1 .Xr hier 7 , d229 4 a232 1 .Xr release 7 . d244 1 a244 1 .Dq no d252 1 a252 1 .Dq yes d290 2 d295 6 d304 4 d311 1 d342 3 a344 1 .Sy PATH . d350 1 d355 1 d360 1 d366 2 d381 1 a381 1 .Dq /etc/mk.conf d397 6 d432 1 d467 1 d469 1 a469 1 .It Sy TMPDIR d484 1 a484 1 .Dq /tmp . d490 1 a490 1 Several variables control the behavior of d492 6 a497 1 builds. a504 794 .Pp This list is not comprehensive; all supported variables and their defaults are documented in .Xr mk.conf 5 . . .Bl -tag -width 14n . .\" These entries are sorted alphabetically. .\" Keep in sync with canonical reference share/man/man5/mk.conf.5 .\" and with share/mk/bsd.README. . .It Sy BSDOBJDIR The real path to the object directory tree for the .Nx source tree. .DFLT .Dq Pa /usr/obj . .It Sy BSDSRCDIR The real path to the .Nx source tree, if .Sy NETBSDSRCDIR isn't defined. .DFLT .Dq Pa /usr/src . .It Sy 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 .Xr 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 .Dq Li uname \-v . .DFLTu . .It Sy BUILDINFO Optional multi-line string containing information about the build. This will appear in .Sy DESTDIR Ns Pa /etc/release , and it will be stored in the .Va buildinfo variable in any kernels that are built. When such kernels are booted, the .Xr sysctl 7 .Va kern.buildinfo variable will report this value. The string may contain backslash escape sequences, such as .Dq "\e\e" (representing a backslash character) and .Dq "\en" (representing a newline). .DFLTu . .It Sy BUILDSEED .Xr g++ 1 uses random numbers when compiling C++ code. This variable seeds the .Xr g++ 1 random number generator using .Fl frandom-seed with this value. By default, it is set to .Do NetBSD-( Ns Em majorversion ) Dc . 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 .Xr g++ 1 documentation of .Fl frandom-seed . .DFLTu . .It Sy COPTS Extra options for the C compiler. Should be appended to (e.g., .Sy COPTS+=-g ) , rather than explicitly set. .Pp .Em Note : .Sy CPUFLAGS , not .Sy COPTS , should be used for compiler flags that select CPU-related options. .Pp .Em Note : .Sy CFLAGS should never be set in .Xr mk.conf 5 . . .It Sy CPUFLAGS Additional options passed to the compiler/assembler to select CPU instruction set options, CPU tuning options, etc. .Pp .Em Note : Such options should not be specified in .Sy COPTS , because some parts of the build process need to override CPU-related compiler options. .DFLTu . .It Sy DESTDIR Directory to contain the built .Nx system. If set, special options are passed to the compilation tools to prevent their default use of the host system's .Pa /usr/include , /usr/lib , and so forth. This pathname must be an absolute path, and should .Em not end with a slash .Pq / character. (For installation into the system's root directory, set .Sy DESTDIR to an empty string, not to .Dq / ) . The directory must reside on a file system which supports long file names and hard links. .Pp .Em Note : .Sy build.sh will provide a default of .Dq Pa destdir . Ns Sy MACHINE (in the top-level .Sy .OBJDIR ) unless run in .Sq expert mode. .DFLT Empty string if .Sy USETOOLS=yes ; unset otherwise. . .It Sy 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 .Sy TOOLCHAIN_MISSING platform, .Sy EXTERNAL_TOOLCHAIN can be used to re-enable the cross-compile framework. .Pp If .Sy EXTERNAL_TOOLCHAIN is defined, act as .Sy MKGCC=no , since the external version of the compiler may not be able to build the library components of the in-tree compiler. .Pp This variable should be used in conjunction with an appropriate .Sy HAVE_GCC or .Sy HAVE_LLVM setting to control the compiler flags. .Pp .Em 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. .DFLTu . .It Sy INSTALLBOOT_BOARDS A list of .Sy 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 .Bk -words .Fl o Sy board= Ns Ar name .Ek option of .Xr installboot 8 . . .It Sy INSTALLWORLDDIR Location for the top-level .Dq make installworld target to install to. If specified, must be an absolute path. .DFLT .Dq / . .It Sy MAKEVERBOSE Level of verbosity of status messages. Supported values: .Bl -tag -width 2n .It 0 No descriptive messages or commands executed by .Xr make 1 are shown. .It 1 Brief messages are shown describing what is being done, but the actual commands executed by .Xr make 1 are not shown. .It 2 Descriptive messages are shown as above (prefixed with a .Sq # ) , and ordinary commands performed by .Xr make 1 are shown. .It 3 In addition to the above, all commands performed by .Xr make 1 are shown, even if they would ordinarily have been hidden through use of the .Dq \&@@ prefix in the relevant makefile. .It 4 In addition to the above, commands executed by .Xr make 1 are traced through use of the .Xr sh 1 .Dq Fl x flag. .El .DFLT 2 . .It Sy MKCATPAGES .YorN Indicates whether preformatted plaintext manual pages will be created and installed. .NOVAR MKMAN=no No or Sy MKSHARE=no .DFLTn . .It Sy MKCROSSGDB .YorN Create a cross-gdb as a host tool. .DFLTn . .It Sy MKDEBUG .YorN Indicates whether debug information should be generated for all userland binaries. The result is collected as an additional .Sy debug.tgz and .Sy xdebug.tgz set and installed in .Sy DESTDIR Ns Pa /usr/libdata/debug . .NODEF NODEBUG .DFLTn . .It Sy MKDEBUGKERNEL .YorN Indicates whether debugging symbols will be built for kernels by default; pretend as if .Em makeoptions DEBUG="-g" is specified in kernel configuration files. This will also put the debug kernel .Pa netbsd.gdb in the kernel sets. See .Xr options 4 for details. This is useful if a cross-gdb is built as well (see .Sy MKCROSSGDB ) . .DFLTn . .It Sy MKDEBUGLIB .YorN Indicates whether debug libraries .Sy ( lib*_g.a ) will be built and installed. Debug libraries are compiled with .Dq Li -g -DDEBUG . .NODEF NODEBUGLIB .DFLTn . .It Sy MKDEBUGTOOLS .YorN Indicates whether debug information .Sy ( lib*_g.a ) will be included in the build toolchain. .DFLTn . .It Sy MKDOC .YorN Indicates whether system documentation destined for .Sy DESTDIR Ns Pa /usr/share/doc will be installed. .NODEF NODOC .NOVAR MKSHARE=no .DFLTy . .It Sy MKHOSTOBJ .YorN If .Dq 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 .Dq make obj . (This allows multiple host systems to compile .Nx for a single target architecture.) If .Dq 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. .DFLTn . .It Sy MKHTML .YorN Indicates whether the HTML manual pages are created and installed. .NODEF NOHTML .NOVAR MKMAN=no No or Sy MKSHARE=no .DFLTy . .It Sy MKINFO .YorN Indicates whether GNU Info files, used for the documentation for most of the compilation tools, will be built and installed. .NODEF NOINFO .NOVAR MKSHARE=no .DFLTy . .It Sy MKKMOD .YorN Indicates whether kernel modules will be built and installed. .DFLTn on .Sy or1k ; .Dq yes on other platforms. . .It Sy MKLINKLIB .YorN Indicates whether all of the shared library infrastructure will be built and installed. .Pp If .Dq no , prevents: .Bl -dash -compact .It installation of the .Sy *.a libraries .It installation of the .Sy *_pic.a libraries on PIC systems .It building of .Sy *.a libraries on PIC systems .It installation of .Sy .so symlinks on ELF systems .El .Pp I.e, only install the shared library (and the .Pa .so.major symlink on ELF). .NODEF NOLINKLIB .Pp If .Dq no , acts as .Sy MKLINT=no MKPICINSTALL=no MKPROFILE=no . .DFLTy . .It Sy MKLINT .YorN Indicates whether .Xr lint 1 will be run against portions of the .Nx source code during the build, and whether lint libraries will be installed into .Sy DESTDIR Ns Pa /usr/libdata/lint . .NODEF NOLINT .NOVAR MKLINKLIB=no .DFLTn . .It Sy MKMAN .YorN Indicates whether manual pages will be installed. .NODEF NOMAN .NOVAR MKSHARE=no .Pp If .Dq no , acts as .Sy MKCATPAGES=no MKHTML=no . .DFLTy . .It Sy MKNLS .YorN Indicates whether Native Language System (NLS) locale zone files will be built and installed. .NODEF NONLS .NOVAR MKSHARE=no .DFLTy . .It Sy MKOBJ .YorN Indicates whether object directories will be created when running .Dq make obj . If .Dq no , then all built files will be located inside the regular source tree. .NODEF NOOBJ .Pp If .Dq no , acts as .Sy MKOBJDIRS=no . .Pp .Em Note : Setting .Sy MKOBJ to .Dq no is not recommended and may cause problems when updating the tree with .Xr cvs 1 . .DFLTy . .It Sy MKOBJDIRS .YorN Indicates whether object directories will be created automatically (via a .Dq make obj pass) at the start of a build. .NOVAR MKOBJ=no .Pp .Em Note : If using .Sy build.sh , the default is .Dq yes . This may be set back to .Dq no by giving .Sy build.sh the .Fl o option. .DFLTn . .It Sy MKPIC .YorN Indicates whether shared objects and libraries will be created and installed. If .Dq no , the entire built system will be statically linked. .NODEF NOPIC .Pp If .Dq no , acts as .Sy MKPICLIB=no . .DFLTn on .Sy m68000 ; .Dq yes on other platforms. . .It Sy MKPICINSTALL .YorN Indicates whether the .Xr ar 1 format libraries .Sy ( lib*_pic.a ) , used to generate shared libraries, are installed. .NODEF NOPICINSTALL .NOVAR MKLINKLIB=no .DFLTn . .It Sy MKPROFILE .YorN Indicates whether profiled libraries .Sy ( lib*_p.a ) will be built and installed. .NODEF NOPROFILE .NOVAR MKLINKLIB=no .DFLTn on .Sy or1k , .Sy riscv32 , and .Sy riscv64 (due to toolchain problems with profiled code); .Dq yes on other platforms. . .It Sy MKREPRO .YorN Indicates whether builds are to be reproducible. If .Dq yes , two builds from the same source tree will produce the same build results. .Pp Used as the default for .Sy MKARZERO . .Pp .Em Note : This may be set to .Dq yes by giving .Sy build.sh the .Fl P option. .DFLTn . .It Sy MKREPRO_TIMESTAMP Unix timestamp. When .Sy MKREPRO is set, the timestamp of all files in the sets will be set to this value. .Pp .Em Note : This may be set automatically to the latest source tree timestamp using .Xr cvslatest 1 by giving .Sy build.sh the .Fl P option. .DFLTu . .It Sy MKSHARE .YorN Indicates whether files destined to reside in .Sy DESTDIR Ns Pa /usr/share will be built and installed. .NODEF NOSHARE .Pp If .Dq no , acts as .Sy MKCATPAGES=no MKDOC=no MKINFO=no MKHTML=no MKMAN=no MKNLS=no . .DFLTy . .It Sy MKSTRIPIDENT .YorN Indicates whether RCS IDs, for use with .Xr ident 1 , should be stripped from program binaries and shared libraries. .DFLTn . .It Sy MKSTRIPSYM .YorN Indicates whether all local symbols should be stripped from shared libraries. If .Dq yes , strip all local symbols from shared libraries; the effect is equivalent to the .Fl x option of .Xr ld 1 . If .Dq no , strip only temporary local symbols; the effect is equivalent to the .Fl X option of .Xr 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. .DFLTy . .It Sy MKUNPRIVED .YorN 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 .Pa METALOG in .Sy DESTDIR . The .Pa 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 .Sq "make install" . .DFLTn . .It Sy MKUPDATE .YorN Indicates whether all install operations intended to write to .Sy DESTDIR will compare file timestamps before installing, and skip the install phase if the destination files are up-to-date. .Pp For top-level builds this this implies the effects of .Sy NOCLEANDIR (i.e., .Dq make cleandir is avoided). .Pp .Em Note : If using .Sy build.sh , this may be set by giving the .Fl u option. .DFLTn . .It Sy MKX11 .YorN Indicates whether X11 will be built and installed from .Sy X11SRCDIR , and whether the X sets will be created. .Pp .Em Note : If .Dq yes , requires .Sy MKINET6=yes . .DFLTn . .It Sy NETBSDSRCDIR The path to the top level of the .Nx sources. .DFLT Top level of the .Nx source tree (as determined by the presence of .Pa build.sh and .Pa tools/ ) if .Xr make 1 is run from within that tree; otherwise .Sy BSDSRCDIR will be used. . .It Sy NOCLEANDIR If set, avoids the .Dq 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. .Pp See also .Sy MKUPDATE . .DFLTu . .It Sy NODISTRIBDIRS If set, avoids the .Dq make distrib-dirs phase of a full build. This skips running .Xr mtree 8 on .Sy DESTDIR , useful on systems where building as an unprivileged user, or where it is known that the system-wide .Xr mtree 8 files have not changed. .DFLTu . .It Sy NOINCLUDES If set, avoids the .Dq make includes phase of a full build. This has the effect of preventing .Xr 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 .Nx source tree arbitrarily; it is suggested to use .Sy MKUPDATE=yes instead in that case. .DFLTu . .It Sy RELEASEDIR If set, specifies the directory to which a .Xr release 7 layout will be written at the end of a .Dq make release . If specified, must be an absolute path. .Pp .Em Note : .Sy build.sh will provide a default of .Dq Pa releasedir (in the top-level .Sy .OBJDIR ) unless run in .Sq expert mode. .DFLTu . .It Sy TOOLCHAIN_MISSING .YorN If not .Dq no , this indicates that the platform .Dq Sy MACHINE_ARCH being built does not have a working in-tree toolchain. .Pp If not .Dq no , acts as .Sy MKBINUTILS=no MKGCC=no MKGDB=no . .DFLTn . .It Sy 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 .Nx source tree. (However, multiple target architectures may share the same .Sy TOOLDIR ; the target-architecture-dependent files have unique names.) If unset, a default based on the .Xr uname 1 information of the host platform will be created in the .Sy .OBJDIR of .Pa src . .DFLTu . .It Sy USETOOLS .YorN Indicates whether the tools specified by .Sy TOOLDIR should be used as part of a build in progress. Must be set to .Dq yes if cross-compiling. Supported values: .Bl -tag -width "never" .It yes Use the tools from .Sy TOOLDIR . .It no Do not use the tools from .Sy TOOLDIR , but refuse to build native compilation tool components that are version-specific for that tool. .It never Do not use the tools from .Sy TOOLDIR , even when building native tool components. This is similar to the traditional .Nx build method, but does .Em 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 .Nx source tree. .El .DFLTn when using .Aq bsd.*.mk outside the .Nx source tree (detected automatically) or if .Sy TOOLCHAIN_MISSING=yes ; .Dq yes otherwise. . .It Sy X11SRCDIR Directory containing the modular Xorg source. If specified, must be an absolute path. The main modular Xorg source is found in .Sy X11SRCDIR Ns Pa /external/mit . .DFLT .Sy NETBSDSRCDIR Ns Pa /../xsrc , if that exists; otherwise .Pa /usr/xsrc . . .El d973 1 a973 1 .Sy PATH . d1038 1 a1038 1 .Sy \*[toolprefix]make-MACHINE d1100 1 a1100 1 .Pa sys/arch/MACHINE/compile d1147 1 a1147 1 .Sy RELEASEDIR/RELEASEMACHINEDIR Ns Pa /binary/kernel , d1244 1 a1244 1 .Dq Sy \*[toolprefix]make-MACHINE-BUILDID . d1574 1 a1574 1 .Sy PATH d1638 1 a1638 1 .Sy PATH , a1693 22 .Sh OBSOLETE VARIABLES . .Bl -tag -width "NBUILDJOBS" . .It Sy MKKDEBUG Use .Sy MKDEBUGKERNEL . . .It Sy NBUILDJOBS Use the .Nm build.sh and .Xr make 1 option .Fl j instead. . .It Sy USE_NEW_TOOLCHAIN The new toolchain is now the default. To disable, use .Sy TOOLCHAIN_MISSING=yes . .El a1694 1 .Xr ar 1 , a1696 2 .Xr cvs 1 , .Xr cvslatest 1 , a1697 1 .Xr g++ 1 , a1698 2 .Xr ident 1 , .Xr ld 1 , d1701 1 d1703 1 a1703 2 .Xr sh 1 , .Xr uname 1 , a1704 1 .Xr options 4 , d1708 1 a1709 1 .Xr sysctl 7 , a1712 1 .Xr mtree 8 , d1716 6 @ 1.142 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 @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.141 2023/06/05 22:36:17 lukem Exp $ d36 1 a36 1 .Dd June 10, 2023 d522 18 d541 1 a541 1 Additional flags to the compiler/assembler to select d543 6 d574 1 a574 1 .Pa destdir . Ns Sy MACHINE d582 1 a582 3 .Sy USETOOLS is .Dq yes ; d613 21 d740 1 a740 1 If set to d746 4 a749 2 (This allows multiple host systems to compile NetBSD for a single target.) If set to d752 2 a753 1 object directory names as programs built to be run on the target. a758 1 and installed a770 4 .It Sy MKKDEBUG Deprecated, use .Sy MKDEBUGKERNEL . . d773 1 a773 1 Indicates whether kernel modules are built and installed. d784 1 d788 2 d792 2 a793 1 libraries, d796 2 a797 1 libraries on PIC systems, d800 2 a801 2 libraries on PIC systems, or d804 6 a809 1 symlinks on ELF systems. d855 1 a855 1 If set to d881 13 d954 1 a954 1 .\" Note: This paragraph is not in share/man/man5/mk.conf.5. a962 1 .YorN d971 1 a971 1 .\" Note: This paragraph is not in share/man/man5/mk.conf.5. d1008 1 a1008 1 the affect is equivalent to the d1014 1 a1014 1 strip only temporary local symbols; the affect is equivalent d1034 1 a1034 1 The contents of d1036 4 a1039 2 are used during the generation of the distribution tar files to ensure that the appropriate file ownership is stored. d1049 6 a1054 1 .\" Note: This paragraph is not in share/man/man5/mk.conf.5. d1056 5 a1060 1 This also has implications on full builds (see next subsection). d1065 1 a1065 1 Indicates whether X11 is built and installed from d1094 59 d1173 1 a1173 1 (However, multiple targets may share the same d1175 2 a1176 1 the target-dependent files have unique names.) If unset, a default based d1193 1 a1238 127 .Ss \*qmake\*q variables for full builds . These variables only affect the top level .Dq Makefile and do not affect manually building subtrees of the .Nx source code. . .Bl -tag -width 14n . .\" These entries are sorted alphabetically. . .It Sy 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 .Bk -words .Fl o Sy board= Ns Ar name .Ek option of .Xr installboot 8 . . .It Sy INSTALLWORLDDIR Location for the .Dq make installworld target to install to. If specified, must be an absolute path. .DFLT .Dq / . .It Sy MKOBJDIRS .YorN Indicates whether object directories will be created automatically (via a .Dq make obj pass) at the start of a build. .DFLTn .Pp If using .Sy build.sh , the default is .Dq yes . This may be set back to .Dq no by giving .Sy build.sh the .Fl o option. . .It Sy MKUPDATE .YorN If set, then in addition to the effects described for .Sy MKUPDATE=yes above, this implies the effects of .Sy NOCLEANDIR (i.e., .Dq make cleandir is avoided). .DFLTn .Pp If using .Sy build.sh , this may be set by giving the .Fl u option. . .It Sy NOCLEANDIR If set, avoids the .Dq 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. .DFLTu .Pp See also .Sy MKUPDATE . . .It Sy NODISTRIBDIRS If set, avoids the .Dq make distrib-dirs phase of a full build. This skips running .Xr mtree 8 on .Sy DESTDIR , useful on systems where building as an unprivileged user, or where it is known that the system-wide mtree files have not changed. .DFLTu . .It Sy NOINCLUDES If set, avoids the .Dq make includes phase of a full build. This has the effect of preventing .Xr 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 .Nx source tree arbitrarily; it is suggested to use .Sy MKUPDATE=yes instead in that case. .DFLTu . .It Sy RELEASEDIR If set, specifies the directory to which a .Xr release 7 layout will be written at the end of a .Dq make release . If specified, must be an absolute path. .Pp .Em Note : .Sy build.sh will provide a default of .Pa releasedir (in the top-level .Sy .OBJDIR ) unless run in .Sq expert mode. .DFLTu . .El . d2431 4 @ 1.141 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 @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.140 2023/06/04 20:08:21 lukem Exp $ d36 1 a36 1 .Dd June 5, 2023 a1171 10 .It Sy NBUILDJOBS Now obsolete. Use the .Xr make 1 option .Fl j , instead. See below. .DFLTu . d2425 2 @ 1.140 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 @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.139 2023/06/02 20:48:41 lukem Exp $ d36 1 a36 1 .Dd June 4, 2023 d256 3 a258 1 .Bl -tag -width 15n d449 1 a449 1 .Bl -tag -width 15n d452 2 a453 1 .\" Keep in sync with canonical reference share/man/man5/mk.conf.5. d992 8 a999 1 .Sy X11SRCDIR . d1112 3 a1114 1 .Bl -tag -width 15n @ 1.139 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 @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.138 2023/05/18 14:22:53 lukem Exp $ d36 1 a36 1 .Dd May 18, 2023 d39 2 d91 1 a91 2 .It Pa doc/BUILDING.mdoc This document (in -mdoc troff format; the original copy). d94 3 a96 2 .It Pa tools/compat/README Special notes for cross-hosting a NetBSD build on non-NetBSD platforms. d109 1 d115 1 d126 1 d139 12 d160 7 a166 6 .It Pa distrib/ , etc/ Sources for items used when making a full release snapshot, such as files installed in .Sy DESTDIR Ns Pa /etc on the destination system, boot media, and release notes. .It Pa tests/ , regress/ d176 1 d180 1 d185 5 a189 1 .It Pa bin/ ... usr.sbin/ d194 1 a194 4 .It Pa external/mit/xorg/ .Dq Reachover build structure for modular Xorg; the source is in .Sy X11SRCDIR . a209 6 .de YorN Can be set to .Dq yes or .Dq no . .. d214 4 d226 15 a240 2 .de DFLTn .DFLT d242 8 d251 1 d256 10 a265 1 .Bl -tag -width "MAKEOBJDIRPREFIX" d267 2 a300 12 .It Sy HOST_CC Path name to C compiler used to create the toolchain. . .It Sy HOST_CFLAGS Flags passed to the host C compiler. . .It Sy HOST_CXX Path name to C++ compiler used to create the toolchain. . .It Sy HOST_CXXFLAGS Flags passed to the host C++ compiler. . d337 2 a338 1 Note that d442 1 d447 20 a466 1 .Bl -tag -width "MKCATPAGES" d483 1 a483 1 This may be a multi-line string containing information about the build. d502 9 a510 4 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). d513 5 a517 2 Additional information is available in the GCC documentation of -frandom-seed. a542 6 .DFLT Empty string if .Sy USETOOLS is .Dq yes ; unset otherwise. d553 34 d591 1 a591 1 .Bl -tag -width xxx d628 2 a629 1 during a build. d639 2 a640 2 Indicates whether debug information should be generated for all userland binaries compiled. d646 18 a663 1 .Pa /usr/libdata/debug . d668 13 a680 3 Indicates whether debug information (see .Sy MKDEBUG ) should also be generated for all libraries built. d687 3 a689 7 will be installed during a build. .DFLTy . .It Sy MKHTML .YorN Indicates whether preformatted HTML manual pages will be built and installed d707 8 d717 4 a720 3 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. d724 4 d729 1 a729 8 Force generation of full-debug symbol versions of all kernels compiled. Alongside of the .Pa netbsd kernel file, an unstripped version .Pa netbsd.gdb is created. This is useful if a cross-gdb is built as well (see .Sy MKCROSSGDB ) . d731 4 d736 1 a736 1 .It Sy MKKMOD d738 24 a761 1 Indicates whether kernel modules are built and installed. d773 2 d779 8 a786 1 Indicates whether manual pages will be installed during a build. d791 4 a794 2 Indicates whether Native Language System locale zone files will be compiled and installed during a build. d804 6 a809 1 .DFLTy d811 2 a812 1 Note that setting d818 10 d832 2 a833 2 installed during a build. If set to d836 11 a846 6 .DFLT Platform dependent. As of this writing, all platforms except .Sy m68000 default to .Dq yes . d854 4 a857 2 used to generate shared libraries, are installed during a build. .DFLTy d863 12 a874 6 will be built and installed during a build. .DFLT .Dq yes ; however, some platforms turn off .Sy MKPROFILE by default at times due to toolchain problems with profiled code. d878 10 a887 4 Create reproducible builds. This enables different switches to make two builds from the same source tree result in the same build results. .DFLTn d895 2 d904 2 a905 1 .DFLTu d914 1 d920 4 a923 2 will be built and installed during a build. If set to d925 2 a926 7 then all of .Sy MKCATPAGES , MKDOC , MKINFO , MKMAN , and .Sy MKNLS will be set to .Dq no unconditionally. d945 1 a945 1 .Xr ld 1 . d980 3 d988 1 a988 1 Indicates whether X11 is built from d992 32 d1042 1 d1050 1 a1050 1 .It Sy yes d1053 1 a1053 1 .It Sy no d1058 1 a1058 1 .It Sy never d1072 1 a1072 10 .DFLT .Dq yes , unless .Sy TOOLCHAIN_MISSING is set to .Dq yes . .Pp .Sy USETOOLS is also set to .Dq no d1077 4 a1080 1 source tree. d1102 1 a1102 1 .Bl -tag -width "INSTALLWORLDDIR" a1214 1 .DFLTu d1225 1 d1504 2 a1505 1 Note that other, smaller, CD-ROM images may be created in the d1513 2 a1514 1 Note that the mac68k port still uses an older method of creating d1550 2 a1551 1 Note that other, smaller, CD-ROM images may be created in the d1559 2 a1560 1 Note that the mac68k port still uses an older method of creating d1644 3 a1646 1 Note that most tests are now managed instead using d1796 3 a1798 1 Note that files that are part of the d2189 2 a2190 1 Note that placing the d2200 2 a2201 1 Note also that use of one of d2299 2 a2300 1 Note that d2369 1 a2369 1 .Li "% ./build.sh [options] tools kernel=GENERIC" d2375 1 a2375 1 .Li "% ./build.sh [options] -U distribution" d2385 1 a2385 1 .Li "# ./build.sh [options] -U install=/" d2399 1 a2399 1 .Li "% ./build.sh [options] -U -u release" d2434 11 d2446 5 d2452 1 d2455 1 d2459 1 @ 1.138 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 @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.137 2023/05/16 21:39:26 lukem Exp $ d55 1 a55 1 from source code. d102 2 a103 2 Intended for expert use with knowledge of its shortcomings, it has been superseded by the d279 14 d324 2 d331 2 a332 2 it cannot usefully be set inside a Makefile, including .Pa mk.conf d334 1 a334 1 .Sy ${MAKECONF} . d358 2 d365 2 a366 2 it cannot usefully be set inside a Makefile, including .Pa mk.conf d368 1 a368 2 .Sy ${MAKECONF} . . d397 3 a399 1 configuration file specified by d401 3 d484 1 a484 1 .Pa destdir. Ns Sy MACHINE a490 8 .It Sy MAKECONF The name of the .Xr make 1 configuration file. .Em Only settable in the process environment. .DFLT .Dq /etc/mk.conf . d1981 1 a1981 1 Set the value of d2193 1 @ 1.137 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 @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.136 2023/05/16 21:21:38 lukem Exp $ d36 1 a36 1 .Dd May 16, 2023 d189 22 d352 18 a373 22 .de YorN Can be set to .Dq yes or .Dq no . .. .de DFLT .Pp .Em Default : .. .de DFLTu .DFLT Unset. .. .de DFLTy .DFLT .Dq yes .. .de DFLTn .DFLT .Dq no .. d2183 1 @ 1.136 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 @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.135 2022/08/21 07:10:03 lukem Exp $ d36 1 a36 1 .Dd October 13, 2020 d377 1 a377 1 which can be printed by d471 1 a471 1 are not displayed. d477 1 a477 1 are displayed. d481 1 a481 1 are displayed, even if they would ordinarily have been hidden d999 1 a999 1 Display the commands that would have been executed, but do not d1004 1 a1004 1 Print d1010 1 a1010 1 .It Em var=value d1012 1 a1012 1 .Em var d1014 1 a1014 1 .Em value , d1415 1 a1415 1 to exec a suitable shell instead, or prints an error message. d1487 3 d1638 1 a1638 1 Prints a list of valid d1760 1 a1760 1 Print a help message. d1937 1 d1948 7 d2051 3 d2108 1 a2108 1 selects (and will display). d2134 1 a2134 1 selects (and will display). @ 1.135 log @Deprecate extsrc/, EXTSRCSRCDIR, MKEXTSRC Remove support for building extsrc/: 1. Makefile: remove do-extsrc target. 2. build.sh: remove options -y and -Y extsrcdir. 3. distrib/sets: remove support for extsrc in various tools including the options -L ext and -y, and the extsrc sets. 4. doc/BUILDING.mdoc: remove docs for extsrc/, EXTSRCSRCDIR, MKEXTSRC (etc) 5. bsd.own.mk and various Makefiles: remove support for extsrc/, EXTSRCSRCDIR, MKEXTSRC. As proposed on tech-kern and tech-userlevel on 2022-01-07 and followed up on 2022-08-21. @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.134 2022/05/28 21:54:56 andvar Exp $ d3 1 a3 1 .\" Copyright (c) 2001-2022 The NetBSD Foundation, Inc. d79 3 a81 1 (See the environment variables section below if you need d239 5 d587 1 a587 1 .DFLTy d832 1 d841 11 d2150 1 @ 1.134 log @s/knowlege/knowledge/ @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.133 2020/11/10 21:47:49 kamil Exp $ d3 1 a3 1 .\" Copyright (c) 2001-2011 The NetBSD Foundation, Inc. a171 5 .It Pa extsrc/ .Dq Reachover build structure for externally added programs and libraries; the source is in .Sy EXTSRCSRCDIR . a443 9 .It Sy EXTSRCSRCDIR Directory containing sources of externally added programs and libraries. If specified, must be an absolute path. .DFLT .Sy NETBSDSRCDIR Ns Pa /../extsrc , if that exists; otherwise .Pa /usr/extsrc . . a525 6 .It Sy MKEXTSRC .YorN Indicates whether extsrc is built from .Sy EXTSRCSRCDIR . .DFLTn . a2013 12 .It Fl Y Ar extsrcdir Set the value of .Sy EXTSRCSRCDIR to .Ar extsrcdir . If a relative path is specified, it will be converted to an absolute path before being used. . .It Fl y Set .Sy MKEXTSRC=yes . . @ 1.133 log @Reintroduce the support of MKCATPAGES Requested by @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.131 2020/10/13 01:59:32 thorpej Exp $ d100 1 a100 1 Intended for expert use with knowlege of its shortcomings, it has been superseded @ 1.132 log @Remove the support for MKCATPAGES It was optional since 1999 and disabled by default since 2012. Proposed on tech-userlevel@@. @ text @d363 1 a363 1 .Bl -tag -width "MKXXXXXXXX" d503 6 d701 1 a701 1 .Sy MKDOC , MKINFO , MKMAN , @ 1.131 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 @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.130 2020/10/12 21:14:37 uwe Exp $ d363 1 a363 1 .Bl -tag -width "MKCATPAGES" a502 6 .It Sy MKCATPAGES .YorN Indicates whether preformatted plaintext manual pages will be created during a build. .DFLTn . d695 1 a695 1 .Sy MKCATPAGES , MKDOC , MKINFO , MKMAN , @ 1.130 log @Mention HOST_CFLAGS and HOST_CXXFLAGS. @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.129 2020/10/12 21:12:34 uwe Exp $ d408 5 @ 1.129 log @If this file is processed with real roff (doc.tmac) tweak things to make ascii output as close to the mandoc output as possible. There are only two diffs: - groff renders em-dash as -- in the NAME section - mandoc misses "NetBSD" in the "NetBSD System Manager's Manual" section header @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.128 2020/10/12 21:05:54 uwe Exp $ d36 1 a36 1 .Dd July 1, 2020 d233 3 d239 3 @ 1.128 log @Bump date and regen for BUILDING.mdoc revision 1.127 that introduced build.sh -c option. @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.127 2020/06/30 21:22:19 riastradh Exp $ d40 10 @ 1.127 log @New build.sh option: -c Could never remember what the incantation is to do a clang build, so now it's just `build.sh -c clang'. @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.126 2019/05/08 14:03:57 leot Exp $ d36 1 a36 1 .Dd July 29, 2018 @ 1.126 log @Fix a typo Reported by Tobias Ulmer via netbsd-docs@@ ML, thanks! @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.125 2018/07/29 20:53:29 sevan Exp $ d1696 17 @ 1.125 log @Spelling mistake. Reword MKINFO description. @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.124 2018/02/16 10:05:01 leot Exp $ d433 1 a433 1 .Sy NETBSDRCDIR Ns Pa /../extsrc , d817 1 a817 1 .Sy NETBSDRCDIR Ns Pa /../xsrc , @ 1.124 log @Fix a typo. Pointed out by aalm in #NetBSD@@Freenode. @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.123 2017/12/29 03:04:56 sevan Exp $ d36 1 a36 1 .Dd October 21, 2017 d509 1 a509 1 should also be generated for all libraries build. d548 3 a550 3 Indicates whether GNU Info files, used for the documentation for most of the compilation tools, will be created and installed during a build. @ 1.124.4.1 log @Sync with HEAD @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.126 2019/05/08 14:03:57 leot Exp $ d36 1 a36 1 .Dd July 29, 2018 d433 1 a433 1 .Sy NETBSDSRCDIR Ns Pa /../extsrc , d509 1 a509 1 should also be generated for all libraries built. d548 3 a550 3 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. d817 1 a817 1 .Sy NETBSDSRCDIR Ns Pa /../xsrc , @ 1.124.2.1 log @Sync with HEAD Resolve a couple of conflicts (result of the uimin/uimax changes) @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.125 2018/07/29 20:53:29 sevan Exp $ d36 1 a36 1 .Dd July 29, 2018 d509 1 a509 1 should also be generated for all libraries built. d548 3 a550 3 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. @ 1.123 log @While SH3 is no longer an exception, m68000 still is. @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.122 2017/10/21 22:03:01 sevan Exp $ d1633 1 a1633 1 .Dq Li build.sh -m 'evm*' -a '*arm*' list-arch @ 1.122 log @Direct reader to use build.sh for building NetBSD in favour of using make directly. Give an example of why build.sh is better to use. @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.121 2017/10/21 21:16:07 sevan Exp $ d615 6 a620 1 .DFLTy @ 1.121 log @SH3 is no longer an exception for MKPIC, in src/share/mk/bsd.own.mk we set MKPIC to yes by default. Kill trailing whitespace. @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.120 2017/05/21 15:28:38 riastradh Exp $ d90 2 a91 1 (For building from out-of-date systems or on a non-native host, see the d93 2 a94 1 shell script.) d107 3 a109 1 for any source tree that is updated and recompiled regularly. @ 1.120 log @Remove MKCRYPTO option. Originally, MKCRYPTO was introduced because the United States classified cryptography as a munition and restricted its export. The export controls were substantially relaxed fifteen years ago, and are essentially irrelevant for software with published source code. In the intervening time, nobody bothered to remove the option after its motivation -- the US export restriction -- was eliminated. I'm not aware of any other operating system that has a similar option; I expect it is mainly out of apathy for churn that we still have it. Today, cryptography is an essential part of modern computing -- you can't use the internet responsibly without cryptography. The position of the TNF board of directors is that TNF makes no representation that MKCRYPTO=no satisfies any country's cryptography regulations. My personal position is that the availability of cryptography is a basic human right; that any local laws restricting it to a privileged few are fundamentally immoral; and that it is wrong for developers to spend effort crippling cryptography to work around such laws. As proposed on tech-crypto, tech-security, and tech-userlevel to no objections: https://mail-index.netbsd.org/tech-crypto/2017/05/06/msg000719.html https://mail-index.netbsd.org/tech-security/2017/05/06/msg000928.html https://mail-index.netbsd.org/tech-userlevel/2017/05/06/msg010547.html P.S. Reviewing all the uses of MKCRYPTO in src revealed a lot of *bad* crypto that was conditional on it, e.g. DES in telnet... That should probably be removed too, but on the grounds that it is bad, not on the grounds that it is (nominally) crypto. @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.119 2017/04/22 07:48:19 plunky Exp $ d36 1 a36 1 .Dd April 13, 2017 d611 1 a611 6 .DFLT Platform dependent. As of this writing, all platforms except .Sy sh3 default to .Dq yes . d1803 1 a1803 1 .Sy MACHINE @ 1.119 log @state correct location for install-image (RELEASEDIR/images) @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.118 2017/04/20 09:47:41 wiz Exp $ a488 9 .It Sy MKCRYPTO .YorN 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, .Xr crypt 3 . .DFLTy . @ 1.118 log @Use Fl and Xr. New sentence, new line. @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.117 2017/04/20 09:29:10 ozaki-r Exp $ d1291 1 a1291 1 .Sy RELEASEDIR/RELEASEMACHINEDIR Ns Pa /installation/installimage @ 1.117 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 @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.116 2017/02/20 20:56:30 christos Exp $ d706 5 a710 1 the affect is equivalent to -x option of ld(1). If d713 5 a717 1 to -X option of ld(1). Keeping non-temporary local symbols @ 1.116 log @document -P @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.115 2016/01/29 13:51:13 wiz Exp $ d36 1 a36 1 .Dd February 20, 2017 d700 15 @ 1.115 log @Document MKREPRO_TIMESTAMP. @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.114 2015/07/23 08:03:25 mrg Exp $ d36 1 a36 1 .Dd January 29, 2016 d649 1 a649 1 Create reproducable builds. d653 7 d668 8 @ 1.115.4.1 log @Sync with HEAD @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.118 2017/04/20 09:47:41 wiz Exp $ d36 1 a36 1 .Dd April 13, 2017 d649 1 a649 1 Create reproducible builds. a652 7 This may be set to .Dq yes by giving .Sy build.sh the .Fl P option. a660 8 This may be set automatically to the latest source tree timestamp using .Xr cvslatest 1 by giving .Sy build.sh the .Fl P option. a684 23 .It Sy MKSTRIPSYM .YorN Indicates whether all local symbols should be stripped from shared libraries. If .Dq yes , strip all local symbols from shared libraries; the affect is equivalent to the .Fl x option of .Xr ld 1 . If .Dq no , strip only temporary local symbols; the affect is equivalent to the .Fl X option of .Xr 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. .DFLTy . @ 1.115.2.1 log @Sync with HEAD @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.116 2017/02/20 20:56:30 christos Exp $ d36 1 a36 1 .Dd February 20, 2017 d649 1 a649 1 Create reproducible builds. a652 7 This may be set to .Dq yes by giving .Sy build.sh the .Fl P option. a660 8 This may be set automatically to the latest source tree timestamp using .Xr cvslatest 1 by giving .Sy build.sh the .Fl P option. @ 1.115.2.2 log @Sync with HEAD @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.119 2017/04/22 07:48:19 plunky Exp $ d36 1 a36 1 .Dd April 13, 2017 a699 23 .It Sy MKSTRIPSYM .YorN Indicates whether all local symbols should be stripped from shared libraries. If .Dq yes , strip all local symbols from shared libraries; the affect is equivalent to the .Fl x option of .Xr ld 1 . If .Dq no , strip only temporary local symbols; the affect is equivalent to the .Fl X option of .Xr 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. .DFLTy . d1268 1 a1268 1 .Sy RELEASEDIR Ns Pa /images @ 1.114 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 @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.113 2015/06/07 05:30:18 pgoyette Exp $ d36 1 a36 1 .Dd April 7, 2015 d654 8 @ 1.113 log @Update location of live-images to reflect changes made in rev 1.398 of src/etc/Makefile @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.112 2015/04/08 05:47:43 wiz Exp $ d154 1 a154 1 .It Pa x11/ d156 1 a156 1 build structure for X11R6; the source is in d771 1 a771 1 Directory containing the X11R6 source. d773 2 a774 2 The main X11R6 source is found in .Sy X11SRCDIR Ns Pa /xfree/xc . a779 11 .It Sy X11FLAVOUR The style of X11 cross-built, set to either .Dq Xorg or .Dq XFree86 . .DFLT .Dq XFree86 on acorn32, alpha, amiga, mac68k, pmax, and sun3 platforms, .Dq Xorg on everything else. . @ 1.112 log @Update Xorg defaults description. From Joachim Henke on netbsd-docs. @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.111 2015/01/08 23:59:26 riastradh Exp $ d1294 1 a1294 1 .Sy RELEASEDIR/RELEASEMACHINEDIR Ns Pa /installation/liveimage @ 1.111 log @Use `It Sy', not just `It', for live-image, to match other targets. No change to plain-text BUILDING file. @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.110 2014/11/30 15:53:29 uebayasi Exp $ d36 1 a36 1 .Dd August 7, 2014 d786 2 a788 2 on amd64, i386, macppc, shark and sparc64 platforms, .Dq XFree86 @ 1.110 log @Add a new build make variable, CONFIGOPTS, which is passed to config(1) when building kernels. Revert "mkernel=*" and "mkernels" in favor of this option. Diff posted on source-changes-d@@, approved by (null). @ text @d1 1 a1 1 .\" $NetBSD$ d1290 1 a1290 1 .It live-image @ 1.109 log @Document build.sh mkernels. @ text @a1528 6 .It Sy mkernel Ns = Ns Ar kconf Build a new kernel in modular build. Similar to the above .Sy kernel Ns = Ns Ar kconf operation, but creates intermediate per-module relocatable objects and link them to the final kernel. a1535 4 .It Sy mkernels Similar to the above .Sy kernels operation, but builds kernels in modular build. @ 1.108 log @Document mkernel=*. @ text @d1542 4 @ 1.107 log @Document "extsrc". This was added to src/BUILDING in revision 1.90 dated 2009-11-30, but was not added to src/doc/BUILDING.mdoc, so the changes were lost. The original log message was: - - - - revision 1.90 date: 2009-11-30 16:13:22 +0000; author: uebayasi; state: Exp; lines: +22 -0; 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 @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.106 2014/11/06 06:41:23 uebayasi Exp $ d1529 6 @ 1.106 log @Document the "kernels" operation. @ text @d1 1 a1 1 .\" $NetBSD$ d158 5 d424 9 d524 6 d1966 12 @ 1.105 log @sync with reality: iso -> images @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.104 2014/08/07 21:45:27 apb Exp $ d1509 7 @ 1.104 log @Add advice about avoiding common pitfalls. This is taken from the patch in PR 48741, by David H. Gutteridge, but I made small changes to wording and markup. @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.103 2014/08/07 21:32:11 apb Exp $ d1149 1 a1149 1 .Sy RELEASEDIR Ns Pa /iso d1176 1 a1176 1 .Sy RELEASEDIR Ns Pa /iso , d1192 1 a1192 1 .Sy RELEASEDIR Ns Pa /iso d1220 1 a1220 1 .Sy RELEASEDIR Ns Pa /iso , @ 1.104.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 @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.104 2014/08/07 21:45:27 apb Exp $ d1149 1 a1149 1 .Sy RELEASEDIR Ns Pa /images d1176 1 a1176 1 .Sy RELEASEDIR Ns Pa /images , d1192 1 a1192 1 .Sy RELEASEDIR Ns Pa /images d1220 1 a1220 1 .Sy RELEASEDIR Ns Pa /images , @ 1.104.2.2 log @Pull up following revision(s) (requested by riastradh in ticket #611): doc/BUILDING.mdoc: revision 1.111 Use `It Sy', not just `It', for live-image, to match other targets. No change to plain-text BUILDING file. @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.104.2.1 2014/11/14 14:58:28 martin Exp $ d1270 1 a1270 1 .It Sy live-image @ 1.103 log @Document build.sh list-arch @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.102 2014/08/03 09:25:02 apb Exp $ d1820 20 d2071 12 @ 1.102 log @Bump date for previous @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.101 2014/08/03 09:24:08 apb Exp $ d36 1 a36 1 .Dd August 3, 2014 d1557 33 d1604 3 d1726 13 a1738 2 except in some special cases listed below. This will also override any value of d1740 5 a1744 3 in the process environment with a value deduced from .Ar mach , unless d1746 1 a1746 1 is specified. d1752 4 a1755 6 Some machines support multiple values for .Sy MACHINE_ARCH . The following special cases for the .Ar mach argument are defined to set the listed values of .Sy MACHINE d1757 2 a1758 16 .Sy MACHINE_ARCH : .Bl -column "evbmips-el" "MACHINE" "MACHINE_ARCH" -offset indent .It Sy mach Ta Sy "MACHINE" Ta Sy "MACHINE_ARCH" .It evbarm Ta evbarm Ta (not set) .It evbarm-eb Ta evbarm Ta armeb .It evbarm-el Ta evbarm Ta arm .It evbmips Ta evbmips Ta (not set) .It evbmips-eb Ta evbmips Ta mipseb .It evbmips-el Ta evbmips Ta mipsel .It evbsh3 Ta evbsh3 Ta (not set) .It evbsh3-eb Ta evbsh3 Ta sh3eb .It evbsh3-el Ta evbsh3 Ta sh3el .It sbmips Ta sbmips Ta (not set) .It sbmips-eb Ta sbmips Ta mipseb .It sbmips-el Ta sbmips Ta mipsel .El @ 1.101 log @BUILDINFO part 5: Document BUILDINFO in doc/BUILDING.mdoc. @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.100 2014/06/14 12:20:17 apb Exp $ d36 1 a36 1 .Dd June 14, 2014 @ 1.100 log @Improve documentation for BUILDID. @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.99 2014/05/21 13:11:25 wiz Exp $ d354 19 @ 1.99 log @Use Pa for paths. Fix a couple of typos. @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.98 2014/05/19 10:12:19 martin Exp $ d36 1 a36 1 .Dd November 8, 2012 d342 2 d349 4 @ 1.98 log @Document MKCROSSGDB, MKKDEBUG and build.sh kernel.gdb= @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.97 2014/05/19 09:56:17 martin Exp $ d77 1 a77 1 .It Sy doc/BUILDING.mdoc d79 1 a79 1 .It Sy BUILDING d81 1 a81 1 .It Sy tools/compat/README d83 1 a83 1 .It Sy Makefile d93 1 a93 1 .It Sy UPDATING d98 1 a98 1 .It Sy build.sh d106 1 a106 1 .It Sy crypto/dist/ , dist/ , gnu/dist/ d118 1 a118 1 .It Sy external , sys/external d121 7 a127 2 This is (slowly) replacing the crypto/dist, dist/ and gnu/dist directories. .It Sy distrib/ , etc/ d132 1 a132 1 .It Sy tests/ , regress/ d142 1 a142 1 .It Sy sys/ d145 1 a145 1 .It Sy tools/ d149 1 a149 1 .It Sy bin/ ... usr.sbin/ d154 1 a154 1 .It Sy x11/ d364 1 a364 1 .Sy /usr/include , /usr/lib , d473 1 a473 1 Indicates wether debug information (see d521 1 a521 1 This is usfull if a cross-gdb is build as well (see d898 1 a898 1 .Dq share/mk d1450 1 a1450 1 .Sy sys/arch/MACHINE/conf . d1454 1 a1454 1 .Sy sys/arch/MACHINE/compile d1482 1 a1482 1 (for example with a cross-gdb build by d1879 1 a1879 1 .Sy TOOLDIR/bin d1889 1 a1889 1 .Sy TOOLDIR/bin @ 1.97 log @Document MKDEBUG and MKDEBUGLIB @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.96 2014/05/19 09:49:07 martin Exp $ d440 5 d508 12 d1468 11 @ 1.96 log @Document external directories @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.95 2013/12/24 20:10:29 uwe Exp $ d449 19 @ 1.95 log @Add missing Ar @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.94 2013/05/29 14:45:55 wiz Exp $ d118 4 @ 1.95.2.1 log @Rebase. @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.104 2014/08/07 21:45:27 apb Exp $ d36 1 a36 1 .Dd August 7, 2014 d77 1 a77 1 .It Pa doc/BUILDING.mdoc d79 1 a79 1 .It Pa BUILDING d81 1 a81 1 .It Pa tools/compat/README d83 1 a83 1 .It Pa Makefile d93 1 a93 1 .It Pa UPDATING d98 1 a98 1 .It Pa build.sh d106 1 a106 1 .It Pa crypto/dist/ , dist/ , gnu/dist/ d118 1 a118 10 .It Pa external , sys/external Sources and build infrastructure for components imported (mostly) unchanged from upstream maintainers, sorted by applicable license. This is (slowly) replacing the .Pa crypto/dist , .Pa dist , and .Pa gnu/dist directories. .It Pa distrib/ , etc/ d123 1 a123 1 .It Pa tests/ , regress/ d133 1 a133 1 .It Pa sys/ d136 1 a136 1 .It Pa tools/ d140 1 a140 1 .It Pa bin/ ... usr.sbin/ d145 1 a145 1 .It Pa x11/ a332 2 If set, this should be a short string that is suitable for use as part of a file or directory name. a337 23 It will also be used as part of the kernel version string, which can be printed by .Dq Li uname \-v . .DFLTu . .It Sy BUILDINFO This may be a multi-line string containing information about the build. This will appear in .Sy DESTDIR Ns Pa /etc/release , and it will be stored in the .Va buildinfo variable in any kernels that are built. When such kernels are booted, the .Xr sysctl 7 .Va kern.buildinfo variable will report this value. The string may contain backslash escape sequences, such as .Dq "\e\e" (representing a backslash character) and .Dq "\en" (representing a newline). .DFLTu d355 1 a355 1 .Pa /usr/include , /usr/lib , a435 5 .It Sy MKCROSSGDB .YorN Create a cross-gdb as a host tool. .DFLTn . a444 19 .It Sy MKDEBUG .YorN Indicates whether debug information should be generated for all userland binaries compiled. The result is collected as an additional .Sy debug.tgz and .Sy xdebug.tgz set and installed in .Pa /usr/libdata/debug . .DFLTn . .It Sy MKDEBUGLIB .YorN Indicates whether debug information (see .Sy MKDEBUG ) should also be generated for all libraries build. .DFLTn . a479 12 .It Sy MKKDEBUG .YorN Force generation of full-debug symbol versions of all kernels compiled. Alongside of the .Pa netbsd kernel file, an unstripped version .Pa netbsd.gdb is created. This is useful if a cross-gdb is built as well (see .Sy MKCROSSGDB ) . .DFLTn . d853 1 a853 1 .Dq Pa share/mk d1405 1 a1405 1 .Pa sys/arch/MACHINE/conf . d1409 1 a1409 1 .Pa sys/arch/MACHINE/compile a1427 11 .It Sy kernel.gdb Ns = Ns Ar kconf Build a new kernel with debug information. Similar to the above .Sy kernel Ns = Ns Ar kconf operation, but creates a .Pa netbsd.gdb file alongside of the kernel .Pa netbsd , which contains a full symbol table and can be used for debugging (for example with a cross-gdb built by .Sy MKCROSSGDB ) . a1475 33 .It Sy list-arch Prints a list of valid .Sy MACHINE and .Sy MACHINE_ARCH settings, the default .Sy MACHINE_ARCH for each .Sy MACHINE , and aliases for .Sy MACHINE Ns No / Ns Sy MACHINE_ARCH pairs, and then exits. The .Fl m or .Fl a options (or both) may be used to specify glob patterns that will be used to narrow the list of results; for example, .Dq Li build.sh -m 'evm*' -a '*arm*' list-arch will list all known .Sy MACHINE Ns No / Ns Sy MACHINE_ARCH values in which either .Sy MACHINE or .Sy ALIAS matches the pattern .Ql evb* , and .Sy MACHINE_ARCH matches the pattern .Ql *arm* . . a1489 3 See the .Fl m option for more information. d1609 2 a1610 7 unless the .Ar mach argument is an alias that refers to a .Sy MACHINE Ns No / Ns Sy MACHINE_ARCH pair, in which case both .Sy MACHINE and d1612 3 a1614 11 are set from the alias. Such aliases are interpreted entirely by .Sy build.sh ; they are not used by any other part of the build system. The .Sy MACHINE_ARCH setting implied by .Ar mach will override any value of .Sy MACHINE_ARCH in the process environment, but will not override a value set by the d1616 1 a1616 1 option. d1622 6 a1627 4 See the .Cm list-arch operation for a way to get a list of valid .Sy MACHINE d1629 16 a1644 2 .Sy MACHINE_ARCH settings. a1705 20 .Pp Note that placing the .Ar obj directory location outside of the default source tree hierarchy makes it easier to manually clear out old files in the event the .Dq make cleandir operation is unable to do so. (See .Sx CAVEATS below.) .Pp Note also that use of one of .Fl M or .Fl 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 .Ar obj locations for each). d1823 1 a1823 1 .Sy TOOLDIR Ns Pa /bin d1833 1 a1833 1 .Sy TOOLDIR Ns Pa /bin a1936 12 . .Sh CAVEATS . After significant updates to third-party components in the source tree, the .Dq 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 .Pa UPDATING file for notices concerning this. @ 1.94 log @- Bump date (for r1.93); - remove superfluous macros (fixes mandoc(1) warnings). From Bug Hunting. @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.93 2012/11/08 15:24:40 dholland Exp $ d1577 1 a1577 1 .Dq Fl O obj @ 1.93 log @MKCATPAGES defaults to no these days; noted on netbsd-docs by Luc van der Veen. @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.92 2012/09/19 23:31:36 abs Exp $ d36 1 a36 1 .Dd September 19, 2012 a158 1 .Pp d163 1 a163 1 .. @ 1.92 log @Adjust postinstall recommendation syntax. based on comment from Snader_LB on IRC @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.89 2012/05/25 10:47:25 wiz Exp $ d435 1 a435 1 .DFLTy @ 1.91 log @strip trailing whitespace @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.90 2012/09/19 23:06:22 abs Exp $ d1033 2 a1034 2 .Sy INSTALLWORLDDIR Ns Pa /etc and that you use d1036 1 a1036 1 to check for inconsistencies (and possibly to fix them). @ 1.90 log @Fix inverted logic description for MKSTRIPIDENT. Noted by Snader_LB on freenode IRC @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.89 2012/05/25 10:47:25 wiz Exp $ d290 1 a290 1 it cannot usefully be set inside a Makefile, including d747 1 a747 1 (i.e., d760 1 a760 1 Use the d841 1 a841 1 .Xr make 1 d843 1 a843 1 Makefiles should use .WAIT or have explicit dependencies d1195 1 a1195 1 .Sy MKUNPRIVED=yes d1228 1 a1228 1 .Sy MKUNPRIVED=yes d1370 1 a1370 1 in the d1504 1 a1504 1 .Ar cdextras d1552 1 a1552 1 .Xr make 1 d1554 1 a1554 1 passed through to d1561 1 a1561 1 please save complete build logs d1775 1 a1775 1 This is propagated to the d1809 1 a1809 1 This is propagated to the d1907 1 a1907 1 Use the @ 1.89 log @Document MKREPRO using joerg's wording. @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.88 2012/02/23 13:34:16 tsutsui Exp $ d36 1 a36 1 .Dd May 25, 2012 d583 3 a585 3 Indicates whether program binaries and shared libraries should be built to include RCS IDs for use with .Xr ident 1 . @ 1.89.2.1 log @Resync to 2012-11-19 00:00:00 UTC @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.93 2012/11/08 15:24:40 dholland Exp $ d36 1 a36 1 .Dd September 19, 2012 d290 1 a290 1 it cannot usefully be set inside a Makefile, including d435 1 a435 1 .DFLTn d583 3 a585 3 Indicates whether RCS IDs, for use with .Xr ident 1 , should be stripped from program binaries and shared libraries. d747 1 a747 1 (i.e., d760 1 a760 1 Use the d841 1 a841 1 .Xr make 1 d843 1 a843 1 Makefiles should use .WAIT or have explicit dependencies d1033 2 a1034 2 .Sy INSTALLWORLDDIR Ns Pa /etc , and d1036 1 a1036 1 to check for or fix inconsistencies. d1195 1 a1195 1 .Sy MKUNPRIVED=yes d1228 1 a1228 1 .Sy MKUNPRIVED=yes d1370 1 a1370 1 in the d1504 1 a1504 1 .Ar cdextras d1552 1 a1552 1 .Xr make 1 d1554 1 a1554 1 passed through to d1561 1 a1561 1 please save complete build logs d1775 1 a1775 1 This is propagated to the d1809 1 a1809 1 This is propagated to the d1907 1 a1907 1 Use the @ 1.89.2.2 log @resync from head @ text @d1 1 a1 1 .\" $NetBSD$ d36 1 a36 1 .Dd November 8, 2012 d159 1 d164 1 a164 1 . @ 1.89.2.3 log @Rebase to HEAD as of a few days ago. @ text @d36 1 a36 1 .Dd August 7, 2014 d77 1 a77 1 .It Pa doc/BUILDING.mdoc d79 1 a79 1 .It Pa BUILDING d81 1 a81 1 .It Pa tools/compat/README d83 1 a83 1 .It Pa Makefile d93 1 a93 1 .It Pa UPDATING d98 1 a98 1 .It Pa build.sh d106 1 a106 1 .It Pa crypto/dist/ , dist/ , gnu/dist/ d118 1 a118 10 .It Pa external , sys/external Sources and build infrastructure for components imported (mostly) unchanged from upstream maintainers, sorted by applicable license. This is (slowly) replacing the .Pa crypto/dist , .Pa dist , and .Pa gnu/dist directories. .It Pa distrib/ , etc/ d123 1 a123 1 .It Pa tests/ , regress/ d133 1 a133 1 .It Pa sys/ d136 1 a136 1 .It Pa tools/ d140 1 a140 1 .It Pa bin/ ... usr.sbin/ d145 1 a145 1 .It Pa x11/ a332 2 If set, this should be a short string that is suitable for use as part of a file or directory name. a337 23 It will also be used as part of the kernel version string, which can be printed by .Dq Li uname \-v . .DFLTu . .It Sy BUILDINFO This may be a multi-line string containing information about the build. This will appear in .Sy DESTDIR Ns Pa /etc/release , and it will be stored in the .Va buildinfo variable in any kernels that are built. When such kernels are booted, the .Xr sysctl 7 .Va kern.buildinfo variable will report this value. The string may contain backslash escape sequences, such as .Dq "\e\e" (representing a backslash character) and .Dq "\en" (representing a newline). .DFLTu d355 1 a355 1 .Pa /usr/include , /usr/lib , a435 5 .It Sy MKCROSSGDB .YorN Create a cross-gdb as a host tool. .DFLTn . a444 19 .It Sy MKDEBUG .YorN Indicates whether debug information should be generated for all userland binaries compiled. The result is collected as an additional .Sy debug.tgz and .Sy xdebug.tgz set and installed in .Pa /usr/libdata/debug . .DFLTn . .It Sy MKDEBUGLIB .YorN Indicates whether debug information (see .Sy MKDEBUG ) should also be generated for all libraries build. .DFLTn . a479 12 .It Sy MKKDEBUG .YorN Force generation of full-debug symbol versions of all kernels compiled. Alongside of the .Pa netbsd kernel file, an unstripped version .Pa netbsd.gdb is created. This is useful if a cross-gdb is built as well (see .Sy MKCROSSGDB ) . .DFLTn . d853 1 a853 1 .Dq Pa share/mk d1405 1 a1405 1 .Pa sys/arch/MACHINE/conf . d1409 1 a1409 1 .Pa sys/arch/MACHINE/compile a1427 11 .It Sy kernel.gdb Ns = Ns Ar kconf Build a new kernel with debug information. Similar to the above .Sy kernel Ns = Ns Ar kconf operation, but creates a .Pa netbsd.gdb file alongside of the kernel .Pa netbsd , which contains a full symbol table and can be used for debugging (for example with a cross-gdb built by .Sy MKCROSSGDB ) . a1475 33 .It Sy list-arch Prints a list of valid .Sy MACHINE and .Sy MACHINE_ARCH settings, the default .Sy MACHINE_ARCH for each .Sy MACHINE , and aliases for .Sy MACHINE Ns No / Ns Sy MACHINE_ARCH pairs, and then exits. The .Fl m or .Fl a options (or both) may be used to specify glob patterns that will be used to narrow the list of results; for example, .Dq Li build.sh -m 'evm*' -a '*arm*' list-arch will list all known .Sy MACHINE Ns No / Ns Sy MACHINE_ARCH values in which either .Sy MACHINE or .Sy ALIAS matches the pattern .Ql evb* , and .Sy MACHINE_ARCH matches the pattern .Ql *arm* . . a1489 3 See the .Fl m option for more information. d1577 1 a1577 1 .Dq Fl O Ar obj d1609 2 a1610 7 unless the .Ar mach argument is an alias that refers to a .Sy MACHINE Ns No / Ns Sy MACHINE_ARCH pair, in which case both .Sy MACHINE and d1612 3 a1614 11 are set from the alias. Such aliases are interpreted entirely by .Sy build.sh ; they are not used by any other part of the build system. The .Sy MACHINE_ARCH setting implied by .Ar mach will override any value of .Sy MACHINE_ARCH in the process environment, but will not override a value set by the d1616 1 a1616 1 option. d1622 6 a1627 4 See the .Cm list-arch operation for a way to get a list of valid .Sy MACHINE d1629 16 a1644 2 .Sy MACHINE_ARCH settings. a1705 20 .Pp Note that placing the .Ar obj directory location outside of the default source tree hierarchy makes it easier to manually clear out old files in the event the .Dq make cleandir operation is unable to do so. (See .Sx CAVEATS below.) .Pp Note also that use of one of .Fl M or .Fl 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 .Ar obj locations for each). d1823 1 a1823 1 .Sy TOOLDIR Ns Pa /bin d1833 1 a1833 1 .Sy TOOLDIR Ns Pa /bin a1936 12 . .Sh CAVEATS . After significant updates to third-party components in the source tree, the .Dq 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 .Pa UPDATING file for notices concerning this. @ 1.88 log @Add a missing period. @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.87 2012/02/14 21:32:07 apb Exp $ d36 1 a36 1 .Dd September 9, 2011 d558 7 @ 1.87 log @Minor changes to wording in the documentation for build.sh install-image and live-image. @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.86 2012/02/14 21:19:19 apb Exp $ d1219 1 a1219 1 or equivalent @ 1.87.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 @d1 1 a1 1 .\" $NetBSD$ d1219 1 a1219 1 or equivalent. @ 1.87.2.2 log @Pull up following revision(s) (requested by riastradh in ticket #1274): doc/BUILDING.mdoc: revision 1.111 Use `It Sy', not just `It', for live-image, to match other targets. No change to plain-text BUILDING file. @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.87.2.1 2012/03/02 16:48:10 riz Exp $ d1194 1 a1194 1 .It Sy live-image @ 1.86 log @Document build.sh "live-image" and "install-image" targets. These were documented in revision 1.97 of src/BUILDING, but were not documented in src/doc/BUILDING.sh. The original log message was: revision 1.97 date: 2012/01/22 03:53:32; author: tsutsui; state: Exp; lines: +39 -0 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 @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.85 2011/09/09 18:48:34 apb Exp $ d1162 4 a1165 4 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 d1175 1 a1175 1 Bootable installation images also contain tools that may be d1182 3 a1184 1 is attempted, RELEASEDIR must be populated by d1186 7 a1192 4 or equivalent and RELEASEDIR binaries must be built with .Sy MKUNPRIVED=yes to refer permission information from specfiles. d1203 1 a1203 1 upto multi user mode, including all files d1206 1 a1206 1 disklabel, and bootloaders etc. d1208 3 a1210 2 The live image is suitable for misc emulators like QEMU, and also usuful to try d1212 2 a1213 2 on real machines with USB flash memory sticks without installation. d1220 6 a1225 3 and RELEASEDIR binaries must be built with .Sy MKUNPRIVED=yes to refer permission information from specfiles. @ 1.85 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 @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.84 2011/09/09 14:23:38 apb Exp $ d1156 62 d1453 8 @ 1.85.2.1 log @sync with head @ text @d1 1 a1 1 .\" $NetBSD$ a1155 71 .It Sy install-image Create a bootable .Nx installation disk image in the .Sy RELEASEDIR/RELEASEMACHINEDIR Ns Pa /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 .Xr release 7 . .Pp The installation image is bootable, and will automatically run the .Xr sysinst 8 menu-based installation program, which can be used to install or upgrade a .Nx system. The image also contains tools that may be useful in repairing a damaged .Nx installation. .Pp Before .Dq make install-image is attempted, .Sy RELEASEDIR must be populated by .Dq make release or equivalent. The build must have been performed with .Sy MKUNPRIVED=yes because .Dq make install-image relies on information in .Sy DESTDIR Ns Pa /METALOG . . .It live-image Create .Nx live images in the .Sy RELEASEDIR/RELEASEMACHINEDIR Ns Pa /installation/liveimage directory. The live image contains all necessary files to boot .Nx up to multi-user mode, including all files which should be extracted during installation, .Nx disklabel, bootloaders, etc. .Pp The live image is suitable for use as a disk image in virtual machine environments such as QEMU, and also useful to boot .Nx from a USB flash memory stick on a real machine, without the need for installation. .Pp Before .Dq make live-image is attempted, RELEASEDIR must be populated by .Dq make release or equivalent. The build must have been performed with .Sy MKUNPRIVED=yes because .Dq make install-image relies on information in .Sy DESTDIR Ns Pa /METALOG . . a1390 8 .It Sy install-image Perform .Dq make install-image . . .It Sy live-image Perform .Dq make live-image . . @ 1.85.2.2 log @sync with head @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.85.2.1 2012/04/17 00:02:55 yamt Exp $ d36 1 a36 1 .Dd September 19, 2012 d290 1 a290 1 it cannot usefully be set inside a Makefile, including a557 7 .It Sy MKREPRO .YorN Create reproducable builds. This enables different switches to make two builds from the same source tree result in the same build results. .DFLTn . d576 3 a578 3 Indicates whether RCS IDs, for use with .Xr ident 1 , should be stripped from program binaries and shared libraries. d740 1 a740 1 (i.e., d753 1 a753 1 Use the d834 1 a834 1 .Xr make 1 d836 1 a836 1 Makefiles should use .WAIT or have explicit dependencies d1026 2 a1027 2 .Sy INSTALLWORLDDIR Ns Pa /etc , and d1029 1 a1029 1 to check for or fix inconsistencies. d1188 1 a1188 1 .Sy MKUNPRIVED=yes d1221 1 a1221 1 .Sy MKUNPRIVED=yes d1363 1 a1363 1 in the d1497 1 a1497 1 .Ar cdextras d1545 1 a1545 1 .Xr make 1 d1547 1 a1547 1 passed through to d1554 1 a1554 1 please save complete build logs d1768 1 a1768 1 This is propagated to the d1802 1 a1802 1 This is propagated to the d1900 1 a1900 1 Use the @ 1.85.2.3 log @sync with (a bit old) head @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.85.2.2 2012/10/30 18:48:57 yamt Exp $ d435 1 a435 1 .DFLTn @ 1.85.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 .\" $NetBSD: BUILDING.mdoc,v 1.85.2.3 2013/01/16 05:26:12 yamt Exp $ d36 1 a36 1 .Dd November 8, 2012 d159 1 d164 1 a164 1 . d1578 1 a1578 1 .Dq Fl O Ar obj @ 1.84 log @Move the code for creating src/BUILDING from "make build-docs" in src/Makefile to "make regen" in src/doc/Makefile, and update a comment in doc/BUILDING.mdoc to match. @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.83 2011/09/09 14:01:28 apb Exp $ d173 25 a197 4 Path name to a POSIX-compliant shell. If this is not set explicitly, then the default is set using heuristics dependent on the host platform, or from the shell under which d199 2 a200 4 is executed (if that can be determined), or using the first copy of .Pa sh found in a201 9 If the host system's .Pa /bin/sh is not POSIX-compliant, we suggest that you build using commands like .Bd -unfilled -offset indent .Li HOST_SH= Ns Va /path/to/working/shell .Li export HOST_SH .Li ${HOST_SH} build.sh Op Ar options .Ed d1168 1 a1168 1 This script file is a Bourne shell script designed to build the d1171 40 a1210 8 system on any host with a Bourne shell in .Sy /bin/sh , including many that are not POSIX compliant. Note that if a host system's .Sy /bin/sh is unusually old and broken, the Korn Shell .Sy ( /bin/ksh ) , if available, may be a usable alternative. @ 1.83 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 @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.82 2011/09/09 13:29:23 apb Exp $ d30 2 a31 2 .\" NOTE: After changing this file, run "make build-docs" to generate the .\" proper plaintext versions, and check in all BUILDING.* files! @ 1.82 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 @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.81 2010/07/25 07:19:00 mrg Exp $ d471 5 d998 1 a998 1 environment variable may be set to a list of d1269 2 a1270 1 sets will not be installed. @ 1.81 log @remove the MKSUBPIXEL/MKTTINTERP options; they're going away. regenerate. @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.80 2009/10/10 19:05:29 apb Exp $ d3 1 a3 1 .\" Copyright (c) 2001-2008 The NetBSD Foundation, Inc. d36 1 a36 1 .Dd May 1, 2009 d216 9 @ 1.80 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 @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.79 2009/10/02 07:43:01 cegger Exp $ a556 16 .It Sy MKSUBPIXEL .YorN For X builds, decides if subpixel rendering code in FreeType is turned on. Turned off by default because of patent issues. .DFLTn . .It Sy MKTTINTERP .YorN For X builds, decides if the TrueType bytecode interpreter is turned on. See .Pa http://www.freetype.org/patents.html for details. .DFLTn . @ 1.79 log @backout wrong changes after I got teached that the vowel *sound* matters and not the spelling letter (which is what I learned at school). @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.77 2009/09/27 18:08:24 apb Exp $ d672 3 a674 1 .Dq /usr/xsrc @ 1.78 log @fix grammar: a -> an @ text @d1168 1 a1168 1 if available, may be an usable alternative. @ 1.77 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 @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.76 2009/09/27 17:28:38 apb Exp $ d1168 1 a1168 1 if available, may be a usable alternative. @ 1.76 log @Allow build.sh "-C cdextra" option to be specified multiple times. @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.75 2009/09/27 16:44:40 apb Exp $ d246 15 a260 2 If specified, must be an absolute path. If this is defined, d1446 6 d1461 1 d1464 11 a1474 5 Unsets .Sy MAKEOBJDIR . See .Dq Fl O obj for more information. d1538 3 d1548 1 d1551 10 a1560 2 Unsets .Sy MAKEOBJDIRPREFIX . @ 1.75 log @Revision 1.86 of src/BUILDING somehow got committed without the corresponding changes to src/doc/BUILDING.mdoc. Fix that now. The original log message was: 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 @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.74 2009/07/12 14:16:36 hubertf Exp $ d1361 3 a1363 1 Set the value of d1365 3 a1367 4 to .Ar 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 d1370 2 a1371 1 .Dq iso-image-source . d1376 4 @ 1.74 log @s/reproducable/reproducible/, requested by salo@@ @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.73 2009/07/12 12:14:51 hubertf Exp $ d1295 4 @ 1.73 log @Add a keywords for people looking for reproducable (identical) builds. @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.72 2009/05/01 19:42:18 snj Exp $ d314 1 a314 1 built from the same sources, resulting in identical (reproducable) builds. @ 1.72 log @Introduce MKSUBPIXEL, which allows enabling subpixel rendering code in FreeType. @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.71 2008/12/02 22:28:21 mrg Exp $ d314 1 a314 1 built from the same sources. @ 1.71 log @be explicit about MAKEOBJDIR and MAKEOBJDIRPREFIX not being for mk.conf or ${MAKECONF}. @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.70 2008/11/15 11:27:49 mrg Exp $ d36 1 a36 1 .Dd September 10, 2008 d544 7 @ 1.71.2.1 log @Sync with HEAD. Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.72 2009/05/01 19:42:18 snj Exp $ d36 1 a36 1 .Dd May 1, 2009 a543 7 .It Sy MKSUBPIXEL .YorN For X builds, decides if subpixel rendering code in FreeType is turned on. Turned off by default because of patent issues. .DFLTn . @ 1.70 log @revert sparc back to default of XFree86 at the request of macallan. @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.69 2008/11/13 20:40:11 apb Exp $ d239 4 a242 1 it cannot usefully be set inside a Makefile. d258 4 a261 1 it cannot usefully be set inside a Makefile. @ 1.69 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 @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.68 2008/11/09 23:02:29 mrg Exp $ d655 1 a655 1 on amd64, i386, macppc, shark, sparc and sparc64 platforms, @ 1.68 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 @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.67 2008/09/24 07:36:52 apb Exp $ d361 3 a363 1 No descriptive messages are shown. d365 4 a368 1 Descriptive messages are shown. d370 19 a388 3 Descriptive messages (prefixed with a .Sq # ) and command output is not suppressed. @ 1.67 log @* Strengthen the advice against relying on the default objdir selection rules. * Add "[options]" to examples in an attempt to make it clear that extra options should be passed. @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.66 2008/09/10 11:16:41 joerg Exp $ d552 1 a552 1 Indicates whether X11R6 is built from a553 12 .Pp Mutually exclusive to .Sy MKXORG != no . .DFLTn . .It Sy MKXORG .YorN Indicates whether X11R7 (modular Xorg) is built from .Sy X11SRCDIR . .Pp Mutually exclusive to .Sy MKX11 != no . d627 11 @ 1.67.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 @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.67 2008/09/24 07:36:52 apb Exp $ d552 1 a552 1 Indicates whether X11 is built from d554 12 a638 11 .It Sy X11FLAVOUR The style of X11 cross-built, set to either .Dq Xorg or .Dq XFree86 . .DFLT .Dq Xorg on amd64, i386, macppc, shark, sparc and sparc64 platforms, .Dq XFree86 on everything else. . @ 1.67.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 @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.67.2.1 2008/11/15 22:05:12 snj Exp $ d634 1 a634 1 on amd64, i386, macppc, shark and sparc64 platforms, @ 1.67.2.2.4.1 log @bring matt-nb5-mips64 up to date with netbsd-5-1-RELEASE (except compat). @ text @d1 1 a1 1 .\" $NetBSD$ d36 1 a36 1 .Dd May 1, 2009 a516 7 .It Sy MKSUBPIXEL .YorN For X builds, decides if subpixel rendering code in FreeType is turned on. Turned off by default because of patent issues. .DFLTn . @ 1.67.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 @d1 1 a1 1 .\" $NetBSD$ d36 1 a36 1 .Dd May 1, 2009 a516 7 .It Sy MKSUBPIXEL .YorN For X builds, decides if subpixel rendering code in FreeType is turned on. Turned off by default because of patent issues. .DFLTn . @ 1.66 log @Document MKSTRIPIDENT. Requested by lukem@@ @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.65 2008/09/06 23:22:46 lukem Exp $ d1486 1 a1486 3 If the source directory is .Pa /usr/src and neither d1492 5 a1496 5 .Aq bsd.obj.mk ; this default is usually either .Pa /usr/obj or .Pa /usr/obj. Ns Sy MACHINE . d1644 1 a1644 1 .Li "% ./build.sh tools kernel=GENERIC" d1650 1 a1650 1 .Li "% ./build.sh -U distribution" d1660 1 a1660 1 .Li "# ./build.sh -U install=/" d1674 1 a1674 1 .Li "% ./build.sh -U -u release" @ 1.65 log @document MKHTML @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.64 2008/08/28 07:21:49 lukem Exp $ d36 1 a36 1 .Dd August 18, 2008 d510 7 @ 1.64 log @Improve support for MKXORG!=no to enable builds into external/mit/xorg. This will be mutually exclusive to MKX11!=no. @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.63 2008/08/18 05:27:05 lukem Exp $ d394 6 @ 1.63 log @Document "build.sh cleandir". Fix formatting nit. Remove BUGS; all the in-tree platforms are using build.sh now. @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.62 2008/08/11 08:22:40 apb Exp $ d541 12 @ 1.62 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 @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.61 2008/08/05 22:40:33 apb Exp $ d36 1 a36 1 .Dd August 11, 2008 d1031 1 a1031 1 .It iso-image-source d1164 4 a1704 4 . .Sh BUGS . A few platforms are not yet using this build system. @ 1.61 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 @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.60 2008/08/05 19:43:33 perry Exp $ d36 1 a36 1 .Dd August 5, 2008 a756 2 If you see build failures with -j, please save complete build logs so the failures can be analyzed. d1342 6 a1347 3 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 d1349 6 @ 1.60 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 @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.59 2008/04/30 13:10:49 martin Exp $ d36 1 a36 1 .Dd March 18, 2008 d223 8 d235 1 a235 1 can only be provided in the environment or via the d238 2 a239 1 .Nm build.sh . d251 1 a251 1 can only be provided in the environment or via the d254 2 a255 1 .Nm build.sh . d1354 9 d1367 3 a1432 2 If a relative path is specified, it will be converted to an absolute path before being used. d1434 1 a1434 1 .Sy /usr/obj d1436 3 a1438 3 .Sy /usr/obj/bin , .Sy /usr/obj/lib , .Sy /usr/obj/usr.bin , d1440 2 d1444 19 a1462 1 . @ 1.59 log @Convert TNF licenses to new 2 clause variant @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.58 2008/03/29 05:22:42 dholland Exp $ d292 10 d1451 7 @ 1.59.2.1 log @file BUILDING.mdoc was added on branch mjf-devfs2 on 2008-10-05 20:11:18 +0000 @ text @d1 1640 @ 1.59.2.2 log @Sync with HEAD. @ text @a0 1727 .\" $NetBSD: BUILDING.mdoc,v 1.59.2.1 2008/10/05 20:11:18 mjf Exp $ .\" .\" Copyright (c) 2001-2008 The NetBSD Foundation, Inc. .\" All rights reserved. .\" .\" This code is derived from software contributed to The NetBSD Foundation .\" by Todd Vierling and Luke Mewburn. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" .\" NOTE: After changing this file, run "make build-docs" to generate the .\" proper plaintext versions, and check in all BUILDING.* files! .\" .\" Toolchain prefix for commands .ds toolprefix nb . .Dd September 10, 2008 .Dt BUILDING 8 .Os NetBSD . .Sh NAME . .Nm BUILDING .Nd Procedure for building .Nx from source code. . .Sh REQUIREMENTS . .Nx is designed to be buildable on most POSIX-compliant host systems. The basic build procedure is the same whether compiling .Em natively (on the same .Nx architecture) or .Em cross compiling (on another architecture or OS). .Pp This source tree contains a special subtree, .Dq 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 .Nm ( make is not required); all other tools are created as part of the .Nx build process. (See the environment variables section below if you need to override or manually select your compilers.) . .Sh FILES . .Ss Source tree layout . .Bl -tag -width "BUILDING.mdoc" .It Sy doc/BUILDING.mdoc This document (in -mdoc troff format; the original copy). .It Sy BUILDING This document (in plaintext). .It Sy tools/compat/README Special notes for cross-hosting a NetBSD build on non-NetBSD platforms. .It Sy Makefile The main Makefile for .Nx ; should only be run for native builds with an appropriately up-to-date version of .Nx .Xr make 1 . (For building from out-of-date systems or on a non-native host, see the .Nm build.sh shell script.) .It Sy UPDATING Special notes for updating from an earlier revision of .Nx . It is important to read this file before every build of an updated source tree. .It Sy build.sh Bourne-compatible shell script used for building the host build tools and the .Nx system from scratch. Can be used for both native and cross builds, and should be used instead of .Xr make 1 for any source tree that is updated and recompiled regularly. .It Sy crypto/dist/ , dist/ , gnu/dist/ Sources imported verbatim from third parties, without mangling the existing build structure. Other source trees in .Sy bin through .Sy usr.sbin use the .Nx .Xr make 1 .Dq reachover Makefile semantics when building these programs for a native host. .It Sy distrib/ , etc/ Sources for items used when making a full release snapshot, such as files installed in .Sy DESTDIR Ns Pa /etc on the destination system, boot media, and release notes. .It Sy tests/ , regress/ Regression test harness. Can be cross-compiled, but only run natively. .Pa tests/ uses the .Xr atf 7 test framework; .Pa regress/ contains older tests that have not yet been migrated to .Xr atf 7 . .It Sy sys/ .Nx kernel sources. .It Sy tools/ .Dq Reachover build structure for the host build tools. This has a special method of determining out-of-date status. .It Sy bin/ ... usr.sbin/ Sources to the .Nx userland (non-kernel) programs. If any of these directories are missing, they will be skipped during the build. .It Sy x11/ .Dq Reachover build structure for X11R6; the source is in .Sy X11SRCDIR . .El . .Ss Build tree layout . The .Nx build tree is described in .Xr hier 7 , and the release layout is described in .Xr release 7 . .Pp . .Sh CONFIGURATION . .Ss Environment variables .. Several environment variables control the behaviour of .Nx builds. . .Bl -tag -width "MAKEOBJDIRPREFIX" . . .It Sy HOST_SH Path name to a POSIX-compliant shell. If this is not set explicitly, then the default is set using heuristics dependent on the host platform, or from the shell under which .Nm build.sh is executed (if that can be determined), or using the first copy of .Pa sh found in .Sy PATH . If the host system's .Pa /bin/sh is not POSIX-compliant, we suggest that you build using commands like .Bd -unfilled -offset indent .Li HOST_SH= Ns Va /path/to/working/shell .Li export HOST_SH .Li ${HOST_SH} build.sh Op Ar options .Ed . .It Sy HOST_CC Path name to C compiler used to create the toolchain. . .It Sy HOST_CXX Path name to C++ compiler used to create the toolchain. . .It Sy MACHINE Machine type, e.g., .Dq macppc . . .It Sy MACHINE_ARCH Machine architecture, e.g., .Dq powerpc . . .It Sy MAKE Path name to invoke .Xr make 1 as. . .It Sy MAKEFLAGS Flags to invoke .Xr make 1 with. . .It Sy MAKEOBJDIR Directory to use as the .Sy .OBJDIR for the current directory. The value is subjected to variable expansion by .Xr make 1 . Typical usage is to set this variable to a value involving the use of .Sq ${.CURDIR:S...} or .Sq ${.CURDIR:C...} , to derive the value of .Sy .OBJDIR from the value of .Sy .CURDIR . Used only if .Sy MAKEOBJDIRPREFIX is not defined. .Sy MAKEOBJDIR can be provided only in the environment or via the .Fl O flag of .Nm build.sh ; it cannot usefully be set inside a Makefile. . .It Sy 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 .Sy .OBJDIR for the current directory. The current directory may be read only. .Sy MAKEOBJDIRPREFIX can be provided only in the environment or via the .Fl M flag of .Nm build.sh ; it cannot usefully be set inside a Makefile. . .El . .Ss \*qmake\*q variables . .de YorN Can be set to .Dq yes or .Dq no . .. .de DFLT .Pp .Em Default : .. .de DFLTu .DFLT Unset. .. .de DFLTy .DFLT .Dq yes .. .de DFLTn .DFLT .Dq no .. Several variables control the behavior of .Nx builds. Unless otherwise specified, these variables may be set in either the process environment or the .Xr make 1 configuration file specified by .Sy MAKECONF . . .Bl -tag -width "MKCATPAGES" . .It Sy BUILDID Identifier for the build. The identifier will be appended to object directory names, and can be consulted in the .Xr make 1 configuration file in order to set additional build parameters, such as compiler flags. . .It Sy 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. Additional information is available in the GCC documentation of -frandom-seed. . .It Sy DESTDIR Directory to contain the built .Nx system. If set, special options are passed to the compilation tools to prevent their default use of the host system's .Sy /usr/include , /usr/lib , and so forth. This pathname must be an absolute path, and should .Em not end with a slash .Pq / character. (For installation into the system's root directory, set .Sy DESTDIR to an empty string, not to .Dq / ) . The directory must reside on a file system which supports long file names and hard links. .DFLT Empty string if .Sy USETOOLS is .Dq yes ; unset otherwise. .Pp .Em Note : .Sy build.sh will provide a default of .Pa destdir. Ns Sy MACHINE (in the top-level .Sy .OBJDIR ) unless run in .Sq expert mode. . .It Sy MAKECONF The name of the .Xr make 1 configuration file. .Em Only settable in the process environment. .DFLT .Dq /etc/mk.conf . .It Sy MAKEVERBOSE Level of verbosity of status messages. Supported values: .Bl -tag -width xxx .It 0 No descriptive messages are shown. .It 1 Descriptive messages are shown. .It 2 Descriptive messages (prefixed with a .Sq # ) and command output is not suppressed. .El .DFLT 2 . .It Sy MKCATPAGES .YorN Indicates whether preformatted plaintext manual pages will be created during a build. .DFLTy . .It Sy MKCRYPTO .YorN 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, .Xr crypt 3 . .DFLTy . .It Sy MKDOC .YorN Indicates whether system documentation destined for .Sy DESTDIR Ns Pa /usr/share/doc will be installed during a build. .DFLTy . .It Sy MKHTML .YorN Indicates whether preformatted HTML manual pages will be built and installed .DFLTy . .It Sy MKHOSTOBJ .YorN If set to .Dq 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 .Dq make obj . (This allows multiple host systems to compile NetBSD for a single target.) If set to .Dq 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. .DFLTn . .It Sy MKINFO .YorN Indicates whether GNU Info files, used for the documentation for most of the compilation tools, will be created and installed during a build. .DFLTy . .It Sy MKLINT .YorN Indicates whether .Xr lint 1 will be run against portions of the .Nx source code during the build, and whether lint libraries will be installed into .Sy DESTDIR Ns Pa /usr/libdata/lint . .DFLTy . .It Sy MKMAN .YorN Indicates whether manual pages will be installed during a build. .DFLTy . .It Sy MKNLS .YorN Indicates whether Native Language System locale zone files will be compiled and installed during a build. .DFLTy . .It Sy MKOBJ .YorN Indicates whether object directories will be created when running .Dq make obj . If set to .Dq no , then all built files will be located inside the regular source tree. .DFLTy .Pp Note that setting .Sy MKOBJ to .Dq no is not recommended and may cause problems when updating the tree with .Xr cvs 1 . . .It Sy MKPIC .YorN Indicates whether shared objects and libraries will be created and installed during a build. If set to .Dq no , the entire built system will be statically linked. .DFLT Platform dependent. As of this writing, all platforms except .Sy sh3 default to .Dq yes . . .It Sy MKPICINSTALL .YorN Indicates whether the .Xr ar 1 format libraries .Sy ( lib*_pic.a ) , used to generate shared libraries, are installed during a build. .DFLTy . .It Sy MKPROFILE .YorN Indicates whether profiled libraries .Sy ( lib*_p.a ) will be built and installed during a build. .DFLT .Dq yes ; however, some platforms turn off .Sy MKPROFILE by default at times due to toolchain problems with profiled code. . .It Sy MKSHARE .YorN Indicates whether files destined to reside in .Sy DESTDIR Ns Pa /usr/share will be built and installed during a build. If set to .Dq no , then all of .Sy MKCATPAGES , MKDOC , MKINFO , MKMAN , and .Sy MKNLS will be set to .Dq no unconditionally. .DFLTy . .It Sy MKSTRIPIDENT .YorN Indicates whether program binaries and shared libraries should be built to include RCS IDs for use with .Xr ident 1 . .DFLTn . .It Sy MKTTINTERP .YorN For X builds, decides if the TrueType bytecode interpreter is turned on. See .Pa http://www.freetype.org/patents.html for details. .DFLTn . .It Sy MKUNPRIVED .YorN 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 .Pa METALOG in .Sy DESTDIR . The contents of .Pa METALOG are used during the generation of the distribution tar files to ensure that the appropriate file ownership is stored. .DFLTn . .It Sy MKUPDATE .YorN Indicates whether all install operations intended to write to .Sy 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). .DFLTn . .It Sy MKX11 .YorN Indicates whether X11R6 is built from .Sy X11SRCDIR . .Pp Mutually exclusive to .Sy MKXORG != no . .DFLTn . .It Sy MKXORG .YorN Indicates whether X11R7 (modular Xorg) is built from .Sy X11SRCDIR . .Pp Mutually exclusive to .Sy MKX11 != no . .DFLTn . .It Sy 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 .Nx source tree. (However, multiple targets may share the same .Sy TOOLDIR ; the target-dependent files have unique names.) If unset, a default based on the .Xr uname 1 information of the host platform will be created in the .Sy .OBJDIR of .Pa src . .DFLTu . .It Sy USETOOLS Indicates whether the tools specified by .Sy TOOLDIR should be used as part of a build in progress. Must be set to .Dq yes if cross-compiling. .Bl -tag -width "never" .It Sy yes Use the tools from .Sy TOOLDIR . .It Sy no Do not use the tools from .Sy TOOLDIR , but refuse to build native compilation tool components that are version-specific for that tool. .It Sy never Do not use the tools from .Sy TOOLDIR , even when building native tool components. This is similar to the traditional .Nx build method, but does .Em 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 .Nx source tree. .El .DFLT .Dq yes , unless .Sy TOOLCHAIN_MISSING is set to .Dq yes . .Pp .Sy USETOOLS is also set to .Dq no when using .Aq bsd.*.mk outside the .Nx source tree. . .It Sy X11SRCDIR Directory containing the X11R6 source. If specified, must be an absolute path. The main X11R6 source is found in .Sy X11SRCDIR Ns Pa /xfree/xc . .DFLT .Dq /usr/xsrc . .El . .Ss \*qmake\*q variables for full builds These variables only affect the top level .Dq Makefile and do not affect manually building subtrees of the .Nx source code. . .Bl -tag -width "INSTALLWORLDDIR" . .It Sy INSTALLWORLDDIR Location for the .Dq make installworld target to install to. If specified, must be an absolute path. .DFLT .Dq / . .It Sy MKOBJDIRS .YorN Indicates whether object directories will be created automatically (via a .Dq make obj pass) at the start of a build. .DFLTn .Pp If using .Sy build.sh , the default is .Dq yes . This may be set back to .Dq no by giving .Sy build.sh the .Fl o option. . .It Sy MKUPDATE .YorN If set, then in addition to the effects described for .Sy MKUPDATE=yes above, this implies the effects of .Sy NOCLEANDIR (i.e., .Dq make cleandir is avoided). .DFLTn .Pp If using .Sy build.sh , this may be set by giving the .Fl u option. . .It Sy NBUILDJOBS Now obsolete. Use the .Xr make 1 option .Fl j , instead. See below. .DFLTu . .It Sy NOCLEANDIR If set, avoids the .Dq 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. .DFLTu .Pp See also .Sy MKUPDATE . . .It Sy NODISTRIBDIRS If set, avoids the .Dq make distrib-dirs phase of a full build. This skips running .Xr mtree 8 on .Sy DESTDIR , useful on systems where building as an unprivileged user, or where it is known that the system-wide mtree files have not changed. .DFLTu . .It Sy NOINCLUDES If set, avoids the .Dq make includes phase of a full build. This has the effect of preventing .Xr 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 .Nx source tree arbitrarily; it is suggested to use .Sy MKUPDATE=yes instead in that case. .DFLTu . .It Sy RELEASEDIR If set, specifies the directory to which a .Xr release 7 layout will be written at the end of a .Dq make release . If specified, must be an absolute path. .DFLTu .Pp .Em Note : .Sy build.sh will provide a default of .Pa releasedir (in the top-level .Sy .OBJDIR ) unless run in .Sq expert mode. . .El . .Sh BUILDING . .Ss \*qmake\*q command line options This is not a summary of all the options available to .Xr make 1 ; only the options used most frequently with .Nx builds are listed here. . .Bl -tag -width "var=value" . .It Fl j Ar njob Run up to .Ar njob .Xr make 1 subjobs in parallel. Makefiles should use .WAIT or have explicit dependencies as necessary to enforce build ordering. . .It Fl m Ar dir Specify the default directory for searching for system Makefile segments, mainly the .Aq bsd.*.mk files. When building any full .Nx source tree, this should be set to the .Dq share/mk directory in the source tree. This is set automatically when building from the top level, or when using .Sy build.sh . . .It Fl n Display the commands that would have been executed, but do not actually execute them. This will still cause recursion to take place. . .It Fl V Ar var Print .Xr make 1 Ns 's idea of the value of .Ar var . Does not build any targets. . .It Em var=value Set the variable .Em var to .Em value , overriding any setting specified by the process environment, the .Sy MAKECONF configuration file, or the system Makefile segments. . .El . .Ss \*qmake\*q targets . These default targets may be built by running .Xr make 1 in any subtree of the .Nx source code. It is recommended that none of these be used from the top level Makefile; as a specific exception, .Dq make obj and .Dq make cleandir are useful in that context. . .Bl -tag -width "dependall" . .It Sy all Build programs, libraries, and preformatted documentation. . .It Sy clean Remove program and library object code files. . .It Sy cleandir Same as .Sy clean , but also remove preformatted documentation, dependency files generated by .Dq make depend , and any other files known to be created at build time. . .It Sy depend Create dependency files .Sy ( .depend ) containing more detailed information about the dependencies of source code on header files. Allows programs to be recompiled automatically when a dependency changes. . .It Sy dependall Does a .Dq make depend immediately followed by a .Dq make all . This improves cache locality of the build since both passes read the source files in their entirety. . .It Sy distclean Synonym for .Sy cleandir . . .It Sy includes Build and install system header files. Typically needed before any system libraries or programs can be built. . .It Sy install Install programs, libraries, and documentation into .Sy DESTDIR . Few files will be installed to .Sy DESTDIR Ns Pa /dev , .Sy DESTDIR Ns Pa /etc , .Sy DESTDIR Ns Pa /root or .Sy DESTDIR Ns Pa /var in order to prevent user supplied configuration data from being overwritten. .It Sy lint Run .Xr lint 1 against the C source code, where appropriate, and generate system-installed lint libraries. . .It Sy obj Create object directories to be used for built files, instead of building directly in the source tree. . .It Sy tags Create .Xr ctags 1 searchable function lists usable by the .Xr ex 1 and .Xr vi 1 text editors. . .El . .Ss \*qmake\*q targets for the top level . Additional .Xr make 1 targets are usable specifically from the top source level to facilitate building the entire .Nx source tree. . .Bl -tag -width "distribution" . .It Sy build Build the entire .Nx system (except the kernel). This orders portions of the source tree such that prerequisites will be built in the proper order. . .It Sy distribution Do a .Dq make build , and then install a full distribution (which does not include a kernel) into .Sy DESTDIR , including files in .Sy DESTDIR Ns Pa /dev , .Sy DESTDIR Ns Pa /etc , .Sy DESTDIR Ns Pa /root and .Sy DESTDIR Ns Pa /var . . .It Sy buildworld As per .Dq make distribution , except that it ensures that .Sy DESTDIR is not the root directory. . .It Sy installworld Install the distribution from .Sy DESTDIR to .Sy INSTALLWORLDDIR , which defaults to the root directory. Ensures that .Sy INSTALLWORLDDIR is not the root directory if cross compiling. .Pp The .Sy INSTALLSETS environment variable may be set to a list of distribution sets to be installed. By default, all sets except .Dq etc and .Dq xetc are installed, so most files in .Sy INSTALLWORLDDIR Ns Pa /etc will not be installed or modified. .Pp .Em Note : Before performing this operation with .Sy INSTALLWORLDDIR Ns = Ns Pa / , it is highly recommended that you upgrade your kernel and reboot. After performing this operation, it is recommended that you use .Xr etcupdate 8 to update files in .Sy INSTALLWORLDDIR Ns Pa /etc and that you use .Xr postinstall 8 to check for inconsistencies (and possibly to fix them). .It Sy sets Create distribution sets from .Sy DESTDIR into .Sy RELEASEDIR/RELEASEMACHINEDIR Ns Pa /binary/sets . Should be run after .Dq make distribution , as .Dq make build alone does not install all of the required files. . .It Sy sourcesets Create source sets of the source tree into .Sy RELEASEDIR Ns Pa /source/sets . . .It Sy syspkgs Create syspkgs from .Sy DESTDIR into .Sy RELEASEDIR/RELEASEMACHINEDIR Ns Pa /binary/syspkgs . Should be run after .Dq make distribution , as .Dq make build alone does not install all of the required files. . .It Sy release Do a .Dq make distribution , build kernels, distribution media, and install sets (this as per .Dq make sets ) , and then package the system into a standard release layout as described by .Xr release 7 . This requires that .Sy RELEASEDIR be set (see above). . .It Sy iso-image Create a .Nx installation CD-ROM image in the .Sy RELEASEDIR Ns Pa /iso directory. The CD-ROM file system will have a layout as described in .Xr release 7 . .Pp For most machine types, the CD-ROM will be bootable, and will automatically run the .Xr sysinst 8 menu-based installation program, which can be used to install or upgrade a .Nx system. Bootable CD-ROMs also contain tools that may be useful in repairing a damaged .Nx installation. .Pp Before .Dq make iso-image is attempted, RELEASEDIR must be populated by .Dq make release or equivalent. .Pp Note that other, smaller, CD-ROM images may be created in the .Sy RELEASEDIR/RELEASEMACHINEDIR Ns Pa /installation/cdrom directory by .Dq "make release" . These smaller images usually contain the same tools as the larger images in .Sy RELEASEDIR Ns Pa /iso , but do not contain additional content such as the distribution sets. .Pp Note that the mac68k port still uses an older method of creating CD-ROM images. This requires the .Xr mkisofs 1 utility, which is not part of .Nx , but which can be installed from .Pa pkgsrc/sysutils/cdrtools . . .It Sy iso-image-source Create a .Nx installation CD-ROM image in the .Sy RELEASEDIR Ns Pa /iso directory. The CD-ROM file system will have a layout as described in .Xr release 7 . It will have top level directories for the machine type and source. .Pp For most machine types, the CD-ROM will be bootable, and will automatically run the .Xr sysinst 8 menu-based installation program, which can be used to install or upgrade a .Nx system. Bootable CD-ROMs also contain tools that may be useful in repairing a damaged .Nx installation. .Pp Before .Dq make iso-image-source is attempted, RELEASEDIR must be populated by .Dq make sourcesets release or equivalent. .Pp Note that other, smaller, CD-ROM images may be created in the .Sy RELEASEDIR/RELEASEMACHINEDIR Ns Pa /installation/cdrom directory by .Dq make release . These smaller images usually contain the same tools as the larger images in .Sy RELEASEDIR Ns Pa /iso , but do not contain additional content such as the distribution sets. .Pp Note that the mac68k port still uses an older method of creating CD-ROM images. This requires the .Xr mkisofs 1 utility, which is not part of .Nx , but which can be installed from .Pa pkgsrc/sysutils/cdrtools . . .It Sy regression-tests Can only be run after building the regression tests in the directory .Dq regress . Runs those compiled regression tests on the local host. Note that most tests are now managed instead using .Xr atf 7 ; this target should probably run those as well but currently does not. . .El . .Ss The \*qbuild.sh\*q script . This script file is a Bourne shell script designed to build the entire .Nx system on any host with a Bourne shell in .Sy /bin/sh , including many that are not POSIX compliant. Note that if a host system's .Sy /bin/sh is unusually old and broken, the Korn Shell .Sy ( /bin/ksh ) , if available, may be a usable alternative. .Pp All cross-compile builds, and most native builds, of the entire system should make use of .Sy build.sh rather than just running .Dq make . This way, the .Xr make 1 program will be bootstrapped properly, in case the host system has an older or incompatible .Dq make program. .Pp When compiling the entire system via .Sy build.sh , many .Xr 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 .Sy build.sh are noted where applicable. . .Pp The following operations are supported by .Sy build.sh : . .Bl -tag -width "distribution" . .It Sy build Build the system as per .Dq make build . Before the main part of the build commences, this command runs the .Sy obj operation (unless the .Fl o option is given), .Dq make cleandir (unless the .Fl u option is given), and the .Sy tools operation. . .It Sy distribution Build a full distribution as per .Dq make distribution . This command first runs the .Sy build operation. . .It Sy release Build a full release as per .Dq make release . This command first runs the .Sy distribution operation. . .It Sy makewrapper Create the .Sy \*[toolprefix]make-MACHINE wrapper. This operation is automatically performed for any of the other operations. . .It Sy cleandir Perform .Dq make cleandir . . .It Sy obj Perform .Dq make obj . . .It Sy tools Build and install the host tools from .Pa src/tools . This command will first run .Dq make obj and .Dq make cleandir in the .Pa tools subdirectory unless the .Fl o or .Fl u options (respectively) are given. . .It Sy install Ns = Ns Ar idir Install the contents of .Sy DESTDIR to .Ar idir , using .Dq make installworld . Note that files that are part of the .Dq etc or .Dq xetc sets will not be installed. . .It Sy kernel Ns = Ns Ar kconf Build a new kernel. The .Ar kconf argument is the name of a configuration file suitable for use by .Xr config 1 . If .Ar kconf does not contain any .Sq / characters, the configuration file is expected to be found in the .Sy KERNCONFDIR directory, which is typically .Sy sys/arch/MACHINE/conf . The new kernel will be built in a subdirectory of .Sy KERNOBJDIR , which is typically .Sy sys/arch/MACHINE/compile or an associated object directory. .Pp This command does .Em not imply the .Sy tools command; run the .Sy tools command first unless it is .Em certain that the tools already exist and are up to date. .Pp This command will run .Dq make cleandir on the kernel in question first unless the .Fl u option is given. . .It Sy releasekernel Ns = Ns Ar kconf Install a .Xr gzip 1 Ns ed copy of the kernel previously built by .Sy kernel Ns = Ns Ar kconf into .Sy RELEASEDIR/RELEASEMACHINEDIR Ns Pa /binary/kernel , usually as .Pa netbsd- Ns Ar kconf Ns Pa .gz , although the .Dq Pa netbsd prefix is determined from the .Dq Sy config directives in .Ar kconf . . .It Sy sets Perform .Dq make sets . . .It Sy sourcesets Perform .Dq make sourcesets . . .It Sy syspkgs Perform .Dq make syspkgs . . .It Sy iso-image Perform .Dq make iso-image . . .It Sy iso-image-source Perform .Dq make iso-image-source . . .El . .Pp The following command line options alter the behaviour of the .Sy build.sh operations described above: . .Bl -tag -width "-T tools" . .It Fl a Ar arch Set the value of .Sy MACHINE_ARCH to .Ar arch . . .It Fl B Ar buildid Set the value of .Sy BUILDID to .Ar buildid . This will also append the build identifier to the name of the .Dq make wrapper script so that the resulting name is of the form .Dq Sy \*[toolprefix]make-MACHINE-BUILDID . . .It Fl C Ar cdextras Set the value of .Sy CDEXTRA to .Ar 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 .Dq iso-image or .Dq 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. . .It Fl D Ar dest Set the value of .Sy DESTDIR to .Ar dest . If a relative path is specified, it will be converted to an absolute path before being used. . .It Fl E Set .Sq expert mode. This overrides various sanity checks, and allows: .Sy DESTDIR does not have to be set to a non-root path for builds, and .Sy MKUNPRIVED=yes does not have to be set when building as a non-root user. .Pp .Em Note : It is highly recommended that you know what you are doing when you use this option. . .It Fl h Print a help message. . .It Fl j Ar njob Run up to .Ar njob .Xr make 1 subjobs in parallel; passed through to .Xr make 1 . If you see failures for reasons other than running out of memory while using .Sy build.sh with .Fl j , please save complete build logs so the failures can be analyzed. .Pp To achieve the fastest builds, .Fl 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. . .It Fl M Ar obj Set .Sy MAKEOBJDIRPREFIX to .Ar obj . For instance, if the source directory is .Pa /usr/src , a setting of .Dq Fl M Pa /usr/obj will place build-time files under .Pa /usr/obj/usr/src/bin , .Pa /usr/obj/usr/src/lib , .Pa /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 .Sy MAKEOBJDIR . See .Dq Fl O obj for more information. . .It Fl m Ar mach Set the value of .Sy MACHINE to .Ar mach , except in some special cases listed below. This will also override any value of .Sy MACHINE_ARCH in the process environment with a value deduced from .Ar mach , unless .Fl a is specified. All cross builds require .Fl m , but if unset on a NetBSD host, the host's value of MACHINE will be detected and used automatically. .Pp Some machines support multiple values for .Sy MACHINE_ARCH . The following special cases for the .Ar mach argument are defined to set the listed values of .Sy MACHINE and .Sy MACHINE_ARCH : .Bl -column "evbmips-el" "MACHINE" "MACHINE_ARCH" -offset indent .It Sy mach Ta Sy "MACHINE" Ta Sy "MACHINE_ARCH" .It evbarm Ta evbarm Ta (not set) .It evbarm-eb Ta evbarm Ta armeb .It evbarm-el Ta evbarm Ta arm .It evbmips Ta evbmips Ta (not set) .It evbmips-eb Ta evbmips Ta mipseb .It evbmips-el Ta evbmips Ta mipsel .It evbsh3 Ta evbsh3 Ta (not set) .It evbsh3-eb Ta evbsh3 Ta sh3eb .It evbsh3-el Ta evbsh3 Ta sh3el .It sbmips Ta sbmips Ta (not set) .It sbmips-eb Ta sbmips Ta mipseb .It sbmips-el Ta sbmips Ta mipsel .El . .It Fl N Ar noiselevel Set the .Dq noisyness level of the build, by setting .Sy MAKEVERBOSE to .Ar noiselevel . . .It Fl n Show the commands that would be executed by .Sy build.sh , but do not make any changes. This is similar in concept to .Dq make -n . . .It Fl O Ar obj Create an appropriate transform macro for .Sy MAKEOBJDIR that will place the built object files under .Ar obj . For instance, a setting of .Dq Fl O Pa /usr/obj will place build-time files under .Pa /usr/obj/bin , .Pa /usr/obj/lib , .Pa /usr/obj/usr.bin , and so forth. If a relative path is specified, it will be converted to an absolute path before being used. Unsets .Sy MAKEOBJDIRPREFIX . .Pp In normal use, exactly one of the .Fl M or .Fl O options should be specified. If neither .Fl M nor .Fl O is specified, then a default object directory will be chosen according to rules in .Aq bsd.obj.mk . 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. .It Fl o Set the value of .Sy MKOBJDIRS to .Dq no . Otherwise, it will be automatically set to .Dq yes . This default is opposite to the behaviour when not using .Sy build.sh . . .It Fl R Ar rel Set the value of .Sy RELEASEDIR to .Ar rel . If a relative path is specified, it will be converted to an absolute path before being used. . .It Fl r Remove the contents of .Sy DESTDIR and .Sy TOOLDIR before building (provides a clean starting point). This will skip deleting .Sy DESTDIR if building on a native system to the root directory. . .It Fl S Ar seed Change the value of .Sy BUILDSEED to .Ar seed . This should rarely be necessary. . .It Fl T Ar tools Set the value of .Sy TOOLDIR to .Ar tools . If a relative path is specified, it will be converted to an absolute path before being used. If set, the bootstrap .Dq make will only be rebuilt if the source files for .Xr make 1 have changed. . .It Fl U Set .Sy MKUNPRIVED=yes . . .It Fl u Set .Sy MKUPDATE=yes . . .It Xo .Fl V .Sm off .Ar var .Li = .Op Ar value .Sm on .Xc Set the environment variable .Ar var to an optional .Ar value . This is propagated to the .Sy \*[toolprefix]make wrapper. . .It Fl w Ar wrapper Create the .Sy \*[toolprefix]make wrapper script (see below) in a custom location, specified by .Ar wrapper . This allows, for instance, to place the wrapper in .Sy PATH automatically. Note that .Ar 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. . .It Fl X Ar x11src Set the value of .Sy X11SRCDIR to .Ar x11src . If a relative path is specified, it will be converted to an absolute path before being used. . .It Fl x Set .Sy MKX11=yes . . .It Fl Z Ar var Unset ("zap") the environment variable .Ar var . This is propagated to the .Sy \*[toolprefix]make wrapper. . .El . .Ss The \*q\*[toolprefix]make-MACHINE\*q wrapper script . If using the .Sy build.sh script to build .Nx , a .Sy \*[toolprefix]make-MACHINE script will be created in .Sy TOOLDIR/bin upon the first build to assist in building subtrees on a cross-compile host. .Pp .Sy \*[toolprefix]make-MACHINE can be invoked in lieu of .Xr make 1 , and will instead call the up-to-date version of .Dq \*[toolprefix]make installed into .Sy TOOLDIR/bin with several key variables pre-set, including .Sy MACHINE , MACHINE_ARCH , and .Sy TOOLDIR . .Sy \*[toolprefix]make-MACHINE will also set variables specified with .Fl V , and unset variables specified with .Fl Z . .Pp This script can be symlinked into a directory listed in .Sy PATH , or called with an absolute path. . .Sh EXAMPLES . .Bl -enum . .It .Li "% ./build.sh [options] tools kernel=GENERIC" .Pp Build a new toolchain, and use the new toolchain to configure and build a new GENERIC kernel. . .It .Li "% ./build.sh [options] -U distribution" .Pp Using unprivileged mode, build a complete distribution to a .Sy DESTDIR directory that .Sy build.sh selects (and will display). . .It .Li "# ./build.sh [options] -U install=/" .Pp As root, install to .Pa / the distribution that was built by example 2. Even though this is run as root, .Fl U is required so that the permissions stored in .Sy DESTDIR Ns Pa /METALOG are correctly applied to the files as they're copied to .Pa / . . .It .Li "% ./build.sh [options] -U -u release" .Pp Using unprivileged mode, build a complete release to .Sy DESTDIR and .Sy RELEASEDIR directories that .Sy build.sh selects (and will display). .Sy MKUPDATE=yes .Pq Fl u is set to prevent the .Dq make cleandir , so that if this is run after example 2, it doesn't need to redo that portion of the release build. .El . .Sh OBSOLETE VARIABLES . .Bl -tag -width "NBUILDJOBS" . .It Sy NBUILDJOBS Use the .Xr make 1 option .Fl j instead. . .It Sy USE_NEW_TOOLCHAIN The new toolchain is now the default. To disable, use .Sy TOOLCHAIN_MISSING=yes . .El .Sh SEE ALSO .Xr make 1 , .Xr hier 7 , .Xr release 7 , .Xr etcupdate 8 , .Xr postinstall 8 , .Xr sysinst 8 , .Pa pkgsrc/sysutils/cdrtools . .Sh HISTORY . The .Nm build.sh based build scheme was introduced for .Nx 1.6 as .Sy USE_NEW_TOOLCHAIN , and re-worked to .Sy TOOLCHAIN_MISSING after that. @ 1.59.4.1 log @Sync with wrstuden-revivesa-base-2. @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.59 2008/04/30 13:10:49 martin Exp $ d36 1 a36 1 .Dd August 18, 2008 a222 8 Typical usage is to set this variable to a value involving the use of .Sq ${.CURDIR:S...} or .Sq ${.CURDIR:C...} , to derive the value of .Sy .OBJDIR from the value of .Sy .CURDIR . d227 1 a227 1 can be provided only in the environment or via the d230 1 a230 2 .Nm build.sh ; it cannot usefully be set inside a Makefile. d242 1 a242 1 can be provided only in the environment or via the d245 1 a245 2 .Nm build.sh ; it cannot usefully be set inside a Makefile. a291 10 .It Sy 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. Additional information is available in the GCC documentation of -frandom-seed. . a373 6 .It Sy MKHTML .YorN Indicates whether preformatted HTML manual pages will be built and installed .DFLTy . a520 12 .Pp Mutually exclusive to .Sy MKXORG != no . .DFLTn . .It Sy MKXORG .YorN Indicates whether X11R7 (modular Xorg) is built from .Sy X11SRCDIR . .Pp Mutually exclusive to .Sy MKX11 != no . d737 2 d1013 1 a1013 1 .It Sy iso-image-source a1145 4 .It Sy cleandir Perform .Dq make cleandir . . d1324 3 a1326 6 If you see failures for reasons other than running out of memory while using .Sy build.sh with .Fl j , please save complete build logs a1327 6 .Pp To achieve the fastest builds, .Fl 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. a1333 9 For instance, if the source directory is .Pa /usr/src , a setting of .Dq Fl M Pa /usr/obj will place build-time files under .Pa /usr/obj/usr/src/bin , .Pa /usr/obj/usr/src/lib , .Pa /usr/obj/usr/src/usr.bin , and so forth. a1337 3 See .Dq Fl O obj for more information. d1401 2 d1404 1 a1404 1 .Dq Fl O Pa /usr/obj d1406 3 a1408 3 .Pa /usr/obj/bin , .Pa /usr/obj/lib , .Pa /usr/obj/usr.bin , a1409 2 If a relative path is specified, it will be converted to an absolute path before being used. d1412 1 a1412 19 .Pp In normal use, exactly one of the .Fl M or .Fl O options should be specified. If the source directory is .Pa /usr/src and neither .Fl M nor .Fl O is specified, then a default object directory will be chosen according to rules in .Aq bsd.obj.mk ; this default is usually either .Pa /usr/obj or .Pa /usr/obj. Ns Sy MACHINE . a1440 7 .It Fl S Ar seed Change the value of .Sy BUILDSEED to .Ar seed . This should rarely be necessary. . d1637 4 @ 1.59.4.2 log @Merge in changes between wrstuden-revivesa-base-2 and wrstuden-revivesa-base-3. @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.59.4.1 2008/09/18 04:40:18 wrstuden Exp $ d36 1 a36 1 .Dd September 10, 2008 a509 7 .It Sy MKSTRIPIDENT .YorN Indicates whether program binaries and shared libraries should be built to include RCS IDs for use with .Xr ident 1 . .DFLTn . @ 1.58 log @Correct/clarify the default setting of USETOOLS in the previous version. Noted by apb. @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.57 2008/03/28 05:23:44 dholland Exp $ a16 7 .\" 3. All advertising materials mentioning features or use of this software .\" must display the following acknowledgement: .\" This product includes software developed by the NetBSD .\" Foundation, Inc. and its contributors. .\" 4. Neither the name of The NetBSD Foundation nor the names of its .\" contributors may be used to endorse or promote products derived .\" from this software without specific prior written permission. @ 1.58.2.1 log @sync with head. @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.58 2008/03/29 05:22:42 dholland Exp $ d17 7 @ 1.57 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 @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.56 2008/03/18 04:24:38 lukem Exp $ d577 15 a591 1 .DFLTy @ 1.56 log @Consistently document RELEASEDIR/RELEASEMACHINEDIR. @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.55 2008/03/08 14:48:57 reed Exp $ d130 1 a130 1 .It Sy regress/ d133 7 d207 2 a208 1 Machine type. d211 2 a212 1 Machine architecture. d333 1 a333 1 mode d433 7 d577 1 a577 10 .DFLT .Dq yes if building all or part of a whole .Nx source tree (detected automatically); .Dq no otherwise (to preserve traditional semantics of the .Aq bsd.*.mk .Xr make 1 include files). d613 12 d636 6 d649 2 a650 1 instead (see below) d661 3 d689 1 a689 1 in that case. d708 1 a708 1 mode d743 2 a744 1 (This is set automatically when building from the top level.) d894 2 a895 2 .Sy INSTALLWORLDDIR (which defaults to the root directory). d908 1 a908 1 are installed (so most files in d910 1 a910 1 will not be installed or modified). d930 2 a931 2 .Dq make distribution (as d933 1 a933 1 does not install all of the required files). d945 2 a946 2 .Dq make distribution (as d948 1 a948 1 does not install all of the required files). d963 1 a963 1 .It iso-image d1053 4 a1056 1 Runs the compiled regression tests on the local host. d1105 1 a1105 1 This option implies the d1107 8 a1114 1 and d1116 1 a1116 1 operations. d1121 1 a1121 1 This option implies the d1128 1 a1128 1 This option implies the d1146 11 d1191 6 a1196 2 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 d1198 9 a1206 1 operation). d1211 1 a1211 1 copy of the kernel built by d1311 5 a1315 1 Passed through to d1412 3 a1414 2 .Dq yes (which is opposite to the default behaviour). d1443 1 a1443 1 will only be rebuilt as needed (when the source files for d1445 1 a1445 1 change). d1531 1 a1531 1 .Sy build.sh d1602 1 a1602 1 .Fl j , @ 1.55 log @Mention that "build" and "distribution" do not build nor install (to DESTDIR) a kernel. @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.54 2007/11/23 16:19:28 sborrill Exp $ d3 1 a3 1 .\" Copyright (c) 2001-2007 The NetBSD Foundation, Inc. d43 1 a43 1 .Dd March 8, 2008 d898 1 a898 1 .Sy RELEASEDIR/MACHINE Ns Pa /binary/sets . d913 1 a913 1 .Sy RELEASEDIR/MACHINE Ns Pa /binary/syspkgs . d960 1 a960 1 .Sy RELEASEDIR/MACHINE Ns Pa /installation/cdrom d1004 1 a1004 1 .Sy RELEASEDIR/MACHINE Ns Pa /installation/cdrom d1151 1 a1151 1 .Sy RELEASEDIR/MACHINE Ns Pa /binary/kernel , @ 1.54 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 @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.53 2007/09/01 09:32:19 jnemeth Exp $ d43 1 a43 1 .Dd September 1, 2007 d837 1 a837 1 system. d844 1 a844 1 and then install a full distribution into @ 1.54.4.1 log @sync with head. @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.56 2008/03/18 04:24:38 lukem Exp $ d3 1 a3 1 .\" Copyright (c) 2001-2008 The NetBSD Foundation, Inc. d43 1 a43 1 .Dd March 18, 2008 d837 1 a837 1 system (except the kernel). d844 1 a844 1 and then install a full distribution (which does not include a kernel) into d898 1 a898 1 .Sy RELEASEDIR/RELEASEMACHINEDIR Ns Pa /binary/sets . d913 1 a913 1 .Sy RELEASEDIR/RELEASEMACHINEDIR Ns Pa /binary/syspkgs . d960 1 a960 1 .Sy RELEASEDIR/RELEASEMACHINEDIR Ns Pa /installation/cdrom d1004 1 a1004 1 .Sy RELEASEDIR/RELEASEMACHINEDIR Ns Pa /installation/cdrom d1151 1 a1151 1 .Sy RELEASEDIR/RELEASEMACHINEDIR Ns Pa /binary/kernel , @ 1.53 log @Convert build.sh iso-dir=directory option to -C cddir as per jmmv@@ on source-changes. @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.52 2007/09/01 08:15:27 jnemeth Exp $ d1201 1 a1201 1 This will also append the build idenfitier to the name of the d1206 1 a1206 1 .It Fl C Ar cddir d1210 3 a1212 4 .Ar cddir . If a relative path is specified, it will be converted to an absolute path before being used. When combined with d1215 5 a1219 4 .Dq iso-image-source , it will cause the contents of .Ar cddir to be added to the CD-ROM image. @ 1.52 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 @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.51 2007/08/30 10:29:02 jnemeth Exp $ a1180 14 .It Sy iso-dir Ns = Ns Ar directory When combined with .Dq iso-image or .Dq iso-image-source , it will cause .Ar directory to be added to the CD-ROM image. If .Ar directory does not start with .Dq / then it will be made relative to RELEASEDIR. . d1206 15 @ 1.51 log @describe new iso-image-source target @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.50 2007/08/30 00:35:11 ad Exp $ d43 1 a43 1 .Dd August 30, 2007 d1177 18 @ 1.50 log @Remove STATUS paragraph which makes it sound like the build system is half baked. @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.49 2007/04/13 19:43:38 apb Exp $ d43 1 a43 1 .Dd April 13, 2007 d976 44 @ 1.49 log @Document recent changes to "make iso-image". @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.48 2007/03/26 17:35:06 apb Exp $ d3 1 a3 1 .\" Copyright (c) 2001-2004 The NetBSD Foundation, Inc. a53 21 .Sh 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. .Pp Discrepancies between this documentation and the current reality of implementation are noted specially, as with the note below: .Pp .Em Note : This document applies only to platforms which use the new toolchain as indicated by the default setting of .Sy TOOLCHAIN_MISSING in .Aq bsd.own.mk . Platforms which have not yet been switched to the new toolchain should continue building traditionally, using the notes specified in the file .Sy UPDATING . . @ 1.49.4.1 log @sync with HEAD @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.53 2007/09/01 09:32:19 jnemeth Exp $ d3 1 a3 1 .\" Copyright (c) 2001-2007 The NetBSD Foundation, Inc. d43 1 a43 1 .Dd September 1, 2007 d54 21 a996 44 .It iso-image-source Create a .Nx installation CD-ROM image in the .Sy RELEASEDIR Ns Pa /iso directory. The CD-ROM file system will have a layout as described in .Xr release 7 . It will have top level directories for the machine type and source. .Pp For most machine types, the CD-ROM will be bootable, and will automatically run the .Xr sysinst 8 menu-based installation program, which can be used to install or upgrade a .Nx system. Bootable CD-ROMs also contain tools that may be useful in repairing a damaged .Nx installation. .Pp Before .Dq make iso-image-source is attempted, RELEASEDIR must be populated by .Dq make sourcesets release or equivalent. .Pp Note that other, smaller, CD-ROM images may be created in the .Sy RELEASEDIR/MACHINE Ns Pa /installation/cdrom directory by .Dq make release . These smaller images usually contain the same tools as the larger images in .Sy RELEASEDIR Ns Pa /iso , but do not contain additional content such as the distribution sets. .Pp Note that the mac68k port still uses an older method of creating CD-ROM images. This requires the .Xr mkisofs 1 utility, which is not part of .Nx , but which can be installed from .Pa pkgsrc/sysutils/cdrtools . . a1153 4 .It Sy iso-image-source Perform .Dq make iso-image-source . . a1178 15 .It Fl C Ar cddir Set the value of .Sy CDEXTRA to .Ar cddir . If a relative path is specified, it will be converted to an absolute path before being used. When combined with .Dq iso-image or .Dq iso-image-source , it will cause the contents of .Ar cddir to be added to the CD-ROM image. . @ 1.49.4.2 log @sync with HEAD @ text @d1 1 a1 1 .\" $NetBSD$ d1201 1 a1201 1 This will also append the build identifier to the name of the d1206 1 a1206 1 .It Fl C Ar cdextras d1210 4 a1213 3 .Ar 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 d1216 4 a1219 5 .Dq 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.49.4.3 log @sync with HEAD @ text @d1 1 a1 1 .\" BUILDING.mdoc,v 1.49.4.2 2008/01/09 01:29:25 matt Exp d3 1 a3 1 .\" Copyright (c) 2001-2008 The NetBSD Foundation, Inc. d43 1 a43 1 .Dd March 18, 2008 d837 1 a837 1 system (except the kernel). d844 1 a844 1 and then install a full distribution (which does not include a kernel) into d898 1 a898 1 .Sy RELEASEDIR/RELEASEMACHINEDIR Ns Pa /binary/sets . d913 1 a913 1 .Sy RELEASEDIR/RELEASEMACHINEDIR Ns Pa /binary/syspkgs . d960 1 a960 1 .Sy RELEASEDIR/RELEASEMACHINEDIR Ns Pa /installation/cdrom d1004 1 a1004 1 .Sy RELEASEDIR/RELEASEMACHINEDIR Ns Pa /installation/cdrom d1151 1 a1151 1 .Sy RELEASEDIR/RELEASEMACHINEDIR Ns Pa /binary/kernel , @ 1.48 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 @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.47 2007/01/27 11:47:36 apb Exp $ d43 1 a43 1 .Dd March 27, 2007 d955 22 a976 3 Create a CD-ROM image in .Sy RELEASEDIR/MACHINE Ns Pa /installation/cdrom . RELEASEDIR must already have been populated by d979 11 d1506 1 @ 1.47 log @Try to clarify the description of build.sh -m mach. Document new evbarm-eb and evbarm-el aliases. @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.46 2006/10/08 17:54:30 apb Exp $ d43 1 a43 1 .Dd January 4, 2006 d891 12 d904 11 a914 3 It is highly recommended that you upgrade your kernel and reboot before performing this operation. . d1061 5 d1474 2 @ 1.46 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 @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.45 2006/10/04 22:28:24 apb Exp $ d1172 2 a1173 1 .Ar mach . d1180 1 a1180 3 is specified, or .Ar mach is a special case listed below. d1188 3 a1190 3 For a given value of .Ar mach , the following d1193 1 a1193 2 .Sy MACHINE_ARCH values will result: d1196 3 @ 1.46.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 @d1 1 a1 1 .\" $NetBSD$ d43 1 a43 1 .Dd March 27, 2007 a890 12 The .Sy INSTALLSETS environment variable may be set to a list of distribution sets to be installed. By default, all sets except .Dq etc and .Dq xetc are installed (so most files in .Sy INSTALLWORLDDIR Ns Pa /etc will not be installed or modified). .Pp d892 3 a894 11 Before performing this operation with .Sy INSTALLWORLDDIR Ns = Ns Pa / , it is highly recommended that you upgrade your kernel and reboot. After performing this operation, it is recommended that you use .Xr etcupdate 8 to update files in .Sy INSTALLWORLDDIR Ns Pa /etc and that you use .Xr postinstall 8 to check for inconsistencies (and possibly to fix them). a1040 5 Note that files that are part of the .Dq etc or .Dq xetc sets will not be installed. a1447 2 .Xr etcupdate 8 , .Xr postinstall 8 , @ 1.46.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 @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.46.2.1 2007/04/16 19:46:55 bouyer Exp $ d43 1 a43 1 .Dd April 13, 2007 d955 3 a957 22 Create a .Nx installation CD-ROM image in the .Sy RELEASEDIR Ns Pa /iso directory. The CD-ROM file system will have a layout as described in .Xr release 7 . .Pp For most machine types, the CD-ROM will be bootable, and will automatically run the .Xr sysinst 8 menu-based installation program, which can be used to install or upgrade a .Nx system. Bootable CD-ROMs also contain tools that may be useful in repairing a damaged .Nx installation. .Pp Before .Dq make iso-image is attempted, RELEASEDIR must be populated by a959 11 .Pp Note that other, smaller, CD-ROM images may be created in the .Sy RELEASEDIR/MACHINE Ns Pa /installation/cdrom directory by .Dq "make release" . These smaller images usually contain the same tools as the larger images in .Sy RELEASEDIR Ns Pa /iso , but do not contain additional content such as the distribution sets. .Pp Note that the mac68k port still uses an older method of creating CD-ROM images. a1474 1 .Xr sysinst 8 , @ 1.46.2.2.2.1 log @Catch up w/ last night's netbsd-4 @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.46.2.3 2007/09/29 11:10:56 xtraeme Exp $ d43 1 a43 1 .Dd September 1, 2007 a996 44 .It iso-image-source Create a .Nx installation CD-ROM image in the .Sy RELEASEDIR Ns Pa /iso directory. The CD-ROM file system will have a layout as described in .Xr release 7 . It will have top level directories for the machine type and source. .Pp For most machine types, the CD-ROM will be bootable, and will automatically run the .Xr sysinst 8 menu-based installation program, which can be used to install or upgrade a .Nx system. Bootable CD-ROMs also contain tools that may be useful in repairing a damaged .Nx installation. .Pp Before .Dq make iso-image-source is attempted, RELEASEDIR must be populated by .Dq make sourcesets release or equivalent. .Pp Note that other, smaller, CD-ROM images may be created in the .Sy RELEASEDIR/MACHINE Ns Pa /installation/cdrom directory by .Dq make release . These smaller images usually contain the same tools as the larger images in .Sy RELEASEDIR Ns Pa /iso , but do not contain additional content such as the distribution sets. .Pp Note that the mac68k port still uses an older method of creating CD-ROM images. This requires the .Xr mkisofs 1 utility, which is not part of .Nx , but which can be installed from .Pa pkgsrc/sysutils/cdrtools . . a1153 4 .It Sy iso-image-source Perform .Dq make iso-image-source . . a1178 15 .It Fl C Ar cddir Set the value of .Sy CDEXTRA to .Ar cddir . If a relative path is specified, it will be converted to an absolute path before being used. When combined with .Dq iso-image or .Dq iso-image-source , it will cause the contents of .Ar cddir to be added to the CD-ROM image. . @ 1.46.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 @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.46.2.2 2007/04/16 19:52:26 bouyer Exp $ d43 1 a43 1 .Dd September 1, 2007 a996 44 .It iso-image-source Create a .Nx installation CD-ROM image in the .Sy RELEASEDIR Ns Pa /iso directory. The CD-ROM file system will have a layout as described in .Xr release 7 . It will have top level directories for the machine type and source. .Pp For most machine types, the CD-ROM will be bootable, and will automatically run the .Xr sysinst 8 menu-based installation program, which can be used to install or upgrade a .Nx system. Bootable CD-ROMs also contain tools that may be useful in repairing a damaged .Nx installation. .Pp Before .Dq make iso-image-source is attempted, RELEASEDIR must be populated by .Dq make sourcesets release or equivalent. .Pp Note that other, smaller, CD-ROM images may be created in the .Sy RELEASEDIR/MACHINE Ns Pa /installation/cdrom directory by .Dq make release . These smaller images usually contain the same tools as the larger images in .Sy RELEASEDIR Ns Pa /iso , but do not contain additional content such as the distribution sets. .Pp Note that the mac68k port still uses an older method of creating CD-ROM images. This requires the .Xr mkisofs 1 utility, which is not part of .Nx , but which can be installed from .Pa pkgsrc/sysutils/cdrtools . . a1153 4 .It Sy iso-image-source Perform .Dq make iso-image-source . . a1178 15 .It Fl C Ar cddir Set the value of .Sy CDEXTRA to .Ar cddir . If a relative path is specified, it will be converted to an absolute path before being used. When combined with .Dq iso-image or .Dq iso-image-source , it will cause the contents of .Ar cddir to be added to the CD-ROM image. . @ 1.45 log @Nitpicking. You won't see a difference in the text output, but there is a difference in the postscript output. @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.44 2006/09/29 19:57:04 apb Exp $ d240 2 d253 1 d319 1 a319 1 This pathname should d323 2 a324 1 character (for installation into the system's root directory, set d326 2 a327 1 to an empty string). d537 1 d595 1 d616 1 d689 1 d1129 2 d1163 2 d1229 2 d1255 2 d1273 2 d1317 2 d1325 2 @ 1.44 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 @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.43 2006/01/29 14:03:59 apb Exp $ d208 4 a211 4 .Bd -literal -offset indent HOST_SH=/path/to/working/shell export HOST_SH ${HOST_SH} build.sh [options] @ 1.43 log @mkisofs is in pkgsrc/sysutils/cdrtools now, not pkgsrc/sysutils/cdrecord. Reported by Jukka Salmi. @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.42 2006/01/28 21:34:08 apb Exp $ d193 21 @ 1.42 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 @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.41 2006/01/12 21:22:30 wiz Exp $ d915 1 a915 1 .Pa pkgsrc/sysutils/cdrecord . d1404 1 a1404 1 .Pa pkgsrc/sysutils/cdrecord @ 1.41 log @Bump date for syspkgs. @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.40 2006/01/04 15:35:20 apb Exp $ d904 13 d1065 4 d1403 2 a1404 1 .Xr release 7 @ 1.40 log @Document "make syspkgs" and "build.sh syspkgs". Reviewed by agc @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.39 2005/06/20 13:25:23 peter Exp $ d43 1 a43 1 .Dd February 6, 2003 @ 1.39 log @Change all .Xr config 8 to .Xr config 1, following the recent move of config from usr.sbin -> usr.bin. Reviewed by wiz. @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.38 2005/02/15 18:41:18 reed Exp $ d880 11 d1048 4 @ 1.38 log @Document the environment variables for if you need to override or manually select your compilers. (And regen BUILDING from doc/BUILDING.mdoc.) @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.37 2004/10/12 04:07:09 jmc Exp $ d994 1 a994 1 .Xr config 8 . @ 1.37 log @Fix some typo's/bad wording as highlighted in PR#27219 @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.36 2004/06/25 15:04:02 wiz Exp $ d97 2 d192 7 @ 1.36 log @Document -h. From Karsten Kruse in PR 25974. While here, remove a duplicate sentence. @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.35 2004/03/19 12:34:40 wiz Exp $ d474 1 a474 1 the installed item; instead the information will be appended to d481 1 a481 1 is used during the generation of the distribution tar files to ensure d668 1 a668 1 This is only a summary of options available to d681 1 a681 1 Makefiles should use .WAIT or have explicit dependancies d850 1 a850 1 is the not root directory if cross compiling. @ 1.35 log @Document MKTTINTERP. @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.34 2004/02/06 23:22:44 lukem Exp $ a1030 2 The following command line options alter the behaviour of the above operations: d1074 3 @ 1.34 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 @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.33 2003/12/29 07:10:24 jmc Exp $ d461 9 @ 1.33 log @Note tools/compat/README as the place to get notes from non-native cross builds @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.32 2003/12/19 12:06:45 zuntum Exp $ d3 1 a3 1 .\" Copyright (c) 2001-2003 The NetBSD Foundation, Inc. d43 1 a43 1 .Dd December 19, 2003 a96 11 .Pp .Bd -ragged -offset indent .Em 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-compiling from systems other than .Nx is not currently supported. .Ed d164 4 d485 6 d548 7 a740 3 .Dq make distclean may be used as a synonym, for familiarity with a similar well-known convention. d757 4 d1227 10 @ 1.32 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 @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.31 2003/10/26 02:17:46 lukem Exp $ d118 2 @ 1.31 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 @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.30 2003/10/25 03:46:09 lukem Exp $ d43 1 a43 1 .Dd October 25, 2003 d686 1 a686 1 .It Fl v Ar var @ 1.30 log @Implement build -N noisy, which sets MAKEVERBOSE to noisy and adds `-s' to MAKEFLAGS for noisy < 2. @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.29 2003/09/29 07:55:17 lukem Exp $ d1118 4 a1121 13 level of the build Supported values of .Ar noiselevel are: .Bl -tag -width xxx .It 0 Quiet build. .It 1 Operations are described, command lines are suppressed. .It 2 Noisy build. This is the default. .El @ 1.29 log @provide a `%' for the non-root examples, as we show `#' for the root prompt. @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.28 2003/08/08 01:52:24 lukem Exp $ d43 1 a43 1 .Dd August 7, 2003 d325 16 d1113 17 @ 1.28 log @fix description of MAKEOBJDIR. from Martin Husemann @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.27 2003/07/29 10:07:16 lukem Exp $ d1242 1 a1242 1 .Li "./build.sh tools kernel=GENERIC" d1248 1 a1248 1 .Li "./build.sh -U distribution" d1272 1 a1272 1 .Li "./build.sh -U -u release" @ 1.27 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 @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.26 2003/07/18 16:30:48 lukem Exp $ d43 1 a43 1 .Dd July 29, 2003 d220 1 a220 1 .Fl M @ 1.26 log @fix default location of TOOLDIR @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.25 2003/07/18 08:38:45 lukem Exp $ d43 1 a43 1 .Dd July 18, 2003 d1055 2 d1114 3 a1116 1 .Sy /usr/obj/bin , /usr/obj/lib , d1118 2 d1173 1 a1173 1 Set the variable d1175 5 a1179 3 to .Ar value (which is optional). d1182 3 a1184 1 Create the \*[toolprefix]make wrapper script (see below) in a custom location, d1194 7 d1227 6 @ 1.25 log @Update for the MKUNPRIVED/MKUPDATE changes. @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.24 2003/07/18 01:55:08 lukem Exp $ d487 1 a487 1 .Pa src/tools . @ 1.24 log @fix warning found by new groff @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.23 2003/07/03 05:52:48 lukem Exp $ d43 1 a43 1 .Dd July 3, 2003 d450 3 a452 18 .It Sy TOOLDIR Directory to hold the host tools, once built. This directory should be unique to a given host system and .Nx source tree. (However, multiple targets may share the same .Sy TOOLDIR ; the target-dependent files have unique names.) If unset, a default based on the .Xr uname 1 information of the host platform will be created in the .Sy .OBJDIR of .Pa src/tools . .DFLTu . .It Sy UNPRIVED If set, then an unprivileged install will occur. d463 1 a463 1 .DFLTu d465 3 a467 2 .It Sy UPDATE If set, then all install operations intended to write to d472 16 d557 11 d609 1 a609 1 .Sy UPDATE a629 8 .It Sy UPDATE If set, then in addition to the effects described for UPDATE above, this implies the effects of .Sy NOCLEANDIR (i.e., .Dq make cleandir is avoided). . d1035 1 a1035 1 .Sy UNPRIVED d1152 2 a1153 3 Set the .Sy UNPRIVED variable. d1156 2 a1157 3 Set the .Sy UPDATE variable. d1259 1 a1259 1 .Sy UPDATE @ 1.23 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 @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.22 2003/05/25 12:34:28 lukem Exp $ d1080 1 a1080 1 .It Sy Ar mach Ta Sy "MACHINE" Ta Sy "MACHINE_ARCH" @ 1.22 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 @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.21 2003/05/18 11:18:02 lukem Exp $ d43 1 a43 1 .Dd May 25, 2003 d219 4 a222 1 can only be provided in the environment. d233 4 a236 1 can only be provided in the environment. @ 1.21 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 @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.20 2003/05/17 08:10:39 lukem Exp $ d43 1 a43 1 .Dd May 18, 2003 d925 9 d959 15 a973 7 .It Sy install Ns = Ns Ar idir Install the contents of .Sy DESTDIR to .Ar idir , using .Dq make installworld . @ 1.20 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 @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.19 2003/05/10 07:15:52 lukem Exp $ d43 1 a43 1 .Dd May 17, 2003 d547 1 a547 1 .DFLTy d1092 3 @ 1.19 log @crank date for previous @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.18 2003/05/10 07:12:39 lukem Exp $ d43 1 a43 1 .Dd May 10, 2003 d1039 3 a1041 1 is specified. d1046 22 @ 1.18 log @Add "sourcesets" argument/target, which builds source sets into RELEASEDIR/source/sets @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.17 2003/05/08 14:42:06 lukem Exp $ d43 1 a43 1 .Dd May 8, 2003 @ 1.17 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 @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.16 2003/02/08 10:00:34 lukem Exp $ d822 4 d961 5 @ 1.16 log @Fix example 3; the build.sh target is "install" not "installworld". Improve description. Noted by Valeriy Ushakov (uwe@@) in private email. @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.15 2003/02/02 12:37:42 lukem Exp $ d43 1 a43 1 .Dd February 8, 2003 d300 10 d600 10 d1163 1 a1163 1 .Li "./build.sh -U -D /path/to/destdir distribution" d1166 5 a1170 2 build a complete distribution in .Pa /path/to/destdir . d1173 1 a1173 1 .Li "# ./build.sh -U -D /path/to/destdir install=/" d1182 1 a1182 1 .Pa /path/to/destdir/METALOG d1187 1 a1187 1 .Li "./build.sh -U -u -D /path/to/destdir -R /path/to/releasedir release" d1190 7 a1196 2 build a complete release in .Pa /path/to/dir/releasedir . @ 1.15 log @attempt to further improve and clarify the examples... @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.14 2003/01/30 02:52:40 lukem Exp $ d43 1 a43 1 .Dd February 2, 2003 d1150 1 a1150 1 .Li "# ./build.sh -U -D /path/to/destdir installworld=/" d1152 4 a1155 5 As root, install the distribution that was built by example 2 into .Pa /path/to/destdir to .Pa / . @ 1.14 log @Prefix various paths with 'DESTDIR', to highlight that the DESTDIR is taken into account. @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.13 2003/01/29 22:50:10 lukem Exp $ d43 1 a43 1 .Dd January 30, 2003 d594 4 a597 1 .Sy NOCLEANDIR . d1134 1 a1134 1 .Bl -tag -width "build.sh" d1136 3 a1138 1 .It Li "./build.sh tools kernel=GENERIC" d1142 3 a1144 1 .It Li "./build.sh -U -D /path/to/destdir distribution" d1149 5 a1153 2 .It Li "# ./build.sh -U -D /path/to/destdir installworld=/" As root, install the distribution that was built with unprivileged mode from d1157 1 a1157 1 (Even though this is run as root, d1162 1 a1162 1 .Pa / ) . d1164 3 a1166 1 .It Li "./build.sh -U -D /path/to/destdir -R /path/to/releasedir release" d1170 6 @ 1.13 log @allow toolprefix to be easily changed @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.12 2003/01/26 13:15:17 lukem Exp $ d156 1 a156 1 .Sy /etc d327 1 a327 1 .Sy /usr/share/doc d361 1 a361 1 .Sy /usr/libdata/lint . d421 1 a421 1 .Sy /usr/share d710 3 a712 3 .Pa /dev , .Pa /etc , .Pa /root d714 1 a714 1 .Pa /var d761 3 a763 3 .Pa /dev , .Pa /etc , .Pa /root d765 1 a765 1 .Pa /var . d792 1 a792 1 .Sy RELEASEDIR Ns Pa /MACHINE/binary/sets . d1137 1 a1137 1 .It Li "./build.sh -U -D /path/to/DESTDIR distribution" d1140 1 a1140 1 .Pa /path/to/DESTDIR . d1142 1 a1142 1 .It Li "# ./build.sh -U -D /path/to/DESTDIR installworld=/" d1144 1 a1144 1 .Pa /path/to/DESTDIR d1150 1 a1150 1 .Pa /path/to/DESTDIR/METALOG d1154 1 a1154 1 .It Li "./build.sh -U -D /path/to/DESTDIR -R /path/to/RELEASE release" d1157 1 a1157 1 .Pa /path/to/dir/RELEASE . @ 1.12 log @Various improvements per discussion with Alan Barrett. @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.11 2003/01/26 06:19:14 lukem Exp $ a36 1 .\" ===== d40 4 a43 1 .Dd January 26, 2003 d886 1 a886 1 .Sy nbmake-MACHINE d959 1 a959 1 .Dq Sy nbmake-MACHINE-BUILDID . d1089 1 a1089 1 Create the nbmake wrapper script (see below) in a custom location, d1101 1 a1101 1 .Ss The \*qnbmake-MACHINE\*q wrapper script d1108 1 a1108 1 .Sy nbmake-MACHINE d1114 1 a1114 1 .Sy nbmake-MACHINE d1118 1 a1118 1 .Dq nbmake @ 1.11 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 @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.10 2003/01/26 05:34:32 lukem Exp $ d786 11 d800 4 a803 1 build kernels, distribution media, and install sets, and a814 11 .It Sy sets Create distribution sets from .Sy DESTDIR into .Sy RELEASEDIR Ns Pa /MACHINE/binary/sets . Should be run after .Dq make distribution (as .Dq make build does not install all of the required files). . a1133 1 This is a simpler way to achieve what the first three examples do. d1135 1 a1135 1 .It Li "./build.sh -U -D /some/DESTDIR distribution" d1138 1 a1138 1 .Pa /some/DESTDIR . d1140 1 a1140 1 .It Li "# ./build.sh -U -D /some/DESTDIR installworld=/" d1142 1 a1142 1 .Pa /some/DESTDIR d1148 1 a1148 1 .Pa /some/DESTDIR/METALOG d1152 1 a1152 1 .It Li "./build.sh -U -D /some/dir/DESTDIR -R /some/dir/RELEASE release" d1155 1 a1155 1 .Pa /some/dir/RELEASE . @ 1.10 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 @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.9 2003/01/23 16:24:08 lukem Exp $ d801 11 d889 1 d920 1 a920 1 .Dv DESTDIR d926 3 @ 1.9 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 @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.8 2003/01/04 12:55:33 lukem Exp $ d41 1 a41 1 .Dd January 24, 2003 d868 7 d950 2 a951 1 mode; d953 8 a960 1 does not have to be set to a non-root path for builds when this is set. a1066 3 This is useful for setting .Sy RELEASEDIR without actually building a release. d1110 1 a1112 11 .It Li "./build.sh tools" Build a new toolchain. . .It Li "cd ${KERNCONFDIR} ; ${TOOLDIR}/bin/nbconfig GENERIC" Use the new version of .Xr config 8 to prepare to build a new GENERIC kernel. . .It Li "cd ${KERNOBJDIR}/GENERIC ; ${TOOLDIR}/bin/nbmake-${MACHINE} dependall" Use the new toolchain to build a new GENERIC kernel. . d1118 1 a1118 1 .It Li "./build.sh -U distribution" d1121 1 a1121 1 .Sy DESTDIR . d1123 1 a1123 1 .It Li "# ./build.sh -U installworld=/" d1125 1 a1125 1 .Sy DESTDIR d1131 1 a1131 1 .Sy DESTDIR Ns Pa /METALOG d1135 1 a1135 1 .It Li "./build.sh -U -R /some/dir/RELEASE release" d1137 2 a1138 1 build a complete release in the specified release directory. @ 1.8 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 @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.7 2002/12/25 00:58:01 lukem Exp $ d3 1 a3 1 .\" Copyright (c) 2001, 2002 The NetBSD Foundation, Inc. d7 1 a7 1 .\" by Todd Vierling. d41 1 a41 1 .Dd January 4, 2003 d98 1 a98 1 A couple host toolchain components are not yet available in the tools d757 7 a763 1 .Sy DESTDIR . a771 1 . d788 2 a789 1 .Dq make build , d838 1 d840 1 a840 1 The following are available command line options that may be supplied to d843 73 a933 7 .It Fl b Bootstrap .Dq make and create a .Sy nbmake-MACHINE script (see below). . a939 15 .It Fl d Build a full distribution. This differs from a default build in that files will also be installed to .Pa /dev , .Pa /etc , .Pa /root and .Pa /var . Note this does not build a .Dq release ; no release sets are placed in ${RELEASEDIR}. .Fl d is implied by .Fl R . . a946 9 .It Fl i Ar installworlddir Install the contents of .Dv DESTDIR to .Ar installworlddir after all other operations have completed, using the top level .Dq installworld target. . a954 34 .It Fl k Em kernel Build a new kernel. The .Ar kernel argument is the name of a configuration file suitable for use by .Xr config 8 . If .Ar kernel does not contain any .Sq / characters, the configuration file is expected to be found in the .Sy KERNCONFDIR directory, which is typically .Sy sys/arch/MACHINE/conf . The new kernel will be built in a subdirectory of .Sy KERNOBJDIR , which is typically .Sy 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 .Fl t option) in a separate invocation of .Nm build.sh prior to using the .Fl k option, or that the .Fl t and .Fl k options be used together in a single invocation of .Nm build.sh . . a1006 6 Setting this option will cause .Sy build.sh to run .Dq make release instead of .Dq make build . a1028 7 .It Fl t Build and install the host tools from .Pa src/tools only. This option implies .Fl b . . d1099 2 a1100 1 .It Li "./build.sh -t" d1102 1 d1107 1 d1110 2 a1111 1 .It Li "./build.sh -t -k GENERIC" d1114 3 a1116 1 .It Li "./build.sh -U -d" d1120 14 a1133 1 .It Li "./build.sh -U -R /some/dir/RELEASE" @ 1.7 log @Document: * build.sh -i idir * top level targets: distribution, buildworld, installworld * top level variables: INSTALLWORLDDIR @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.6 2002/12/18 19:46:48 wiz Exp $ d41 1 a41 1 .Dd December 25, 2002 d1036 17 @ 1.6 log @New sentence, new line; use Pa for paths. @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.5 2002/12/08 22:14:02 lukem Exp $ d41 1 a41 1 .Dd December 8, 2002 d520 8 a527 1 .Bl -tag -width "NODISTRIBDIRS" d744 1 a744 1 .Bl -tag -width "dependall" d753 28 d888 9 @ 1.5 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 @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.4 2002/12/08 08:42:52 lukem Exp $ d54 2 a55 1 This document is a work-in-progress. As such, the information described d88 2 a89 1 architecture. The host system must have at least C and C++ d99 4 a102 3 directory. Also, some tools use non-POSIX, non-ANSI C extensions and need to be standardized. As a result, cross-compiling from systems other than d135 2 a136 2 system from scratch. Can be used for both native and cross builds, and should be used instead of d141 2 a142 1 existing build structure. Other source trees in d157 2 a158 1 Regression test harness. Can be cross-compiled, but only run natively. d164 2 a165 2 build structure for the host build tools. This has a special method of determining out-of-date status. d169 2 a170 2 userland (non-kernel) programs. If any of these directories are missing, they will be skipped during the build. d258 2 a259 1 builds. Unless otherwise specified, these variables may be set in d268 2 a269 1 Identifier for the build. The identifier will be appended to d278 2 a279 1 system. If set, special options are passed to the compilation tools to d282 2 a283 1 and so forth. This pathname should d317 2 a318 2 cryptography. Will not affect use of the standard low-security password encryption system, d385 2 a386 1 installed during a build. If set to d390 2 a391 1 Platform dependent. As of this writing, all platforms except d420 2 a421 1 will be built and installed during a build. If set to d433 2 a434 2 Directory to hold the host tools, once built. This directory should be unique to a given host system and d436 2 a437 1 source tree. (However, multiple targets may share the same d445 1 a445 1 .Sy src/tools . d466 2 a467 2 phase if the destination files are up-to-date. This also has implications on full builds (see next subsection). d473 2 a474 1 should be used as part of a build in progress. Must be set to d489 2 a490 2 even when building native tool components. This is similar to the traditional d495 2 a496 2 to build the tree successfully. This may cause build or runtime problems when building the whole d531 2 a532 1 Now obsolete. Use the d542 4 a545 3 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. d551 2 a552 1 phase of a full build. This skips running d563 2 a564 1 phase of a full build. This has the effect of preventing d567 2 a568 2 system include files have changed. However, this option should not be used when updating the entire d614 2 a615 1 files. When building any full d619 2 a620 2 directory in the source tree. (This is set automatically when building from the top level.) d624 2 a625 1 actually execute them. This will still cause recursion to take place. d651 2 a652 1 source code. It is recommended that none of these be used from the top d682 2 a683 2 code on header files. Allows programs to be recompiled automatically when a dependency changes. d694 2 a695 2 Build and install system header files. Typically needed before any system libraries or programs can be built. d742 2 a743 1 system. This orders portions of the source tree such that prerequisites d769 2 a770 2 including many that are not POSIX compliant. Note that if a host system's d793 2 a794 2 process. In the list of options below, variables that are automatically set by d913 2 a914 1 is specified. All cross builds require d922 2 a923 1 but do not make any changes. This is similar in concept to d960 2 a961 1 before building (provides a clean starting point). This will skip deleting d978 3 a980 2 .Sy src/tools only. This option implies d999 2 a1000 1 automatically. Note that @ 1.4 log @- be consistent about option ordering in build.sh usage display - use Fl and Ar instead of Sy and Em to format options @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.3 2002/11/25 19:18:45 wiz Exp $ d824 7 @ 1.3 log @Update location of BUILDING.mdoc. @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.2 2002/10/20 15:48:02 lukem Exp $ d41 1 a41 1 .Dd October 21, 2002 d520 1 a520 1 .Sy -j , d582 1 a582 1 .It Sy -j Em njob d584 1 a584 1 .Em njob d592 1 a592 1 .It Sy -m Em dir d603 1 a603 1 .It Sy -n d607 1 a607 1 .It Sy -v Em var d611 1 a611 1 .Em var . d781 1 a781 1 .It Sy -a Em arch d785 1 a785 1 .Em arch . d787 1 a787 1 .It Sy -B Em buildid d791 1 a791 1 .Em buildid . d797 1 a797 1 .It Sy -b d804 7 a810 1 .It Sy -d d821 1 a821 1 .Sy -d d823 1 a823 1 .Sy -R . d825 1 a825 1 .It Sy -j Em njob d833 1 a833 1 .It Sy -k Em kernel d836 1 a836 1 .Em kernel d841 1 a841 1 .Em kernel d855 1 a855 1 .Sy -t d859 1 a859 1 .Sy -k d861 1 a861 1 .Sy -t d863 1 a863 1 .Sy -k d867 7 a873 1 .It Sy -m Em mach d877 1 a877 1 .Em mach . d881 1 a881 1 .Em mach , d883 1 a883 1 .Sy -a d885 1 a885 1 .Sy -m , d889 1 a889 1 .It Sy -n d895 1 a895 49 .It Sy -o Set the value of .Sy MKOBJDIRS to .Dq no . . .It Sy -r Remove the contents of .Sy DESTDIR and .Sy TOOLDIR before building (provides a clean starting point). This will skip deleting .Sy DESTDIR if building on a native system to the root directory. . .It Sy -t Build and install the host tools from .Sy src/tools only. This option implies .Sy -b . . .It Sy -u Set the .Sy UPDATE variable. . .It Sy -w Em wrapper Create the nbmake wrapper script (see below) in a custom location, specified by .Em wrapper . This allows, for instance, to place the wrapper in .Sy PATH automatically. Note that .Em wrapper is the full name of the file, not just a directory name. . .It Sy -D Em dest Set the value of .Sy DESTDIR to .Em dest . . .It Sy -M Em obj Set .Sy MAKEOBJDIRPREFIX to .Em obj . . .It Sy -O Em obj d899 1 a899 1 .Em obj . d906 7 a912 1 .It Sy -R Em rel d916 1 a916 1 .Em rel . d924 10 a933 1 .It Sy -T Em tools d937 1 a937 1 .Em tools . d944 7 a950 1 .It Sy -U d955 15 d1030 1 a1030 1 .Sy -j , @ 1.2 log @- Add support for ./build.sh -k kern, which configures and builds the named kernel using the $TOOLDIR toolchain. If kern doesn't contain `/', it will be searched for in ${KERNCONFDIR} (typically, sys/arch/${MACHINE}/conf). - Improve ./build.sh usage. - Add some examples to the documentation. This is heavily based on [toolchain/18739] from Alan Barrett , with improvements by me. @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.1 2002/09/21 08:19:29 lukem Exp $ d109 1 a109 1 .It Sy BUILDING.mdoc @ 1.1 log @move BUILDING.mdoc -> doc/BUILDING.mdoc @ text @d1 1 a1 1 .\" $NetBSD: BUILDING.mdoc,v 1.21 2002/09/21 05:17:52 lukem Exp $ d41 1 a41 1 .Dd September 21, 2002 d827 34 d999 22 @