fix insnCodeGen::modifyData's 64-bit conversion
[dyninst.git] / parseThat / Makefile.in
1 # ----------------------------------------------
2 # Configuration variables taken from ./configure
3 # ----------------------------------------------
4 CPPFLAGS     = @CPPFLAGS@
5 CXX          = @CXX@
6 CXXFLAGS     = @CXXFLAGS@
7 DEFINES      = @DEFS@
8 LDFLAGS      = @LDFLAGS@
9 DWARFFLAGS      = @DWARFFLAGS@
10 ELFFLAGS      = @ELFFLAGS@
11 EXTRA_LIBS         = @LIBS@
12 DEMANGLER_LINK = @LIBERTYFLAGS@
13 prefix       = @prefix@
14 PLATFORM    ?= @build@
15 DYNINST_VER  = @DYNINST_VER@
16
17 INSTALL      = @INSTALL@
18
19 vpath % @srcdir@/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 ($(DESTDIR),)
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