~michael-owens/ltnet/trunk

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# COMPILATION OPTIONS: READ THIS
#
# There are compilation options available in this project to help profile,
# debug, and detect memory leaks. Each option has two definitions: one to turn
# it on, the other to turn it off. The naming convention is OPTION_ON, and
# OPTION_OFF. These options are specified on the CFLAGS line as follows:
#
# CFLAGS =  $(MEM_TRACE_ON) $(TRACE_OFF) $(PROFILE_OFF) \
#
# Here, we have memory tracing one, execution tracing off, and profiling off. To
# toggle them on or off, all you have to do is change the OFF to ON and vice
# versa. A description of what each options does follows.

# MEM_TRACE_ON: This turns on memory tracing for C/C++ memory allocation. All
# new, new[], and mallocs will be watched, and and unallocated memory will be
# recorded and written out to file upon normal program exit. This should only be
# used under debugging/development as it imposes a heavy performance hit, and
# takes up a lot of memory per allocation. Once you run the program, a simple
# summary report will be printed as the program shuts down listing the number of
# leaks and their types. To trace the leaks to their location in souce, type
# 'make leaktrace'. This reads the leak file, obtains the line numbers where
# leaked memory was allocated, and pipes it to a python script which prints the
# source code.
#
# TRACE_ON:
#
# Much of the code in this library, and others that depened on it, uses tracing
# macros that report the time, location, a message concerning what is happening
# in the code. This level of detail is determined by different defines. There
# are currently five levels. The first (TRACE1) is for the most low-level code
# such as buffer allocation and other things in this library. The highest
# (TRACE5) are for more application program purposes. None of the tracing will
# appear without setting the global flag TRACE. TRACE_ON does that.

# PROFILE_ON: This simply configures the compiler to include profiling
# code. Once you run the program, you can get a complete profiler report by
# typing 'make prof'.

# Debugging
# NOTE: -DDEBUG MUST BE DEFINED for memory allocation accounting 
#        or you will get incorrect output.
DEBUG_ON      = -g -D DEBUG
DEBUG_OFF     = -O2

# Memory Tracing
MEM_TRACE_ON  = -D LEAK_TRACE
MEM_TRACE_OFF =

# Execution Tracing
TRACE_ON  = -D TRACE -D TRACE3 -D TRACE4 -D TRACE5 -D DEBUG
TRACE_OFF = 

# Profiling
PROFILE_ON    = -pg --profile-arcs --test-coverage
PROFILE_OFF   = 

PROFILING   = $(PROFILE_OFF)
MEM_TRACING = $(MEM_TRACE_OFF)
DEBUGGING	= $(DEBUG_ON)
TRACING		= $(TRACE_OFF)

NAME        = ltnet