UPDATING revision 1.10 1 $NetBSD: UPDATING,v 1.10 2001/01/15 15:03:38 christos Exp $
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 20010114:
12 introduce .if commands(target) in make(1). You need to
13 bring everything up-to-date first, then without installing
14 anything make and install in /usr/bin/make, then proceed
15 with make build.
16
17 20010101:
18 bsd.subdir.mk committed 20001230 had a bug which caused
19 afterinstall targets to run too soon; update again.
20
21 20001230:
22 New share/mk files needed to support .WAIT in SUBDIR variables.
23 If you get make errors,
24 (cd share/mk; make install)
25 Also, PRINTOBJDIR has changed and is now used more heavily.
26
27 20001019:
28 The `ca' device driver has been replaced by `ld'; although the
29 major and minor numbers haven't changed, you should update your /dev
30 directory.
31
32 20000929:
33 The following make directives are obsoleted.
34 MKCRYPTO_RSA NOCRYPTO_RSA NOCRYPTO_RC5 NOCRYPTO_IDEA
35 By default, RSA is built into libcrypto. IDEA and RC5 will not be
36 bulit into libcrypto. By using MKCRYPTO_{RC5,IDEA}, you can build
37 additional library libcrypto_{idea,rc5}.
38
39 20000623:
40 MKCRYPTO and friends added to share/mk/bsd.own.mk.
41 'cd share/mk ; make install' needed before make build.
42
43
44 Hints for a more successful build:
45 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
46 Build a new kernel first:
47 This makes sure that any new system calls or features
48 expected by the new userland will be present. This
49 helps to avoid critical errors when upgrading.
50 Use object directories:
51 This helps to keep stale object
52 files from polluting the build if a Makefile "forgets"
53 about one. It also makes it easier to clean up after
54 a build. It's also necessary if you want to use the
55 same source tree for multiple machines.
56 To use object directories:
57 a) cd /usr/src ; make cleandir
58 b) Add "OBJMACHINE=yes" to /etc/mk.conf
59 c) Add "MKOBJDIRS=yes" to /etc/mk.conf
60 d) cd /usr/src ; make build
61 Note that running "make obj" in a directory will create
62 in obj.$MACHINE directory.
63 Build to a DESTDIR:
64 This helps to keep old
65 installed files (especially libraries) from interfering
66 with the new build.
67 To build to a DESTDIR, set the DESTDIR environment
68 variable before running make build. It should be set to
69 the pathname of an initially empty directory.
70 Problems: you might need to update critical utilities
71 without using DESTDIR since nothing is executed
72 from what is installed in DESTDIR.
73 (See critical utils, below)
74 Build often:
75 This keeps critical utilities current enough to not choke
76 on any other part of the source tree that depends on up to
77 date functionality.
78
79 What to do if things don't work:
80 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
81 When things don't work there is usually a few things that commonly
82 should be done.
83 1) make includes
84 This should be done automatically by make build.
85 2) cd share/mk && make install
86 Again, automatically done by make build.
87
88 Failsafe rebuild of a small part of the tree:
89 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
90 To make sure you rebuild something correctly you want to do
91 something like the following:
92 1) Make sure the includes and .mk files are up to date.
93 2) Make sure any program used to build the particular
94 utility is up to date. (yacc, lex, etc...)
95 3) cd ...path/to/util...
96 make cleandir
97 rm ...all obj directories...
98 make cleandir # yes, again
99 make obj
100 make depend && make
101
102 Failsafe rebuild of the entire tree:
103 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
104 If you really want to make sure the source tree is clean and
105 ready for a build try the following. Note that sourcing /etc/mk.conf
106 (a make(1) Makefile) in this manner is not right, and will not work
107 for anyone who uses any make(1) features in /etc/mk.conf.
108
109 ---cut here---
110 #!/bin/sh
111 . /etc/mk.conf
112
113 if [ -z $BSDSRCDIR ] ; then
114 BSDSRCDIR=/usr/src
115 fi
116 if [ \! -d $BSDSRCDIR ] ; then
117 echo Unable to find sources
118 exit 1
119 fi
120 find $BSDSRCDIR -name \*.o -o -name obj.\* -o -name obj -exec rm \{\} \;
121
122 if [ -z $BSDOBJDIR ] ; then
123 BSDOBJDIR=/usr/obj
124 fi
125 if [ -d $BSDOBJDIR ] ; then
126 rm -rf $BSDOBJDIR
127 fi
128
129 cd $BSDSRCDIR && make cleandir
130
131 ---cut here---
132
133 Critical utilities:
134 ^^^^^^^^^^^^^^^^^^^
135 gnu/usr.bin/egcs
136 usr.bin/compile_et
137 usr.bin/make
138 usr.bin/yacc
139 usr.bin/lex
140 usr.sbin/config
141
142 Other problems and possibly solutions:
143 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
144 Symptom:Unreasonable compiler errors.
145 Fix: Rebuild gnu/usr.bin/egcs
146
147 Symptom:Complaints involving a Makefile.
148 Fix: Make sure .mk files are up to date.
149 cd share/mk && make install
150 Fix: Rebuild usr.bin/make
151
152 Symptom:Kernel `config' fails to configure any kernel, including GENERIC.
153 Fix: Rebuild usr.sbin/config
154
155 Symptom:
156 Fix: Rebuild usr.bin/yacc
157
158 Symptom:
159 Fix: Rebuild usr.bin/lex
160
161 Symptom:
162 Fix: rm /usr/lib/libbfd.a
163
164 Symptom:Obsolete intermediate files are used during compilation
165 Fix: Try the following sequence of commands in the directory in question.
166 make cleandir; rm `make print-objdir`; make cleandir; make obj
167 (If you built the tree without "make obj" in the past, obsolete files
168 may remain. The command tries to clean everything up)
169
170 Symptom:.../sysinst/run.c:xx: warning: initialization from incompatible pointer type
171 Fix: Rebuild and install usr.bin/menuc
172