Annotation of src/UPDATING, Revision 1.2
1.2 ! mrg 1: $NetBSD: UPDATING,v 1.1 2000/08/17 20:17:43 abs Exp $
1.1 abs 2:
3: This file is intended to be a brief introduction to the build
4: process and a reference on what to do if something doesn't work.
5:
6: For a more detailed description see Makefile.
7:
8: Recent changes:
9: ^^^^^^^^^^^^^^^
10:
11: 20000623:
12: MKCRYPTO and friends added to share/mk/bsd.own.mk.
13: 'cd share/mk ; make install' needed before make build.
14:
15:
16: Hints for a more successful build:
17: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1.2 ! mrg 18: Build a new kernel first:
! 19: This makes sure that any new system calls or features
! 20: expected by the new userland will be present. This
! 21: helps to avoid critical errors when upgrading.
1.1 abs 22: Use object directories:
23: This helps to keep stale object
24: files from polluting the build if a Makefile "forgets"
25: about one. It also makes it easier to clean up after
26: a build. It's also necessary if you want to use the
27: same source tree for multiple machines.
28: To use object directories:
29: a) cd /usr/src ; make cleandir
1.2 ! mrg 30: b) Add "OBJMACHINE=yes" to /etc/mk.conf
! 31: c) Add "MKOBJDIRS=yes" to /etc/mk.conf
1.1 abs 32: d) cd /usr/src ; make build
1.2 ! mrg 33: Note that running "make obj" in a directory will create
! 34: in obj.$MACHINE directory.
1.1 abs 35: Build to a DESTDIR:
36: This helps to keep old
37: installed files (especially libraries) from interfering
38: with the new build.
39: To build to a DESTDIR, set the DESTDIR environment
1.2 ! mrg 40: variable before running make build. It should be set to
! 41: the pathname of an initially empty directory.
1.1 abs 42: Problems: you might need to update critical utilities
43: without using DESTDIR since nothing is executed
44: from what is installed in DESTDIR.
45: (See critical utils, below)
46: Build often:
47: This keeps critical utilities current enough to not choke
48: on any other part of the source tree that depends on up to
49: date functionality.
50:
51: What to do if things don't work:
52: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
53: When things don't work there is usually a few things that commonly
54: should be done.
55: 1) make includes
56: This should be done automatically by make build.
57: 2) cd share/mk && make install
58: Again, automatically done by make build.
59:
60: Failsafe rebuild of a small part of the tree:
61: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
62: To make sure you rebuild something correctly you want to do
63: something like the following:
64: 1) Make sure the includes and .mk files are up to date.
65: 2) Make sure any program used to build the particular
66: utility is up to date. (yacc, lex, etc...)
67: 3) cd ...path/to/util...
68: make cleandir
69: rm ...all obj directories...
70: make cleandir # yes, again
71: make obj
72: make depend && make
73:
74: Failsafe rebuild of the entire tree:
75: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
76: If you really want to make sure the source tree is clean and
1.2 ! mrg 77: ready for a build try the following. Note that sourcing /etc/mk.conf
! 78: (a make(1) Makefile) in this manner is not right, and will not work
! 79: for anyone who uses any make(1) features in /etc/mk.conf.
1.1 abs 80:
81: ---cut here---
82: #!/bin/sh
83: . /etc/mk.conf
84:
85: if [ -z $BSDSRCDIR ] ; then
86: BSDSRCDIR=/usr/src
87: fi
88: if [ \! -d $BSDSRCDIR ] ; then
89: echo Unable to find sources
90: exit 1
91: fi
92: find $BSDSRCDIR -name \*.o -o -name obj.\* -o -name obj -exec rm \{\} \;
93:
94: if [ -z $BSDOBJDIR ] ; then
95: BSDOBJDIR=/usr/obj
96: fi
97: if [ -d $BSDOBJDIR ] ; then
98: rm -rf $BSDOBJDIR
99: fi
100:
101: cd $BSDSRCDIR && make cleandir
102:
103: ---cut here---
104:
105: Critical utilities:
106: ^^^^^^^^^^^^^^^^^^^
107: gnu/usr.bin/egcs
108: usr.bin/make
109: usr.bin/yacc
110: usr.bin/lex
1.2 ! mrg 111: usr.sbin/config
1.1 abs 112: crypto-*/usr.bin/compile_et
113: crypto-*/usr.bin/make_cmds
114:
115: Other problems and possibly solutions:
116: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
117: Symptom:Unreasonable compiler errors.
118: Fix: Rebuild gnu/usr.bin/egcs
119:
120: Symptom:Complaints involving a Makefile.
121: Fix: Make sure .mk files are up to date.
122: cd share/mk && make install
123: Fix: Rebuild usr.bin/make
1.2 ! mrg 124:
! 125: Symptom:Kernel `config' fails to configure any kernel, including GENERIC.
! 126: Fix: Rebuild usr.sbin/config
1.1 abs 127:
128: Symptom:
129: Fix: Rebuild usr.bin/yacc
130:
131: Symptom:
132: Fix: Rebuild usr.bin/lex
133:
134: Symptom:
135: Fix: rm /usr/lib/libbfd.a
CVSweb <webmaster@jp.NetBSD.org>