More parseThat build issues
[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
49
50 ifneq (, $(findstring solaris, $(PLATFORM)))
51 LIBS        += -ldwarf 
52 LDFLAGS += $(DWARFFLAGS)
53 endif
54
55 ifneq (, $(findstring linux, $(PLATFORM)))
56 LIBS        += -ldwarf
57 LDFLAGS += $(DWARFFLAGS)
58 endif
59
60 ifneq (, $(findstring sparc, $(PLATFORM)))
61 LIBS        += -lelf -lstdc++ -lsocket -lrt
62 LDFLAGS += $(ELFFLAGS)
63 endif
64
65 ifneq (, $(findstring i386, $(PLATFORM)))
66 LIBS        += -linstructionAPI -lelf
67 LDFLAGS += $(ELFFLAGS)
68 endif
69
70 ifneq (, $(findstring i486, $(PLATFORM)))
71 LIBS        += -linstructionAPI -lelf
72 LDFLAGS += $(ELFFLAGS)
73 endif
74
75 ifneq (, $(findstring i586, $(PLATFORM)))
76 LIBS        += -linstructionAPI -lelf
77 LDFLAGS += $(ELFFLAGS)
78 endif
79
80 ifneq (, $(findstring i686, $(PLATFORM)))
81 LIBS        += -linstructionAPI -lelf
82 LDFLAGS += $(ELFFLAGS)
83 endif
84
85 ifneq (, $(findstring x86_64, $(PLATFORM)))
86 LIBS        += -linstructionAPI -lelf
87 LDFLAGS += $(ELFFLAGS)
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         $(INSTALL) -d $(prefix)
102         $(INSTALL) parseThat $(prefix)/parseThat
103
104 clean:
105         rm -f parseThat *.o *.so
106
107 distclean: clean
108         rm Makefile
109
110 ready:
111         @echo "Begin parseThat build for $(PLATFORM)"
112
113 parseThat: $(OBJS)
114         $(CXX) $(CXXFLAGS) $^ -o $@ $(LDFLAGS) $(LIBS)
115
116 $(OBJS): %.o: %.C
117         $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(DEFINES) $^ -c -o $@
118
119 alarm: alarm.c liblib.so
120         gcc -Wall -g -o alarm alarm.c liblib.so
121
122 liblib.so: lib.c
123         gcc -Wall -g -shared -o liblib.so lib.c