#
# This software is part of the Visual Fortran kit.
#
# This makefile builds DLL1.DLL, DLL2.DLL, and IMEXPORT.EXE.
#
# Nmake macros for building Visual Fortran applications
#

!include <dfinc.mak>
#!if "$(CPU)" == "ALPHA" 
fflags = $(fflags) /names:lowercase /assume:nounderscore
#!endif

all:    dll2.lib dll1.dll dll2.dll imexport.exe

# Build the 2 DLLs.
# Note that the DLLs are linked with DLL version of Fortran libraries.
#

dll1.dll dll1.lib : dll1.for dll2.lib 
	$(FOR) $(fflags) /DLL dll1.for dll2.lib

dll2.dll : dll2.for dll1.lib
	$(FOR) $(fflags) /DLl dll2.for dll1.lib

dll2.lib : dll2.for
	$(FOR) $(fflags) /c /DLL dll2.for
	lib /def: dll2.obj


# Build IMEXPORT.EXE that uses the DLLs.
# Note that the import librarys, dll1.lib and dll2.lib, are linked with the 
# application.

imexport.exe: imexport.for dll1.lib dll2.lib
	$(FOR) $(fflags) imexport.for /call_dll /link dll1.lib dll2.lib

#
#   Clean things up
#

clean:
	-del imexport.exe
	-del dll1.dll
	-del dll2.dll
	-del dll1.lib
	-del dll2.lib
	-del dll1.exp
	-del dll2.exp
	-del dll1.obj 
	-del dll2.obj 

#
#   Execute
#

run:
	-imexport

