Merge branch 'master' of ssh://git.dyninst.org/pub/dyninst
[dyninst.git] / symtabAPI / 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.17 2008/09/20 03:56:10 jaw Exp $
7 #
8
9 SUITE_NAME      = symtabAPI 
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              += 
15
16 CFLAGS               += $(USEFULWARNINGS) $(DEFINES)
17 CXXFLAGS             += $(USEFULWARNINGS) $(DEFINES)
18 TFLAGS               += $(TCLFRIENDLYWARNINGS) $(DEFINES)
19
20 ifdef GCC_2_95
21 # This may cause problems on Alpha
22 # GCC has a new mangled name squisher (-fsquangle) which can be 
23 # set to "on" by default. This causes linker problems, so we
24 # default to "off".
25 CFLAGS          += -fno-squangle
26 CXXFLAGS        += -fno-squangle
27 TFLAGS          += -fno-squangle
28 endif
29
30 ifdef USE_LIBELF_SO_0
31 CFLAGS += -Dcap_libelf_so_0
32 CXXFLAGS += -Dcap_libelf_so_0
33 else
34 CFLAGS += -D_LARGEFILE64_SOURCE=1 -D__USE_FILE_OFFSET64=1
35 CXXFLAGS += -D_LARGEFILE64_SOURCE=1 -D__USE_FILE_OFFSET64=1
36 endif
37
38 ifndef STATIC_COMPS
39 MYFLAGS += -fPIC
40 endif
41
42 ifndef TARGET
43 ifndef STATIC_COMPS
44 TARGET          = libsymtabAPI.so
45 else
46 TARGET      = libsymtabAPI.a
47 endif
48 endif
49
50 LDFLAGS     += -L../../common/$(PLATFORM) -lcommon
51
52 ifndef NO_LIBDL
53 LDFLAGS += -ldl
54 endif
55
56 ifndef USES_NATIVE_CC
57 LD              = $(GXX)
58 LDFLAGS         += -shared $(G_PTHREAD_LD)
59 CFLAGS          += 
60 CXXFLAGS        += $(G_PTHREAD)
61 else
62 ifeq (solaris,$(findstring solaris,$(PLATFORM)))
63 LDFLAGS         += -G
64 endif #sparc
65 endif #USES_NATIVE
66 TFLAGS          += 
67
68 VPATH        += ../../symtabAPI/h
69
70 SRCS         += ../src/Object.C \
71                 ../src/Aggregate.C \
72                 ../src/Function.C \
73                 ../src/Variable.C \
74                 ../src/Symbol.C \
75                 ../src/LineInformation.C \
76                 ../src/Symtab.C \
77                 ../src/Symtab-edit.C \
78                 ../src/Symtab-lookup.C \
79                 ../src/Symtab-deprecated.C \
80                 ../src/Module.C \
81                 ../src/Region.C \
82                 ../src/Collections.C \
83                 ../src/Type.C \
84                 ../src/AddrLookup.C \
85                 ../src/annotations.C \
86                 ../src/debug.C \
87       ../src/SymtabReader.C 
88 #               ../src/serialize-bin.C \
89 #               ../src/serialize-xml.C 
90
91 TO_INC     = ../h
92 PUBLIC_H   = AddrLookup.h \
93              Archive.h \
94              Symbol.h \
95              Symtab.h \
96              Module.h \
97              Region.h \
98              symutil.h \
99              Type.h \
100              Collections.h \
101              Function.h \
102              Variable.h \
103              LineInformation.h \
104              RangeLookup.h \
105              Aggregate.h \
106              SymtabReader.h
107
108 #IGEN_GEN_SRCS = 
109
110 #IGEN_ISRCS    = 
111
112 ifndef USES_NATIVE_CC
113 ifdef CROSSCOMPILER
114 SYSLIBS         += -lg++ -lstdc++ -lm
115 endif
116 else
117 SYSLIBS         += -ldemangle
118 endif
119
120 IFLAGS       += -I../$(PLATFORM) -I../src -I../h
121
122 ifdef LIBXML2_INC
123 IFLAGS       += -I$(LIBXML2_INC)
124 else
125 IFLAGS       += -I/usr/include/libxml2
126 endif
127
128 # All that, and we finally get a target...
129 all: $(TARGET) $(EXTRA_LIBS)