#     (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 -W3 -AM -G2sw -Zip -Otxw /Gh $(DEF)
ASM = masm -t -D?QUIET $(DEF) -Mx -Zi
LINK= link /NOE/CO/LI/MAP/NOD
NAME= triq
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 $(NAME).exe

4d.lib:
	nmake /f make4d


$(NAME).exe: $(NAME).obj $(OBJ) $(NAME).res $(NAME).def makefile 4d.lib
        $(LINK) @<<
$(NAME).obj +
$(OBJ)
$(NAME)
$(NAME)
$(LIBS)
$(NAME).def
<<
        $(RC) -t $(NAME).res
	mapsym $(NAME).map


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

clean:
	del 4d.lib
	del *.res
	del 4D.obj
	del parse.obj
	del triq.obj
	del dib.obj
	del transfor.obj
	del *.map
        del *.sym
