#
#xV buildfile 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 config fonts

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

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

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

install-libc:
	(cd libc; build install)

install-kernel:
	(cd kernel; build install)

install-standalone:
	(cd standalone; build install)

install-servers:
	(cd servers; build install)

install-cmds:
	(cd cmds; build install)

install-fonts:
	(cs fonts; build install)

Vlibc:
	cd libc; build

Vkernel:
	(cd kernel; build)

Vstandalone:
	(cd standalone; build)

Vservers:
	cd servers; build

Vcmds:
	(cd cmds; build)

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

backup:
	cd ..; cpdir V Vbackup
