Merge branch 'dyn_pc_integration' of ssh://wasabi.cs.wisc.edu/p/paradyn/development...
[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 LIBS         = @LIBS@
12
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 -lsymtabAPI -lparseAPI -lpcontrol -lstackwalk -lcommon -liberty
49
50 ifneq (, $(findstring solaris, $(PLATFORM)))
51 LIBS        += -ldwarf  -lelf
52 LDFLAGS += $(DWARFFLAGS)
53 LDFLAGS += $(ELFFLAGS)
54 endif
55
56 ifneq (, $(findstring linux, $(PLATFORM)))
57 LIBS        += -ldwarf -lelf
58 LDFLAGS += $(DWARFFLAGS)
59 LDFLAGS += $(ELFFLAGS)
60 endif
61
62 ifneq (, $(findstring sparc, $(PLATFORM)))
63 LIBS        += -lstdc++ -lsocket -lrt
64 endif
65
66 ifneq (, $(findstring i386, $(PLATFORM)))
67 LIBS        += -linstructionAPI
68 endif
69
70 ifneq (, $(findstring i486, $(PLATFORM)))
71 LIBS        += -linstructionAPI
72 endif
73
74 ifneq (, $(findstring i586, $(PLATFORM)))
75 LIBS        += -linstructionAPI
76 endif
77
78 ifneq (, $(findstring i686, $(PLATFORM)))
79 LIBS        += -linstructionAPI
80 endif
81
82 ifneq (, $(findstring x86_64, $(PLATFORM)))
83 LIBS        += -linstructionAPI
84 endif
85
86 ifneq (, $(findstring ppc32_linux, $(PLATFORM)))
87 LIBS        += -linstructionAPI
88 endif
89
90 ifneq (, $(findstring ppc32_bgp, $(PLATFORM)))
91 LIBS        += -linstructionAPI
92 endif
93
94 ifneq (, $(findstring ppc64_linux, $(PLATFORM)))
95 LIBS        += -linstructionAPI
96 CXXFLAGS    += -m64
97 endif
98
99 ifneq (, $(findstring alpha, $(PLATFORM)))
100 CXXFLAGS    += -pthread
101 endif
102
103 ifneq (, $(findstring ia64, $(PLATFORM)))
104 LIBS        += -ldl
105 endif
106
107 ifeq (freebsd, $(findstring freebsd, $(PLATFORM)))
108 LIBS        += -lpthread
109 endif
110
111 all: ready parseThat
112
113 install: parseThat
114         @if [ $(prefix) != "." ]; then                           \
115                 echo "$(INSTALL) -d $(prefix)";                  \
116                 $(INSTALL) -d $(prefix);                         \
117                 echo "$(INSTALL) parseThat $(prefix)/parseThat"; \
118                 $(INSTALL) parseThat $(prefix)/parseThat;        \
119         fi
120
121 clean:
122         rm -f parseThat *.o *.so
123
124 distclean: clean
125         rm Makefile config.log config.status
126
127 ready:
128         @echo "Begin parseThat build for $(PLATFORM)"
129
130 parseThat: $(OBJS)
131         $(CXX) $(CXXFLAGS) $^ -o $@ $(LDFLAGS) $(LIBS)
132
133 $(OBJS): %.o: %.C
134         $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(DEFINES) $^ -c -o $@
135
136 alarm: alarm.c liblib.so
137         gcc -Wall -g -o alarm alarm.c liblib.so
138
139 liblib.so: lib.c
140         gcc -Wall -g -shared -o liblib.so lib.c