# 
#  Copyright 1990, 1991 by the Massachusetts Institute of Technology and
#  UniSoft Group Limited.
#  
#  Permission to use, copy, modify, distribute, and sell this software and
#  its documentation for any purpose is hereby granted without fee,
#  provided that the above copyright notice appear in all copies and that
#  both that copyright notice and this permission notice appear in
#  supporting documentation, and that the names of MIT and UniSoft not be
#  used in advertising or publicity pertaining to distribution of the
#  software without specific, written prior permission.  MIT and UniSoft
#  make no representations about the suitability of this software for any
#  purpose.  It is provided "as is" without express or implied warranty.
# 
#  $XConsortium: cllsofscrn.m,v 1.5 92/06/11 15:56:08 rws Exp $
#  
#
# Makefile for XCellsOfScreen
#

SOURCES=cllsofscrn.m 
CFILES=Test.c 
OFILES=Test.o 
MOFILES=MTest.o 
LOFILES=link.o mlink.o 
LINKOBJ=cllsofscrn.o
LINKEXEC=cllsofscrn


# $XConsortium: mmsa.mc,v 1.2 92/06/29 19:42:24 rws Exp $
#
# Build a standalone version of the test case.
#
Test: $(OFILES) $(LIBS) $(TCM) $(AUXFILES)
	$(CC) $(LDFLAGS) -o $@ $(OFILES) $(TCM) $(LIBLOCAL) $(LIBS) $(SYSLIBS)

Test.c: $(SOURCES)
	$(CODEMAKER) -o Test.c $(SOURCES)

# $XConsortium: mmmsa.mc,v 1.2 92/06/29 19:42:18 rws Exp $
#
# Build a standalone version of the test case using the macro version
# of the function.
#
MTest: $(MOFILES) $(LIBS) $(TCM) $(AUXFILES)
	$(CC) $(LDFLAGS) -o $@ $(MOFILES) $(TCM) $(LIBLOCAL) $(LIBS) $(SYSLIBS)

MTest.c: $(SOURCES)
	$(CODEMAKER) -m -o MTest.c $(SOURCES)

# $XConsortium: mmlink.mc,v 1.2 92/06/29 19:42:10 rws Exp $
#
# A version of the test that can be combined together with
# all the other tests to make one executable.  This will save a
# fair amount of disk space especially if the system does not
# have shared libraries.  Different names are used so that
# there is no possibility of confusion.
#
link.c: $(SOURCES)
	$(CODEMAKER) -l -o link.c $(SOURCES)

# Link the objects into one large object.
#
$(LINKOBJ): $(LOFILES)
	$(LD) $(LINKOBJOPTS) $(LOFILES) -o $(LINKOBJ)

# Link the object file into the parent directory.
#
../$(LINKOBJ): $(LINKOBJ)
	$(RM) ../$(LINKOBJ)
	$(LN) $(LINKOBJ) ..

# Make a link to the combined executable.
#
$(LINKEXEC): ../Tests
	$(RM) $(LINKEXEC)
	$(LN) ../Tests $(LINKEXEC)

../Tests: ../$(LINKOBJ)

linkexec:: $(LINKEXEC) $(AUXFILES) ;

# $XConsortium: mmmlink.mc,v 1.2 92/06/29 19:42:16 rws Exp $
# A version of the test that can be combined with all the other tests for
# the macro version of the function.
#
mlink.c: $(SOURCES)
	$(CODEMAKER) -m -l -o mlink.c $(SOURCES)

linkexec:: m$(LINKEXEC) $(AUXFILES) ;

m$(LINKEXEC): ../Tests
	$(RM) m$(LINKEXEC)
	$(LN) ../Tests m$(LINKEXEC)
# $XConsortium: mmlib.mc,v 1.2 92/06/29 19:42:08 rws Exp $
# 
# This part of the makefile checks for the existance of the libraries
# and creates them if necessary.
#

# The xtestlib is made if it doesn't exist
#
$(XTESTLIB):
	cd $(XTESTROOT)/src/lib; $(TET_BUILD_TOOL) install

# The fontlib is made if it doesn't exist
#
$(XTESTFONTLIB):
	cd $(XTESTROOT)/fonts; $(TET_BUILD_TOOL) install

# $XConsortium: mmmisc.mc,v 1.3 92/06/29 19:42:14 rws Exp $
#
# Miscellaneous housekeeping functions.
#

# clean up and remove remakable sources, objects and junk files.
#
clean:
	$(RM) Test $(OFILES) $(LOFILES) $(LINKOBJ) $(LINKEXEC) core\
		MTest m$(LINKEXEC) $(MOFILES) CONFIG Makefile.bak $(AUXCLEAN)\
		MTest.c Test.c mlink.c link.c Makefile *.err

# clobber - aka clean.
#
clobber:	clean

# Lint makerules
#
lint: $(CFILES)
	$(LINT) $(LINTFLAGS) $(CFILES) $(LINTTCM) $(LINTLIBS)

LINT:lint

