# V executive buildfile
# by Bill Nowicki January 1983

#include ../../../buildprefix
.SUFFIXES:
.SUFFIXES: .o .c
VPATH = ../mi

CC = ccVAX
#ifdef X
#CFLAGS = -O -V -vx -DXEXEC -I../../../libc/include
CFLAGS = -O -vxV -DXEXEC
#else X
CFLAGS = -O -V
#endif X

LIBS = 

BIN = exec.o aliases.o getline.o history.o io.o remote.o parseline.o \
	readdir.o descname.o

SERVER = execserver.o

ALL = libVexec.a exec.vax execserver.vax

all: $(ALL)

libVexec.a: $(SERVER) $(BIN)
	rm -f libVexec.a
	ar cq libVexec.a $(SERVER) $(BIN)
	ranlib libVexec.a

execserver.vax: server.o $(SERVER) $(BIN)
	$(CC) $(CFLAGS) -o execserver.vax server.o $(SERVER) $(BIN) $(LIBS)

exec.vax:   execmain.o $(BIN)
	$(CC) $(CFLAGS) -o exec.vax execmain.o $(BIN) $(LIBS)

#delete this if we don't want EXECSERVER active
exec.o: exec.c
	$(CC) $(CFLAGS) -DEXECSERVER -c exec.c

# How to make tags:
#   Tags should be made periodically, and also when you want 
#   to make sure that "tags" is up to date.
#   Sometimes it is necessary to delete "tags" in order to build
#   it (i.e. when you get the message "'tags' is up to date.").
#   The "tags" file copied into ../mi and ../m68k because ved uses 
#   the "tags" file in the current directory.
#   The "tags" file copied into ../mi and ../m68k is the most recent
#   "tags" file built for any particular object directory.

tags:
	csh -c \
	"ctags -tw {.,../vax,../mi,../../../libc/exec/{mi,vax},../../../libc/include/{mi,vax}}/*.[ch]"
	cp tags ../mi/tags
	cp tags ../tags

clean:
	rm -f *.BAK *.CKP *.sym
	rm -f *.o .emacs* $(ALL)

cleanbak:
	rm -f *.BAK *.CKP *.68 *.sym

install: all
	$(NETINSTALL) -p "execserver.vax exec.vax" $(VSYS)/bin
	$(NETINSTALL)  "libVexec.a" $(VSYS)/lib/vax

relink:
	rm -f $(ALL)

backup:
	cd .. ; cpdir exec ../../Vbackup/servers/exec

