UPDATING revision 1.1
11.1Sabs$NetBSD: UPDATING,v 1.1 2000/08/17 20:17:43 abs Exp $
21.1Sabs
31.1SabsThis file is intended to be a brief introduction to the build
41.1Sabsprocess and a reference on what to do if something doesn't work.
51.1Sabs
61.1SabsFor a more detailed description see Makefile.
71.1Sabs
81.1SabsRecent changes:
91.1Sabs^^^^^^^^^^^^^^^
101.1Sabs
111.1Sabs20000623:
121.1Sabs	MKCRYPTO and friends added to share/mk/bsd.own.mk.
131.1Sabs	'cd share/mk ; make install' needed before make build.
141.1Sabs
151.1Sabs
161.1SabsHints for a more successful build:
171.1Sabs^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
181.1Sabs    Use object directories:
191.1Sabs	This helps to keep stale object
201.1Sabs	   files from polluting the build if a Makefile "forgets"
211.1Sabs	   about one.  It also makes it easier to clean up after
221.1Sabs	   a build.  It's also necessary if you want to use the
231.1Sabs	   same source tree for multiple machines.
241.1Sabs	   To use object directories:
251.1Sabs	    a) cd /usr/src ; make cleandir
261.1Sabs	    b) Add "OBJMACHINE=obj.<arch>" to /etc/mk.conf
271.1Sabs	    c) cd /usr/src ; make obj
281.1Sabs	    d) cd /usr/src ; make build
291.1Sabs    Build to a DESTDIR:
301.1Sabs	This helps to keep old
311.1Sabs	   installed files (especially libraries) from interfering
321.1Sabs	   with the new build.
331.1Sabs	   To build to a DESTDIR, set the DESTDIR environment
341.1Sabs	   variable before running make build.
351.1Sabs	   Problems: you might need to update critical utilities
361.1Sabs		without using DESTDIR since nothing is executed
371.1Sabs		from what is installed in DESTDIR.
381.1Sabs		(See critical utils, below)
391.1Sabs    Build often:
401.1Sabs	This keeps critical utilities current enough to not choke
411.1Sabs	on any other part of the source tree that depends on up to
421.1Sabs	date functionality.
431.1Sabs 
441.1SabsWhat to do if things don't work:
451.1Sabs^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
461.1SabsWhen things don't work there is usually a few things that commonly
471.1Sabsshould be done.
481.1Sabs    1)	make includes
491.1Sabs	This should be done automatically by make build.
501.1Sabs    2)  cd share/mk && make install
511.1Sabs	Again, automatically done by make build.
521.1Sabs
531.1SabsFailsafe rebuild of a small part of the tree:
541.1Sabs^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
551.1SabsTo make sure you rebuild something correctly you want to do
561.1Sabssomething like the following:
571.1Sabs    1)  Make sure the includes and .mk files are up to date.
581.1Sabs    2)  Make sure any program used to build the particular
591.1Sabs	utility is up to date.  (yacc, lex, etc...)
601.1Sabs    3)  cd ...path/to/util...
611.1Sabs	make cleandir
621.1Sabs	rm ...all obj directories...
631.1Sabs	make cleandir			# yes, again
641.1Sabs	make obj
651.1Sabs	make depend && make
661.1Sabs
671.1SabsFailsafe rebuild of the entire tree:
681.1Sabs^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
691.1SabsIf you really want to make sure the source tree is clean and
701.1Sabsready for a build try the following:
711.1Sabs
721.1Sabs---cut here---
731.1Sabs#!/bin/sh
741.1Sabs. /etc/mk.conf
751.1Sabs
761.1Sabsif [ -z $BSDSRCDIR ] ; then
771.1Sabs    BSDSRCDIR=/usr/src
781.1Sabsfi
791.1Sabsif [ \! -d $BSDSRCDIR ] ; then
801.1Sabs    echo Unable to find sources
811.1Sabs    exit 1
821.1Sabsfi
831.1Sabsfind $BSDSRCDIR -name \*.o -o -name obj.\* -o -name obj -exec rm \{\} \;
841.1Sabs
851.1Sabsif [ -z $BSDOBJDIR ] ; then
861.1Sabs    BSDOBJDIR=/usr/obj
871.1Sabsfi
881.1Sabsif [ -d $BSDOBJDIR ] ; then
891.1Sabs    rm -rf $BSDOBJDIR
901.1Sabsfi
911.1Sabs
921.1Sabscd $BSDSRCDIR && make cleandir
931.1Sabs
941.1Sabs---cut here---
951.1Sabs
961.1SabsCritical utilities:
971.1Sabs^^^^^^^^^^^^^^^^^^^
981.1Sabs	gnu/usr.bin/egcs
991.1Sabs	usr.bin/make
1001.1Sabs	usr.bin/yacc
1011.1Sabs	usr.bin/lex
1021.1Sabs	crypto-*/usr.bin/compile_et
1031.1Sabs	crypto-*/usr.bin/make_cmds
1041.1Sabs
1051.1SabsOther problems and possibly solutions:
1061.1Sabs^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1071.1SabsSymptom:Unreasonable compiler errors.
1081.1SabsFix:	Rebuild gnu/usr.bin/egcs
1091.1Sabs
1101.1SabsSymptom:Complaints involving a Makefile.
1111.1SabsFix:	Make sure .mk files are up to date.
1121.1Sabs	cd share/mk && make install
1131.1SabsFix:	Rebuild usr.bin/make
1141.1Sabs
1151.1SabsSymptom:
1161.1SabsFix:	Rebuild usr.bin/yacc
1171.1Sabs
1181.1SabsSymptom:
1191.1SabsFix:	Rebuild usr.bin/lex
1201.1Sabs
1211.1SabsSymptom:
1221.1SabsFix:	rm /usr/lib/libbfd.a
123