#	Conditional Optimization
#
#   This makefile uses nmake provided by microsoft C 6.0
#
#   Use stdio. if you only have the make.exe supplied with
#   C 5.1 or masm 5.1
#

! IFNDEF NOOPT
OPT=-Oail
! ELSE
OPT=-Od
! ENDIF

#	Coditional Debugging

! IFNDEF NODEBUG
ZI=-Zepi
! ELSE
ZI=Zep
! ENDIF

#	Compiler argument setup

CARGS= -c -AS -W2 -Gsw $(OPT) $(ZI)
CC=cl $(CARGS)

#	Inference rules

.c.obj:
    $(CC) $*.c $(TEE)

#	Build both Stdio and Testapp

All:	Stdio.exe Testapp.exe

#
#	Stdio section
#

Stdio.exe: stdio.obj Stdio.def Stdio.res
    link5 /NOD /NOE /CO stdio.obj,Stdio.exe,,libw winpipe slibcew, Stdio.def;
    rc Stdio.res



Stdio.obj:	 Stdio.c Stdio.h
    $(CC) $*.c $(TEE)
    version > stdiov.h


Stdio.res: Stdio.rc Stdio.h stdio.ico stdiov.h
    rc -r Stdio.rc


#
#	Testapp section
#

testapp.exe: testapp.obj testapp.def testapp.res
    link5 /NOD /NOE /CO testapp.obj,testapp.exe,,libw winpipe slibcew, testapp.def;
    rc testapp.res


testapp.res: testapp.rc testapp.h    test.ico
    rc -r testapp.rc


testapp.obj:       testapp.c testapp.h testappv.h
    $(CC) $*.c $(TEE)
    version > testappv.h
