#
# V makefile for all source and documentation
#
# This is used as much to document how to make programs as to
# actually maintain the source and documentation.

# NOTE: The order of the directories is important!
DIRS =  kernel libc servers cmds standalone tools help

all:
	domake "$(DIRS)" "make"

archive:
	tar cvf ng.tar libc kernel standalone servers cmds

install: 
	domake "$(DIRS)" "make install"

install-libc:
	(cd libc; make install)

install-kernel:
	(cd kernel; make install)

install-standalone:
	(cd standalone; make install)

install-servers:
	(cd servers; make install)

install-cmds:
	(cd cmds; make install)

Vlibc:
	cd libc; make

Vkernel:
	(cd kernel; make)

Vstandalone:
	(cd standalone; make)

Vservers:
	cd servers; make

Vcmds:
	(cd cmds; make)

clean:
	find . \( -name "*.CKP" -o -name "*BAK" -o -name ".emacs*" \
		  -o -name ".netupd*" \) -exec rm -f {} \;
	domake "$(DIRS)" "make clean"

backup:
	cd ..; cpdir V Vbackup

build:
	buildmake.sh
	domake "$(DIRS)" "make build"

xbuild:
	buildmake.sh -DX=1
	domake "$(DIRS)" "make xbuild"
