Index: Makefile
===================================================================
--- Makefile	(revision 05e2a7ad64a4c5a40748a558c64ca76a66934a0c)
+++ Makefile	(revision 839470fe57530d3817745bc3323d249dae216918)
@@ -40,5 +40,5 @@
 #
 
-include Makefile.config
+-include Makefile.config
 
 ## Common compiler flags
@@ -57,6 +57,6 @@
 #
 
-include arch/$(ARCH)/Makefile.inc
-include genarch/Makefile.inc
+-include arch/$(ARCH)/Makefile.inc
+-include genarch/Makefile.inc
 
 ifeq ($(CONFIG_DEBUG),y)
@@ -139,20 +139,33 @@
 GENARCH_OBJECTS := $(addsuffix .o,$(basename $(GENARCH_SOURCES)))
 
-.PHONY: all clean config depend boot
-
-all: kernel.bin boot disasm
+.PHONY: all clean config links depend boot
+
+all:
+	tools/config.py default
+	$(MAKE) -C . real_all
+
+real_all: kernel.bin boot disasm
+
+config:
+	tools/config.py
 
 -include Makefile.depend
+
+distclean: clean
+	-rm Makefile.config
 
 clean:
 	-rm -f kernel.bin kernel.raw kernel.map kernel.map.pre kernel.objdump kernel.disasm generic/src/debug/real_map.bin Makefile.depend generic/include/arch generic/include/genarch arch/$(ARCH)/_link.ld
-	find generic/src/ arch/$(ARCH)/src/ genarch/src/ test/ -name '*.o' -follow -exec rm \{\} \;
-	$(MAKE) -C arch/$(ARCH)/boot clean
-
-config:
+	find generic/src/ arch/*/src/ genarch/src/ test/ -name '*.o' -follow -exec rm \{\} \;
+	for arch in arch/*; do \
+	    [ -e $$arch/_link.ld ] && rm $$arch/_link.ld 2>/dev/null;\
+	    $(MAKE) -C $$arch/boot clean; \
+	done;exit 0
+
+archlinks:
 	ln -sfn ../../arch/$(ARCH)/include/ generic/include/arch
 	ln -sfn ../../genarch/include/ generic/include/genarch
 
-depend: config
+depend: archlinks
 	$(CC) $(DEFS) $(CFLAGS) -M $(ARCH_SOURCES) $(GENARCH_SOURCES) $(GENERIC_SOURCES) > Makefile.depend
 
Index: ild
===================================================================
--- build	(revision 05e2a7ad64a4c5a40748a558c64ca76a66934a0c)
+++ 	(revision )
@@ -1,1 +1,0 @@
-tools/build
Index: ean
===================================================================
--- clean	(revision 05e2a7ad64a4c5a40748a558c64ca76a66934a0c)
+++ 	(revision )
@@ -1,1 +1,0 @@
-tools/clean
Index: ean.amd64
===================================================================
--- clean.amd64	(revision 05e2a7ad64a4c5a40748a558c64ca76a66934a0c)
+++ 	(revision )
@@ -1,1 +1,0 @@
-tools/clean
Index: ean.ia32
===================================================================
--- clean.ia32	(revision 05e2a7ad64a4c5a40748a558c64ca76a66934a0c)
+++ 	(revision )
@@ -1,1 +1,0 @@
-tools/clean
Index: ean.ia64
===================================================================
--- clean.ia64	(revision 05e2a7ad64a4c5a40748a558c64ca76a66934a0c)
+++ 	(revision )
@@ -1,1 +1,0 @@
-tools/clean
Index: ean.mips32
===================================================================
--- clean.mips32	(revision 05e2a7ad64a4c5a40748a558c64ca76a66934a0c)
+++ 	(revision )
@@ -1,1 +1,0 @@
-tools/clean
Index: ean.ppc32
===================================================================
--- clean.ppc32	(revision 05e2a7ad64a4c5a40748a558c64ca76a66934a0c)
+++ 	(revision )
@@ -1,1 +1,0 @@
-tools/clean
Index: ean.sparc64
===================================================================
--- clean.sparc64	(revision 05e2a7ad64a4c5a40748a558c64ca76a66934a0c)
+++ 	(revision )
@@ -1,1 +1,0 @@
-tools/clean
Index: nfigure
===================================================================
--- configure	(revision 05e2a7ad64a4c5a40748a558c64ca76a66934a0c)
+++ 	(revision )
@@ -1,1 +1,0 @@
-tools/config.py
Index: doc/build
===================================================================
--- doc/build	(revision 839470fe57530d3817745bc3323d249dae216918)
+++ doc/build	(revision 839470fe57530d3817745bc3323d249dae216918)
@@ -0,0 +1,14 @@
+Following make targets are supported:
+
+make, make all
+	- Check configuration, build
+
+make config
+	- Start kernel configuration program
+
+make clean
+	- Clean build temporary files
+
+make distclean
+	- Clean everything including configuration
+
Index: ols/build
===================================================================
--- tools/build	(revision 05e2a7ad64a4c5a40748a558c64ca76a66934a0c)
+++ 	(revision )
@@ -1,29 +1,0 @@
-#! /bin/sh
-
-function syntax {
-	echo "Syntax:"
-	echo " build "
-	echo
-}
-
-ARGS=""
-while [ "$#" -gt 0 ]; do
-	case "$1" in
-		*)
-			syntax
-			exit 1
-			;;
-	esac
-	shift
-done
-
-TAG="`svnversion . 2> /dev/null`"
-TIMESTAMP="`date "+%Y-%m-%d %H:%M:%S" 2> /dev/null`"
-if [ -z "$TAG" ] || [ "$TAG" == "exported" ]; then
-	TAG="Built on $TIMESTAMP for $ARCH"
-else
-	TAG="Revision $TAG (built on $TIMESTAMP for $ARCH)"
-fi
-
-tools/config.py default
-make all "TAG=$TAG" $ARGS
Index: ols/clean
===================================================================
--- tools/clean	(revision 05e2a7ad64a4c5a40748a558c64ca76a66934a0c)
+++ 	(revision )
@@ -1,13 +1,0 @@
-#! /bin/sh
-
-# Without Makefile.config the makefile does not work...
-touch Makefile.config
-
-ARCH="`basename "$0" | awk -F. '{ if (NF > 1) print \$NF }'`"
-if [ -z "$ARCH" ]; then
-	for ARCH in arch/* ; do
-		make clean "ARCH=`basename "$ARCH"`"
-	done
-else
-	make clean "ARCH=$ARCH"
-fi
Index: tools/config.py
===================================================================
--- tools/config.py	(revision 05e2a7ad64a4c5a40748a558c64ca76a66934a0c)
+++ tools/config.py	(revision 839470fe57530d3817745bc3323d249dae216918)
@@ -138,11 +138,18 @@
 
         os.close(outdesc)
-        errout = os.fdopen(indesc,'r')
-        data = errout.read()
-        errout.close()
-            
-        pid,status = os.wait()
+        
+        try:
+            errout = os.fdopen(indesc,'r')
+            data = errout.read()
+            errout.close()
+            pid,status = os.wait()
+        except:
+            os.system('reset') # Reset terminal
+            raise
+        
         if not os.WIFEXITED(status):
+            os.system('reset') # Reset terminal
             raise EOFError
+        
         status = os.WEXITSTATUS(status)
         if status == 255:
@@ -151,5 +158,6 @@
         
     def yesno(self, text, default=None):
-        text = text + ':'
+        if text[-1] not in ('?',':'):
+            text = text + ':'
         width = '50'
         height = '5'
@@ -405,5 +413,7 @@
         os.unlink(OUTPUT)
     os.rename(TMPOUTPUT, OUTPUT)
-        
+    
+    if not defmode and dlg.yesno('Rebuild kernel?') == 'y':
+        os.execlp('make','make','clean','all')
 
 if __name__ == '__main__':
