Fix parseThat configure so we don't depend on DYNINST_ROOT
[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 LIBS         = @LIBS@
10
11 prefix       = @prefix@
12 PLATFORM    ?= @build@
13 DYNINST_VER  = @DYNINST_VER@
14
15 INSTALL      = @INSTALL@
16
17 vpath % @srcdir@/src
18
19 # -------------------------------------------
20 # Begin Makefile based on variables set above
21 # -------------------------------------------
22 .PHONY: clean ready
23
24 SRCS         = parseThat.C \
25                config.C \
26                ipc.C \
27                record.C \
28                strlist.C \
29                reglist.C \
30                log.C \
31                utils.C \
32                sha1.C \
33                dyninstCore.C
34
35 ifeq ($(DYNINST_VER), 5)
36 SRCS        += dyninstCompat.v5.C
37 endif
38
39 ifeq ($(DYNINST_VER), 4)
40 SRCS        += dyninstCompat.v4.C
41 endif
42
43 OBJS         = $(SRCS:%.C=%.o)
44
45 CXXFLAGS    += -Wall
46 LIBS        += -lcommon -ldyninstAPI -lsymtabAPI -liberty
47
48 ifneq (, $(findstring sparc, $(PLATFORM)))
49 LIBS        += -lelf -lstdc++ -lsocket -lrt
50 endif
51
52 ifneq (, $(findstring alpha, $(PLATFORM)))
53 CXXFLAGS    += -pthread
54 endif
55
56 ifneq (, $(findstring ia64, $(PLATFORM)))
57 LIBS        += -ldl
58 endif
59
60 all: ready parseThat
61
62 install: parseThat
63         $(INSTALL) -d $(prefix)
64         $(INSTALL) parseThat $(prefix)/parseThat
65
66 clean:
67         rm -f parseThat *.o *.so
68
69 distclean: clean
70         rm Makefile
71
72 ready:
73         @echo "Begin parseThat build for $(PLATFORM)"
74
75 parseThat: $(OBJS)
76         $(CXX) $(CXXFLAGS) $^ -o $@ $(LDFLAGS) $(LIBS)
77
78 $(OBJS): %.o: %.C
79         $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(DEFINES) $^ -c -o $@
80
81 alarm: alarm.c liblib.so
82         gcc -Wall -g -o alarm alarm.c liblib.so
83
84 liblib.so: lib.c
85         gcc -Wall -g -shared -o liblib.so lib.c