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