#
# This software is part of the Digital Fortran kit.
# Copyright (C) 1994, 1996 Digital Equipment Corporation.
# All rights reserved.
#
# This software is furnished to you under a license by  Digital Equipment
# Corporation and must be used only in  accordance with the terms and conditions
# of that license,  and only with the inclusion of the above copyright notice.
#
# This software is provided as an example that demonstrates a particular
# feature/function of the licensed product. The software is not intended to
# provide a complete solution to any application problem but rather is provided
# as a teaching mechanism.
#
# Users may incorporate any part of this sample into their own source after 
# making appropriate changes to make it suitable for the intended application.
#
# This makefile builds CHAREXMP.EXE from CHAREXMP.FOR, FINDSUBS.FOR and
# REVERSE.FOR
#
# Nmake macros for building Digital 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 
