Removes cyclic dependency between symEval and parseAPI
[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        += -lcommon -ldyninstAPI -lsymtabAPI -liberty -lparseAPI
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 alpha, $(PLATFORM)))
91 CXXFLAGS    += -pthread
92 endif
93
94 ifneq (, $(findstring ia64, $(PLATFORM)))
95 LIBS        += -ldl
96 endif
97
98 all: ready parseThat
99
100 install: parseThat
101         @if [ $(prefix) != "." ]; then                           \
102                 echo "$(INSTALL) -d $(prefix)";                  \
103                 $(INSTALL) -d $(prefix);                         \
104                 echo "$(INSTALL) parseThat $(prefix)/parseThat"; \
105                 $(INSTALL) parseThat $(prefix)/parseThat;        \
106         fi
107
108 clean:
109         rm -f parseThat *.o *.so
110
111 distclean: clean
112         rm Makefile
113
114 ready:
115         @echo "Begin parseThat build for $(PLATFORM)"
116
117 parseThat: $(OBJS)
118         $(CXX) $(CXXFLAGS) $^ -o $@ $(LDFLAGS) $(LIBS)
119
120 $(OBJS): %.o: %.C
121         $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(DEFINES) $^ -c -o $@
122
123 alarm: alarm.c liblib.so
124         gcc -Wall -g -o alarm alarm.c liblib.so
125
126 liblib.so: lib.c
127         gcc -Wall -g -shared -o liblib.so lib.c