# This is a part of the Microsoft Foundation Classes C++ library.
# Copyright (C) 1994 WATCOM International Corporation
# All rights reserved.
#
# This source code is only intended as a supplement to the
# Microsoft Foundation Classes Reference and Microsoft
# QuickHelp and/or WinHelp documentation provided with the library.
# See these sources for detailed information regarding the
# Microsoft Foundation Classes product.

# Common include for building MFC Sample programs
#
#	exe = hello.exe
#	objs = hello.obj
#	res = hello.res
#	!include ..\master.mif
#
# Options to wmake:
#	debug=0	-> retail, no debuging info. (debug=1) is default
#	model=r -> register calling convention. (default)
#	      s -> stack calling convention.
#	opt	-> use to set custom compile options
#

!ifndef debug
debug=1
!endif

!ifndef model
model=r
!endif

#define flags for tools
cflags = -3$(model)-ox-w3-bt=nt -fhq $(opt)
rflags = -bt=nt
dllflags = -bd -d_USRDLL -d_WINDLL

lflags = option map
!ifeq debug 1
dbgflags = -d2 -d_DEBUG
lflags += debug all
!endif

!ifdef CONSOLE
sys=nt
cflags+= -d_CONSOLE
!else
sys=nt_win
cflags+= -d_WINDOWS
!endif

.extensions:
.extensions: .exe .obj .res .rc .cpp

.before
    set include=$(%watcom)\h;$(%watcom)\h\nt;
    
.cpp.obj:
    wpp386.exe $[@ $(cflags) $(dbgflags)

$(exe) : $(objs) $(res) tmp.lnk
    wlink.exe $(lflags) @$]@ 
!ifdef res
    wrc.exe $(rflags) $(res) $^@
!endif

.rc.res:
    wrc.exe $(rflags) -r $^*.rc

tmp.lnk : $(__MAKEFILES__)
    %create $^@
    @%append $^@ system $(sys) 
    @for %i in ( $(objs) ) do @%append $^@ file %i
!ifdef extralib
    @%append $^@ library $(extralib)
!endif

clean global : .symbolic
    @if exist *.exe erase *.exe >nul
    @if exist *.dll erase *.exe >nul
    @if exist *.obj erase *.obj >nul
    @if exist *.err erase *.err >nul
    @if exist *.res erase *.res >nul
    @if exist *.lnk erase *.lnk >nul
    @if exist *.map erase *.map >nul
