
40
Compilation
Compilation requires command line operation in DOS. (If you wish, the entire
process can be done in the Windows IDE.) To invoke the process just type
“make” on the DOS command line. Make will read a file in the current directory
called “makefile”. This file is used to prepare the benchmark for execution. Of
note is the selection of optimization level (none). The optimizations called out
on this line will have a great impact on performance and some times on code
correctness. Always consult the compiler manual to understand the effect of the
specified optimization. You may wish to see if code performance improves with
other selections (recommended as an exercise).
File: makefile
#
# Sample makefile for building the floating point arithmetic demonstration
# using the Borland C++ compiler.
#
# Some of the macros used in this makefile that can be customized are
#
# MODEL Selected memory model
# CPU CPU instruction selection
# FLOAT Floating point library selection
# EXCEPTIONS Exception handling selection
# FARDATA Enables use of class FAR_DATA, with optional compression
# DEBUG Enable/disable debug information
# OPTIMIZE Enable/disable optimization
# WARNINGS Enable/disable compiler warning messages
#
COMPDIR = c:\bc45 # Compiler home directory
BCCFG = turboc.cfg # BC++ compiler configuration file
MKF = makefile # Build everything if the makefile is changed
MODEL = s # s, m, c, l, h
CPU = 1
# 0 - 8086, 1 - 80186, 2 - 80286, 3 -80386
FLOAT = 2
# 0 - none, 2 - emulator, 3 - coprocessor
OPTIMIZE = 0
# 0 - none, 1 - size, 2 - speed
EXCEPTIONS = 0 # 0 - disabled, 1 - enabled
FARDATA = 1
# 0 - none, 1 - normal, 2 - compressed
# above must be 1 if float > 0
DEBUG =
2
# 0 - none, 1 - debug EPROM, 2 - debug PDREMOTE
WARNINGS = 1 # 0 - none, 1 - all
CODESTRING = 0 # Put string literals in code segment
DUPSTRING = 1 # Duplicate string merged
CHECKSTACK = 0 # Check for stack overflow
STACK = 8192
# Application stack size (in bytes)
!include paradigm.mkf # Compiler/linker customization options
#
# These are the implicit rules for building C, C++, and assembly
# language source modules.
#
.autodepend # Autodepedency checking
.suffixes: .cpp .c .asm # Rules when target's dependent is ambiguous
You must make sure that
the paths point to your
tool set directories!
CPU must be 80186, to use the
timer float must be set to 2,
floating point requires fardata so
set this to 1. Select your own
optimization levels (per text).
Select debug = 2 so you
can use PDRT186
Watch your stack size!!!