#     (C) Copyright Microsoft Corp. 1991.  All rights reserved.
#
#     You have a royalty-free right to use, modify, reproduce and 
#     distribute the Sample Files (and/or any modified version) in 
#     any way you find useful, provided that you agree that 
#     Microsoft has no warranty obligations or liability for any 
#     Sample Application Files which are modified. 
#

# /Gh means use C5.0 compatible 'helper' routines for long math
# The 4D asm code depends on these 'old' routine names.

CC  = cl -c -W2 -AM -G2sw -Zip -Otxw /Gh $(DEF)
ASM = masm -t -D?QUIET $(DEF) -Mx -Zi
LINK= link /NOE/CO/LI/MAP/NOD

DEF =-DDEBUG
RC  = rc $(DEF)

OBJ  = parse.obj dib.obj triangle.obj 
LIBS = libw Mlibcew 4d.lib

.c.obj:
	$(CC) $*.c

.asm.obj:
	$(ASM) $*;

goal: 4d.lib tri.exe

4d.lib:
	$(MAKE)
	cd ..

tri.exe: tri.obj dib.obj triangle.obj tri.res tri.def makefile 4d.lib
        $(LINK) @<<
tri.obj +
dib.obj triangle.obj
tri
tri
libw mlibcew 4d.lib
tri.def
<<
        $(RC) -t tri.res
        cvpack -p tri.exe

tri.res: tri.rc
        $(RC) -r tri.rc

clean:
	$(MAKE) clean
	cd ..
	del 4d.lib
	del tri.exe
        del *.res
	del *.map
        del *.sym
	del dib.obj
	del parse.obj
	del tri.obj
