home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 1997 January
/
Chip_1997-01_cd.bin
/
ms95
/
disk22
/
dir03
/
f014700.re_
/
f014700.re
Wrap
Text File
|
1996-04-02
|
7KB
|
261 lines
#-----------------------------------------------------------------------
#
# Copyright (1995) Bentley Systems, Inc., All rights reserved.
#
# Application Make File
#
# $Logfile: K:/mdl/examples/externpg/externpg.mkv $
# $Workfile: externpg.mke $
# $Revision: 5.26 $
# $Date: 03 Nov 1995 19:31:52 $
#
# "MicroStation" is a registered trademark and "MDL" and "MicroCSL"
# are trademarks of Bentley Systems, Inc.
#
# Limited permission is hereby granted to reproduce and modify this
# copyrighted material provided that the resulting code is used only
# in conjunction with Bentley Systems products under the terms of the
# license agreement provided therein, and that this notice is retained
# in its entirety in any such reproduction or modification.
#
#-----------------------------------------------------------------------
#---------------------------------------------
# Define constants specific to this example
#---------------------------------------------
baseDir = $(_MakeFilePath)
privateInc = $(baseDir)
externmpObjs = $(o)externpg.mo
externmiRscs = $(o)externpg.mp
%include mdl.mki
%include mdlexmpl.mki
%if msdos
#----------------------------------------------------------------------
# This makefile is set up to generate either a Metaware HighC or a
# Lahey F77-EM/32 protected mode external program.
#
# To make the Metaware HighC version, use the following command:
# bmake externpg
#
# To make the Lahey F77-EM/32 version, use the following command:
# bmake -dlaheyf externpg
#----------------------------------------------------------------------
%if laheyf
#----------------------------------------------------------------------
# $(initextFObjs) contains the interface module to Metaware High C and
# some startup code for Lahey Fortran external programs. Both modules
# are linked into all Fortran protected mode external programs and in
# this order:
# <fortran main> <interface module & startup code> <C modules>
#----------------------------------------------------------------------
externpgObjs = $(o)extrnpgf$(oext) \
$(initexpFObjs) \
$(o)extrnpgi$(oext)
%else
#----------------------------------------------------------------------
# $(initexpObjs) contains C module initialization. It must be linked
# into all C protected mode external programs and included FIRST.
#----------------------------------------------------------------------
externpgObjs = $(initexpObjs) \
$(o)externpg$(oext)
%endif
%elif unix
externpgObjs = $(o)externpg$(oext) \
$(mdlLibs)libextp.a
%elif macintosh
externpgObjs = $(o)externpg$(oext) \
$(mdlLibs)libextp.o
%elif winNT
externpgObjs = $(o)externpg$(oext) \
$(mdlLibs)libextp.lib
%elif os2
externpgObjs = $(o)externpg$(oext) \
$(mdlLibs)libextp.lib
%endif
#---------------------------------------------
# Compile the MDL program source
#---------------------------------------------
$(o)externpg.mo : $(baseDir)externpg.mc $(privateInc)externpg.h
#---------------------------------------------
# Generate the MDL program module
#---------------------------------------------
$(o)externpg.mp : $(externmpObjs)
$(msg)
> $(o)make.opt
$(linkOpts)
-a$@
$(externmpObjs)
<
$(linkCmd) @$(o)make.opt
~time
#---------------------------------------------
# Generate the MDL intermediate module using rlib
#---------------------------------------------
$(reqdObjs)externpg.mi : $(externmiRscs)
$(msg)
> $(o)make.opt
-o$@
$(externmiRscs)
<
$(rscLibCmd) @$(o)make.opt
~time
#---------------------------------------------
# Create the final MDL application
#---------------------------------------------
%include $(baseDir)extrnrsc.mki
#---------------------------------------------
# Compile the external program source
#---------------------------------------------
%if msdos && laheyf
$(o)extrnpgf$(oext) : $(baseDir)extrnpgf.for
$(o)extrnpgi$(oext) : $(baseDir)extrnpgi.c
%else
$(o)externpg$(oext) : $(baseDir)externpg.c $(privateInc)externpg.h
%endif
#---------------------------------------------
# Link the external program
#---------------------------------------------
#----------------------------------------------------------------------
# The external program library, libextp, contains the functions for
# interprocess communication. It must be linked with external programs
# that use any of the extprg_... functions.
#----------------------------------------------------------------------
%if msdos
#
# For PharLap 5.0 or greater, -NOSTUB is required to stop the linker
# from creating a .exe file that MicroStation cannot load. For PharLap
# versions prior to 5.0, -NOSTUB is not required and cannot
# be used. If you are using a pre-5.0 version of PharLap, remove
# -NOSTUB from the link step.
#
NOSTUB = -NOSTUB
%if laheyf
$(mdlapps)externpg.exp: $(externpgObjs) $(mdlLibs)libextp.lib
$(msg)
> $(o)link.cmd
$(MWlopt)
$(NOSTUB)
$(externpgObjs)
-lib $(laheyFLib)dosx.lib
-lib $(laheyFLib)f77l3.lib
-lib $(mdlLibs)libextp.lib
$(pmLibOpts)
$(naLibOpts)
-publist byvalue
-MINDATA 0
-MAXDATA 0
-80386
-exe $@
<
$(pFLinkCmd) @$(o)link.cmd
~time
%else
$(mdlapps)externpg.exp: $(externpgObjs) $(mdlLibs)libextp.lib
$(msg)
> $(o)link.cmd
$(MWlopt)
$(NOSTUB)
$(externpgObjs)
-lib $(mdlLibs)libextp.lib
$(pmLibOpts)
$(naLibOpts)
-publist byvalue
-MINDATA 0
-MAXDATA 0
-80386
-exe $@
<
$(pLinkCmd) @$(o)link.cmd
~time
%endif
%elif unix
$(mdlapps)externpg: $(externpgObjs)
$(msg)
> $(o)temp.cmd
%if CLinkOpts
$(CLinkOpts)
%endif
$(externpgObjs)
%if clipper || rs6000
-lbsd
%endif
%if hp700
-lV3
%endif
-o $(mdlapps)externpg
<
$(CLinkCmd) `cat $(o)temp.cmd`
~time
%elif m68k
llibs = "{Libraries}"Interface.o "{Libraries}"Runtime.o "{CLibraries}"StdCLib.o
$(mdlapps)externpg : $(externpgObjs)
$(msg)
$(CLinkCmd) $(CLinkOpts) $(externpgObjs) $(llibs) -o $@
Rez -rd $(baseDir)externpg.r -append -o $@
Setfile -t APPL -c 'extP' $@
~time
%elif powerc
$(mdlapps)externpg : $(externpgObjs)
$(msg)
$(CLinkCmd) $(CLinkOpts) $(externpgObjs) $(libsmac) -o $@.xcoff
makepef -fc 'APPL' -ft 'extP' -o $@ -l InterfaceLib.xcoff=InterfaceLib -l StdCLib.xcoff=StdCLib -l MathLib.xcoff=MathLib $@.xcoff
Rez -d APPNAME=6"$*6" -o $@ -a $(baseDir)extcfrg.r
Rez -rd $(baseDir)externpg.r -append -o $@
Setfile -t APPL -c 'extP' $@
~time
%elif winNT
$(mdlapps)externpg.exe: $(externpgObjs)
$(msg)
> $(o)temp.cmd
%if CLinkOpts
$(CLinkOpts)
%endif
$(externpgObjs)
$(CLibs)
-out:$@
<
$(CLinkCmd) @$(o)temp.cmd
~time
%elif os2
$(mdlapps)externpg.exe: $(externpgObjs)
$(msg)
> $(o)linkextp.cmd
$(commonLOpts)
$(guiLOpts)
OPTION STACK=32K
NAME $@
FILE $(o)externpg$(oext)
LIBRARY $(mdlLibs)libextp.lib
<
$(CLinkCmd) @$(o)linkextp.cmd
~time
%endif