DISTRIBUTION=1
# Makefile for V commands
# Copyright 1982 (c) David R. Cheriton, All rights reserved.
#
# Please keep DIRS and CMDS in alphabetical order

#ifdef DISTRIBUTION
DIRS = amaze biopsy bits checkers cp date debug demo destroy draw echo \
  editor exec fexecute help iptelnet list listservers login naming \
  puptelnet serial testexcept timekernel type vfinger vgtsexec
#else DISTRIBUTION
DIRS = amaze biopsy bits checkers cp date debug demo destroy draw echo \
  editor emacs exec fexecute help iptelnet list listservers login naming \
  puptelnet serial silence testexcept timekernel type vfinger vgtsexec
#endif DISTRIBUTION

# The "remote" command in netinstall barfs if all these commands are
#   installed at once.  --TPM 9/29/83
CMDS1 = amaze/amaze \
  biopsy/biopsy \
  bits/bits \
  checkers/checkers \
  cp/cp \
  date/date \
  debug/debug \
  destroy/destroy \
  draw/draw.r \
  echo/echo \
  editor/ved \
  exec/exec exec/serverexec \
  fexecute/fexecute \
  help/help \
  iptelnet/iptn iptelnet/iptelnet
CMDS2 = list/listdir list/listdesc \
  listservers/listservers \
  login/login login/logout \
  naming/define naming/undefine naming/context naming/pwd \
  puptelnet/telnet puptelnet/tn \
#ifdef DISTRIBUTION
#else DISTRIBUTION
  silence/silence \
#endif DISTRIBUTION
  serial/serial \
  testexcept/testexcept \
  timekernel/timekernel \
  type/type \
  vfinger/vfinger \
  vgtsexec/vgtsexec vgtsexec/smallvgts

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

install:
#ifdef X
	netinstall -x -p "$(CMDS1)" /usr/sun/xVboot
	netinstall -x -p "$(CMDS2)" /usr/sun/xVboot
#else X
	netinstall -p "$(CMDS1)" /usr/sun/Vboot
	netinstall -p "$(CMDS2)" /usr/sun/Vboot
#endif X
#demo and emacs install in more than just /usr/sun/*Vboot
	cd demo; make install
#ifdef DISTRIBUTION
#else DISTRIBUTION
	cd emacs; make install
#endif DISTRIBUTION

clean:
	rm -f *.CKP *.BAK *.b
	domake "$(DIRS)" "make clean"

backup:
	cd ..; cpdir cmds ../Vbackup/cmds

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

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