#
# This makefile builds CHAREXMP.EXE from CHAREXMP.FOR, FINDSUBS.FOR and
# REVERSE.FOR

#
# Nmake macros for building Visual Fortran applications
#
!include <dfinc.mak>

all:    char.dll charexmp.exe 

# Build the DLL from two object files 
# Note that the DLL is linked with DLL version of Fortran libraries.
#
char.dll char.lib: findsubs.obj reverse.obj 
	$(link) /noentry /out:char.dll /dll \
        findsubs.obj reverse.obj \
	dfordll.lib

findsubs.obj:	findsubs.for
	$(FOR) $(fflags) /c findsubs.for

reverse.obj:	reverse.for
	$(FOR) $(fflags) /c reverse.for

# Build CHAREXMP.EXE that uses the DLL.
# Note that the import library, char.lib, is linked with the application.

charexmp.exe: charexmp.for char.lib
	$(FOR) $(fflags) charexmp.for /call_dll /link char.lib


run:  charexmp.exe
   	call charexmp.exe

#
#   Clean things up
#

clean:
	-del charexmp.exe
        -del char.dll
        -del char.lib
        -del char.exp
        -del findsubs.obj
        -del reverse.obj 
