#
# Buildfile for V kernel
# vaxu+qna version
# Jay Schuster, 1 Feb 85
#

CONFIG= vaxu+qna

MI= ../mi
HOST= ../vax
VINCL= ../../libc/include/mi
VAXINCL= ../../libc/include/vax
INCLPATH= -I. -I$(HOST) -I$(MI) -I$(VINCL) -I$(VAXINCL)
CFLAGS = -O -DENET10MEG -DMICROVAX $(INCLPATH) -v${Xx}V
NOOPCFLAGS= -DENET10MEG -DMICROVAX $(INCLPATH) -v${Xx}V
LDFLAGS = -T 80000000

MDLIBS	 = $(VSYS)/lib/vax/libuvaxqvssrawio.a
MDOBJECTS= config.o console.o deqna.o exception.o machine.o memory.o \
	   profile.o random.o timer.o trap.o qvss.o qvssmouse.o \
	   qvssserial.o mscp.o rqdx.o

MIOBJECTS= init.o alien.o bpi.o dm.o enet.o force.o groupipc.o hostcache.o \
	   ikc.o ikcint.o ipc.o kp.o lhost.o migrate.o migrate1.o mouse.o \
	   naming.o null.o time.o pm.o printx.o qk.o reboot.o debug.o

all: vaxu+qna

#include ../vax/buildtemplate

# Dependencies on header files appear in file "dependencies"
#include dependencies

# We search libV.a to find the runtime arithmetic routines and the Sun-1 EMTs.
vaxu+qna: $(MDOBJECTS) $(MIOBJECTS) $(MDLIBS) startup.o
	../newvers.sh $(KNAME) $(CONFIG)
	ccVAX -c vers.c
	ld -e start -o vaxu+qna -X $(LDFLAGS) startup.o vers.o \
		$(MIOBJECTS) $(MDOBJECTS) $(MDLIBS) \
		/usr/$(Xx)V/lib/vax/libV.a
	rm -f symbols

symbols: vaxu+qna
	nm -n vaxu+qna | grep -v " a " > symbols

# 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 ../vax because ved uses 
#   the "tags" file in the current directory.
#   The "tags" file copied into ../mi and ../vax is the most recent
#   "tags" file built for any particular object directory (eg. vaxu+qna).

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

# How to make the "dependencies" file using makedep.  We use -N to avoid
#   the tedium of recompiling the whole kernel every time there is a trivial
#   change in a system (V*.h) header file.  So beware if you change a
#   system header file that necessitates recompiling part of the kernel --
#   it will not be done automatically.
depend:
	makedep -e o -o dependencies $(INCLPATH) -I/xV/libc/include/vax -I/xV/libc/include/mi *.c $(HOST)/*.c $(MI)/*.c

lint:
	lint -hx $(CFLAGS) ../mi/*.c ../vax/*.c *.c

lint2:
	lint -hx $(CFLAGS) -I/xV/libc/include/vax -I/xV/libc/include/mi ../vax/*.c *.c

