Fixed parseThat build issues (include paths for IAPI)
[dyninst.git] / parseThat / Makefile
1 # ----------------------------------------------
2 # Configuration variables taken from ./configure
3 # ----------------------------------------------
4 CPPFLAGS     = -I/fs/dyninst/lam/dyninst/core -I/fs/dyninst/lam/dyninst/core/dyninstAPI/h -I/fs/dyninst/lam/dyninst/core/symtabAPI/h -I/fs/dyninst/lam/dyninst/core/instructionAPI/h -I/fs/dyninst/lam/dyninst/core/common/h -I/fs/dyninst/lam/dyninst/core/dynutil/h -I/fs/dyninst/lam/dyninst/core/external 
5 CXX          = g++
6 CXXFLAGS     = -g -O2
7 DEFINES      = -DPACKAGE_NAME=\"parseThat\" -DPACKAGE_TARNAME=\"parsethat\" -DPACKAGE_VERSION=\"1.0\" -DPACKAGE_STRING=\"parseThat\ 1.0\" -DPACKAGE_BUGREPORT=\"\" -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_BPATCH_PROCESS_H=1 
8 LDFLAGS      = -L/fs/dyninst/lam/dyninst/i386-unknown-linux2.4/lib 
9 LIBS         = 
10
11 prefix       = .
12 PLATFORM    ?= i686-pc-linux-gnu
13 DYNINST_VER  = 5
14
15 INSTALL      = /usr/bin/install -c
16
17 vpath % ./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 OBJDIR       = $(PLATFORM)
44 OBJS         = $(addprefix $(OBJDIR)/, $(SRCS:%.C=%.o))
45
46 CXXFLAGS    += -Wall
47 LIBS        += -ldyninstAPI -lsymtabAPI -liberty
48
49 ifneq (, $(findstring sparc, $(PLATFORM)))
50 LIBS        += -lelf -lstdc++ -lsocket -lrt
51 endif
52
53 ifneq (, $(findstring alpha, $(PLATFORM)))
54 CXXFLAGS    += -pthread
55 endif
56
57 ifneq (, $(findstring ia64, $(PLATFORM)))
58 LIBS        += -ldl
59 endif
60
61 all: ready $(OBJDIR)/parseThat
62
63 install: $(OBJDIR)/parseThat
64         $(INSTALL) -d $(prefix)
65         $(INSTALL) $(OBJDIR)/parseThat $(prefix)/parseThat
66
67 clean:
68         rm -rf $(OBJDIR)
69
70 distclean: clean
71         rm -rf config.log config.status $(OBJDIR) Makefile
72
73 ready:
74         $(INSTALL) -d $(OBJDIR)
75
76 $(OBJDIR)/parseThat: $(OBJS)
77         $(CXX) $(CXXFLAGS) $^ -o $@ $(LDFLAGS) $(LIBS)
78
79 $(OBJS): $(OBJDIR)/%.o: %.C
80         $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(DEFINES) $^ -c -o $@
81
82 alarm: alarm.c liblib.so
83         gcc -Wall -g -o alarm alarm.c liblib.so
84
85 liblib.so: lib.c
86         gcc -Wall -g -shared -o liblib.so lib.c