#
# Makefile for V-System C library.
#
# Date Written    : February 24, 1985
# Programmer      : James Wilson
#
# This buildfile will execute the makefile on the lower level unix directories
#


MACHINE = unix

#INSTALLED_FILES = \
#   "libV.a process/teamroot.o \
#    mem/lockedmalloc.o \
#    sun100graphics/libsun100graphics.a sun120graphics/libsun120graphics.a \
#    sfonts/libsfonts.a \
#    standalone/libVsa3.a standalone/libVsa10.a standalone/libVsa10x.a" 

OBJSUFFIX = o

# Note that the four standalone directories, drivers, rawio, sa, and
# saconsole are included here, and that sun*graphics aren't.
SUBDIRS = ../vgts/$(MACHINE)

# note that sfonts, sun*graphics and the standalone directories aren't
# on this list.
# neither is info, since it makes its own library
# neither is include, because there should be NO .$(OBJSUFFIX) files there.
LIBVDIRS = ../vgts/$(MACHINE)/*.$(OBJSUFFIX)

# files comprising the V lint library
LLIB = llib-lV.ln
LLIB_V_FILES = \
	../vgts/$(MACHINE)/$(LLIB)


# First, always do a make of the subdirectories.  Then, if anything has
#  changed, update libV.a (time-consuming).  If libV.a doesn't exist at
#  all, an error message comes out about the list for $? being too long,
#  but make does the right thing anyway.
all::
	domake "$(SUBDIRS)" "build"
all:: libVgts.a

libVgts.a:
	cp $(SUBDIRS)/libVgts.a libVgts.a


install:
	domake $(SUBDIRS) "build install"

clean:
	domake "$(SUBDIRS)" "build clean"


object.list:
	domake "$(SUBDIRS)" "build object.list"

depend:
	domake "$(SUBDIRS)" "build depend"

# use this target to build just lint targets in the subdirectories
lint-lib:	do-lint $(LLIB)

# strip off the library name to get the directories... looks ugly, but
# sed might choke on a long line
do-lint:
	domake "`echo $(LLIB_V_FILES)|tr ' ' '\012'|sed 's%/$(LLIB)%%'|tr '\012' ' '`" "build lint-lib"

$(LLIB):
	$(LINT) -v$(Xx)V -n -CV $(LLIB_V_FILES)

