Turned off excess debugging statements in RoseInsnFactory::convert
[dyninst.git] / parseThat / Makefile
1 # ----------------------------------------------
2 # Configuration variables taken from ./configure
3 # ----------------------------------------------
4 CPPFLAGS     = -I/scratch/bill/dyninst/include 
5 CXX          = g++
6 CXXFLAGS     = -g -O2
7 DEFINES      = -DPACKAGE_NAME=\"parseThat\" -DPACKAGE_TARNAME=\"parsethat\" -DPACKAGE_VERSION=\"1.0\" -DPACKAGE_STRING=\"parseThat\ 1.0\" -DPACKAGE_BUGREPORT=\"\" -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_BPATCH_PROCESS_H=1
8 LDFLAGS      = -L/scratch/bill/dyninst/lib 
9 DWARFFLAGS      = 
10 ELFFLAGS      = 
11 EXTRA_LIBS         = -ldl 
12 DEMANGLER_LINK = 
13 prefix       = /scratch/bill/dyninst
14 PLATFORM    ?= x86_64-unknown-linux-gnu
15 DYNINST_VER  = 5
16
17 INSTALL      = /usr/bin/install -c
18
19 vpath % ./src
20
21 # -------------------------------------------
22 # Begin Makefile based on variables set above
23 # -------------------------------------------
24 .PHONY: clean ready
25
26 SRCS         = parseThat.C \
27                config.C \
28                ipc.C \
29                record.C \
30                strlist.C \
31                reglist.C \
32                log.C \
33                utils.C \
34                sha1.C \
35                dyninstCore.C
36
37 ifeq ($(DYNINST_VER), 5)
38 SRCS        += dyninstCompat.v5.C
39 endif
40
41 ifeq ($(DYNINST_VER), 4)
42 SRCS        += dyninstCompat.v4.C
43 endif
44
45 OBJS         = $(SRCS:%.C=%.o)
46
47 CXXFLAGS    += -Wall
48 LIBS        += -ldyninstAPI -lstackwalk -lpcontrol -lpatchAPI -lparseAPI -linstructionAPI -lsymtabAPI -lsymLite -ldynDwarf -ldynElf -lcommon -pthread
49
50 # The echo will remove the quotes
51 LIBS += $(shell echo $(DEMANGLER_LINK))
52
53 ifneq (x,x$(strip $(ELFFLAGS)))
54 LIBS += $(ELFFLAGS) 
55 endif
56 ifneq (x,x$(strip $(DWARFFLAGS)))
57 LIBS += $(DWARFFLAGS)
58 endif
59
60 ifeq (freebsd, $(findstring freebsd, $(PLATFORM)))
61 LIBS        += -lpthread
62 endif
63
64 ifeq (ppc64_linux, $(findstring ppc64_linux, $(PLATFORM)))
65 CXXFLAGS        += -m64
66 CFLAGS          += -m64
67 endif
68
69 ifneq (x$(DESTDIR),x)
70 TARGETDIR = $(DESTDIR)/$(prefix)
71 else
72 TARGETDIR = $(prefix)
73 endif
74
75 LIBS += ${EXTRA_LIBS}
76
77 all: ready parseThat
78
79 install: $(TARGETDIR)/parseThat
80
81 $(TARGETDIR)/parseThat: parseThat
82         @if [ $(TARGETDIR) != "." ]; then                           \
83                 echo "$(INSTALL) -d $(TARGETDIR)";                  \
84                 $(INSTALL) -d $(TARGETDIR);                         \
85                 echo "$(INSTALL) parseThat $(TARGETDIR)/parseThat"; \
86                 $(INSTALL) parseThat $(TARGETDIR)/parseThat;        \
87         fi
88
89 clean:
90         rm -f parseThat *.o *.so
91
92 distclean: clean
93         rm Makefile config.log config.status
94
95 ready:
96         @echo "Begin parseThat build for $(PLATFORM)"
97
98 parseThat: $(OBJS)
99         $(CXX) $(CXXFLAGS) $^ -o $@ $(LDFLAGS) $(LIBS)
100
101 $(OBJS): %.o: %.C
102         $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(DEFINES) $^ -c -o $@
103
104 alarm: alarm.c liblib.so
105         gcc -Wall -g -o alarm alarm.c liblib.so
106
107 liblib.so: lib.c
108         gcc -Wall -g -shared -o liblib.so lib.c