DebugStepper and getLibraryAtAddr optimizations.
[dyninst.git] / stackwalk / make.module.tmpl
1 # -*- makefile -*-
2 # Common makefile template for the dyninstAPI library.  This file is not
3 # intended to be a useful Makefile in isolation; instead, it should be
4 # included from within an architecture-specific Makefile.
5 #
6 # $Id: make.module.tmpl,v 1.1 2008/06/30 19:40:26 legendre Exp $
7 #
8
9 SUITE_NAME      = Stackwalker
10 RELEASE_MAJOR   = 8
11 RELEASE_MINOR = 0
12
13 USES_DWARF_DEBUG = true
14 #USES_LIBELF = true
15
16 CFLAGS               += $(USEFULWARNINGS) $(DEFINES)
17 CXXFLAGS             += $(USEFULWARNINGS) $(DEFINES)
18
19 ifndef TARGET
20 ifdef STATIC_COMPS
21 STATIC_LIBRARY = true
22 TARGET = libstackwalk.a
23 else
24 TARGET = libstackwalk.so
25 endif
26 endif
27
28 LDFLAGS += -L$(TO_CORE)/common/$(PLATFORM) -L$(LIBRARY_DEST)
29 ifndef USES_NATIVE_CC
30 LD              = $(GXX)
31 LDFLAGS         += -shared
32 CFLAGS          += 
33 CXXFLAGS        += 
34 else
35 ifeq (solaris,$(findstring solaris,$(PLATFORM)))
36 LDFLAGS         += -G
37 endif #sparc
38 endif #USES_NATIVE
39 TFLAGS          +=
40
41 TO_INC     = ../h
42 PUBLIC_H   = basetypes.h \
43              framestepper.h \
44              steppergroup.h \
45              symlookup.h \
46              frame.h \
47              procstate.h \
48              swk_errors.h \
49              walker.h \
50                                  local_var.h \
51                                  sw_c.h
52
53 SRCS         += ../src/frame.C \
54                 ../src/framestepper.C \
55                 ../src/swk_errors.C \
56                 ../src/symlookup.C \
57                 ../src/walker.C \
58                 ../src/procstate.C \
59                 ../src/steppergroup.C \
60                 ../src/libstate.C \
61                 ../src/sw_c.C \
62                 ../src/sw_pcontrol.C
63
64 ifdef LIBDWARF_PLATFORM
65 LDFLAGS += -L../../dwarf/$(PLATFORM) -ldynDwarf
66 endif
67
68 ifdef LIBELF_PLATFORM
69 LDFLAGS += -L../../elf/$(PLATFORM) -ldynElf
70 endif
71
72 ifndef WITHOUT_PARSE_API
73         MYFLAGS += -I../../parseAPI/h -I../../dataflowAPI/h -DUSE_PARSE_API
74         LDFLAGS += -L../../parseAPI/$(PLATFORM) -lparseAPI      
75         SRCS += ../src/analysis_stepper.C \
76                 ../src/callchecker-IAPI.C
77 else
78         SRCS += ../src/callchecker.C
79 endif
80
81 ifndef WITHOUT_SYMTAB_API
82         MYFLAGS += -I../../symtabAPI/h
83         LDFLAGS += -L../../symtabAPI/$(PLATFORM) -lsymtabAPI
84 endif
85
86 LDFLAGS += -L../../symlite/$(PLATFORM) -lsymLite
87
88
89 IFLAGS       += -I../$(PLATFORM) -I../src -I../h -I../../proccontrol/h -I../../symtabAPI/h -I../../parseAPI/h -I../../instructionAPI/h
90
91 ifdef WRAPPER_LIBS
92 all: libstackwalk_c.so
93 install: $(DEST)/libstackwalk_c.so
94 endif
95
96 SWOBJS = $(filter-out sw_c.o, $(OBJS))
97 SWOBJS += $(wildcard $(TO_CORE)/common/$(PLATFORM)/*.o)
98
99 comma:=,
100 empty:=
101 space:= $(empty) $(empty)
102 WRAPPER_LIBS_NOCOMMA = $(subst $(comma),$(space),$(WRAPPER_LIBS))
103
104 libsw.a: $(SWOBJS)
105         ar rs $@ $(SWOBJS)
106
107 libstackwalk_c.so: libsw.a sw_c.o
108         g++ -o $@ -shared sw_c.o -Wl,--exclude-libs -Wl,ALL libsw.a $(WRAPPER_LIBS_NOCOMMA)
109
110 $(DEST)/libstackwalk_c.so: libstackwalk_c.so
111         -$(INSTALL) libstackwalk_c.so $(DEST)