AIX build fix.
[dyninst.git] / dyninstAPI / make.module.tmpl
1
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.100 2008/09/15 17:38:17 jaw Exp $
7 #
8
9 SUITE_NAME      = Dyninst
10 RELEASE_MAJOR = 7
11 RELEASE_MINOR = 0
12 #BUILD_MARK should be (re-)defined in core/make.config.local rather than here!
13
14 DEFINES              += -DBPATCH_LIBRARY 
15 DEFINES          += -DBPATCH_SET_MUTATIONS_ACTIVE
16 DEFINES          += -DBPATCH_LIBRARY_F 
17 DEFINES          += -DNEW_TIME_TYPES
18
19 CFLAGS               += $(USEFULWARNINGS) $(DEFINES)
20 CXXFLAGS             += $(USEFULWARNINGS) $(DEFINES)
21 TFLAGS               += $(TCLFRIENDLYWARNINGS) $(DEFINES)
22
23 ifdef GCC_2_95
24 # This may cause problems on Alpha
25 # GCC has a new mangled name squisher (-fsquangle) which can be 
26 # set to "on" by default. This causes linker problems, so we
27 # default to "off".
28 CFLAGS          += -fno-squangle
29 CXXFLAGS        += -fno-squangle
30 TFLAGS          += -fno-squangle
31 endif
32
33 TARGET          ?= libdyninstAPI.so
34
35
36 ifneq ($(findstring cap_instruction_api,$(CAP_DEF)),)
37         LDFLAGS += -linstructionAPI
38 endif
39
40 LDFLAGS += -lpthread -lsymtabAPI -lcommon -lparseAPI
41
42 LDFLAGS     += -L../../common/$(PLATFORM) 
43 LDFLAGS     += -L../../symtabAPI/$(PLATFORM) 
44 LDFLAGS     += -L../../instructionAPI/$(PLATFORM)
45 LDFLAGS     += -L../../parseAPI/$(PLATFORM)
46
47 ifndef USES_NATIVE_CC
48 LD              = $(GXX)
49 LDFLAGS         += -shared $(G_PTHREAD_LD)
50 CFLAGS          += -fPIC
51 CXXFLAGS        += -fPIC $(G_PTHREAD)
52 else
53 ifeq (solaris,$(findstring solaris,$(PLATFORM)))
54 LDFLAGS         += -G
55 endif #sparc
56 endif #USES_NATIVE
57 TFLAGS          += -fPIC
58
59 VPATH        += ../../dyninstAPI/src:../dyninstAPI/h:\
60                 ../../common/src:../../paradyn/h
61
62 ifdef AUTO_TEMPLATES
63 CFLAGS += -DAUTO_TEMPLATES
64 CXXFLAGS += -DAUTO_TEMPLATES
65 endif
66
67 ifndef AUTO_TEMPLATES
68 SRCS         += ../src/BPatch_templates.C \
69                 ../src/templates0.C \
70                 ../src/templates1.C \
71                 ../src/templates2.C 
72
73 endif
74
75 SRCS         += ../src/BPatch.C \
76                 ../src/BPatch_image.C \
77                 ../src/BPatch_function.C \
78                 ../src/BPatch_snippet.C \
79                 ../src/BPatch_thread.C \
80               ../src/BPatch_process.C \
81                 ../src/BPatch_type.C \
82                 ../src/BPatch_module.C \
83                 ../src/BPatch_point.C \
84                 ../src/BPatch_collections.C \
85                 ../src/BPatch_sourceBlock.C \
86                 ../src/BPatch_basicBlock.C \
87                 ../src/BPatch_basicBlockLoop.C \
88                 ../src/BPatch_edge.C \
89                 ../src/BPatch_loopTreeNode.C \
90                 ../src/BPatch_flowGraph.C \
91                 ../src/BPatch_frame.C \
92                 ../src/BPatch_parRegion.C \
93                 ../src/BPatch_statement.C \
94                 ../src/BPatch_addressSpace.C \
95                 ../src/BPatch_binaryEdit.C \
96                 ../src/MemoryAccess.C \
97                 ../src/dummy.C \
98                 ../src/debug.C \
99                 ../src/ast.C \
100                 ../src/registerSpace.C \
101                 ../src/codegen.C \
102                 ../src/inst.C \
103                 ../src/instPoint.C \
104                 ../src/multiTramp.C \
105                 ../src/baseTramp.C \
106                 ../src/miniTramp.C \
107                 ../src/replacedInstruction.C \
108                 ../src/dyn_thread.C \
109                 ../src/addressSpace.C \
110                 ../src/process.C \
111                 ../src/binaryEdit.C \
112                 ../src/infHeap.C \
113                 ../src/dyn_lwp.C \
114                 ../src/frame.C \
115                 ../src/signalhandler.C \
116                 ../src/signalgenerator.C \
117                                 ../src/eventgate.C \
118                 ../src/callbacks.C \
119                 ../src/mailbox.C \
120                 ../src/EventHandler.C \
121                 ../src/rpcMgr.C \
122                 ../src/rpcMgr-lwp.C \
123                 ../src/rpcMgr-thr.C \
124                 ../src/codeRange.C \
125                 ../src/symtab.C \
126                 ../src/dominator.C \
127                 ../src/image-func.C \
128                 ../src/mapped_object.C \
129                 ../src/mapped_module.C \
130                 ../src/function.C \
131                 ../src/reloc-func.C \
132                 ../src/variable.C \
133                 ../src/util.C \
134                 ../src/BPatch_instruction.C \
135                 ../src/BPatch_asyncEventHandler.C \
136                 ../src/BPatch_eventLock.C \
137                 ../src/parRegion.C \
138                 ../src/liveness.C \
139                 ../src/InstructionCache.C \
140                 ../src/Parsing.C \
141                 ../src/Parsing-arch.C \
142                 ../src/hybridInstrumentation.C \
143                 ../src/hybridOverwrites.C \
144                 ../src/hybridCallbacks.C
145 TO_INC   = ../h
146 PUBLIC_H = BPatch_addressSpace.h \
147            BPatch_basicBlock.h \
148            BPatch_basicBlockLoop.h \
149            BPatch_binaryEdit.h \
150            BPatch_callbacks.h \
151            BPatch_dll.h \
152            BPatch_edge.h \
153            BPatch_eventLock.h \
154            BPatch_flowGraph.h \
155            BPatch_frame.h \
156            BPatch_function.h \
157            BPatch.h \
158            BPatch_hybridAnalysis.h \
159            BPatch_image.h \
160            BPatch_instruction.h \
161            BPatch_loopTreeNode.h \
162            BPatch_memoryAccess_NP.h \
163            BPatch_module.h \
164            BPatch_parRegion.h \
165            BPatch_point.h \
166            BPatch_process.h \
167            BPatch_Set.h \
168            BPatch_snippet.h \
169            BPatch_sourceBlock.h \
170            BPatch_sourceObj.h \
171            BPatch_statement.h \
172            BPatch_thread.h \
173            BPatch_type.h \
174            BPatch_Vector.h
175 #           BPatch_dependenceGraphEdge.h \
176 #           BPatch_dependenceGraphNode.h \
177
178
179 #IGEN_GEN_SRCS = 
180
181 #IGEN_ISRCS    = 
182
183 IFLAGS      += -I../$(PLATFORM) -I../src -I../h -I../../dynutil/h 
184 IFLAGS      += -I../../symtabAPI/h -I../../instructionAPI/h
185 IFLAGS      += -I../../parseAPI/h
186
187 # All that, and we finally get a target...
188 all: $(TARGET) $(EXTRA_LIBS)
189
190
191 # I couldn't figure out how to explicitly instantiate a templated
192 # function whose template arguments are protected members of
193 # LineInformation, but apparently the compiler can.  Since the
194 # function is only used internally by LineInformation, the
195 # templates won't be duplicated.
196 # LineInformation.o : ../../dyninstAPI/src/LineInformation.C
197 #       $(CXX) $(DEBUG_FLAG) $(TFLAGS) -c $<
198     
199 BPatch_templates.o: ../src/BPatch_templates.C
200         @echo "Building $<"
201         $(HIDE_COMP)$(CXX) $(TFLAGS) -c ../src/BPatch_templates.C
202
203 templates0.o: ../src/templates0.C
204         @echo "Building $<"
205         $(HIDE_COMP)$(CXX) $(TFLAGS) -c ../src/templates0.C
206
207 templates1.o: ../src/templates1.C
208         @echo "Building $<"
209         $(HIDE_COMP)$(CXX) $(TFLAGS) -c ../src/templates1.C
210
211 templates2.o: ../src/templates2.C
212         @echo "Building $<"
213         $(HIDE_COMP)$(CXX) $(TFLAGS) -c ../src/templates2.C