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