summaryrefslogtreecommitdiff
path: root/tools/Makefile
blob: 7f4ed3a9f1f2e4fe564ea86fa523a9e8b70db2fe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
CC = gcc -g -Wall
CPP='g++'
BUGGY_DEBIAN_OPTION = -DPCRECPP_EXP_DEFN="" -DPCRECPP_EXP_DECL=""
OMPCFLAGS = $(CFLAGS) -fopenmp -DOPENMP=1
OMPLIB = -lgomp -lpthread
GLIBINC = `pkg-config --cflags glib-2.0`
GLIBLIB = `pkg-config --libs glib-2.0`
GLUTINC = -I/usr/include -I.
GLUTLIB = -L. -lglut -lGLU -lGL -lX11 -lXmu 




TARGETS = ivyprobe ivythroughput ivyperf ivyglibprobe ivyxtprobe #ivyprobe_efence 
OMP_TARGET= ivyprobe_omp ivythroughput_omp 

PCRELIB = `pcre-config --libs`
EXTRALIB= -L../src
EXTRAINC=-I../src

.SUFFIXES: .c .o

.c.o:
	$(CC) $(CFLAGS) $(EXTRAINC) -c $*.c
.cpp.o:
	$(CPP) $(CFLAGS) $(EXTRAINC) $(BUGGY_DEBIAN_OPTION) -c $*.cpp


all: $(TARGETS)
omp: $(OMP_TARGET)

ivyprobe: ivyprobe.o ../src/libivy.a
	$(CC)  $(CFLAGS) $(EXTRAINC) -o $@ ivyprobe.o -L. -livy $(PCRELIB) $(EXTRALIB) 

ivythroughput: ivythroughput.o ../src/libivy.a
	$(CPP)  $(CFLAGS) $(EXTRAINC) -o $@ ivythroughput.o -L. -livy -lpcrecpp $(PCRELIB) $(EXTRALIB) 

ivyprobe_efence: ivyprobe.o ../src/libivy.a
	$(CPP)  $(CFLAGS) $(EXTRAINC) -o $@ ivyprobe.o -L. -livy -lpcrecpp $(PCRELIB) $(EXTRALIB) -lefence



ivyprobe_omp: ivyprobe.o ../src/libivy_omp.a
	$(CC)  $(CFLAGS) $(EXTRAINC) -o $@ ivyprobe.o -L. -livy_omp $(PCRELIB) $(EXTRALIB) $(OMPLIB)

ivythroughput_omp: ivythroughput.o ../src/libivy_omp.a
	$(CPP)  $(CFLAGS) $(EXTRAINC) -o $@ ivythroughput.o -L. -livy_omp -lpcrecpp $(PCRELIB) $(EXTRALIB) $(OMPLIB)

ivyprobe.o : ivyprobe.c 
	$(CC)  $(CFLAGS) $(EXTRAINC) $(REGEXP) -c ivyprobe.c -o $@

ivyperf: ivyperf.o ../src/libivy.a
	$(CC)  $(CFLAGS) $(EXTRAINC) -o $@ ivyperf.o -L. -livy $(PCRELIB) $(EXTRALIB)

ivyxtprobe.o : ivyprobe.c
	$(CC)  $(CFLAGS) $(EXTRAINC) $(REGEXP) -DXTMAINLOOP -c ivyprobe.c -o $@ $(XTINC)

ivyxtprobe: ivyxtprobe.o ../src/libxtivy.a
	$(CC) -o $@ ivyxtprobe.o -L. $(XTLIB) -lxtivy  $(PCRELIB) $(EXTRALIB)

ivyglibprobe.o : ivyprobe.c
	$(CC)  $(CFLAGS) $(EXTRAINC) $(REGEXP) -DGLIBMAINLOOP -c ivyprobe.c -o ivyglibprobe.o $(GLIBINC)

ivyglibprobe: ivyglibprobe.o ../src/libglibivy.a
	$(CC) -o ivyglibprobe ivyglibprobe.o -L. $(GLIBLIB) -lglibivy $(PCRELIB) $(EXTRALIB)

ivyglutprobe.o : ivyprobe.c
	$(CC)  $(CFLAGS) $(EXTRAINC) $(REGEXP) -DGLUTMAINLOOP -c ivyprobe.c -o ivyglutprobe.o $(GLUTINC)

ivyglutprobe: ivyglutprobe.o ../src/libglutivy.a
	$(CC) -o ivyglutprobe ivyglutprobe.o -L. $(GLUTLIB) -lglutivy $(PCRELIB) $(EXTRALIB

installbins: $(TARGETS)
	test -d $(DESTDIR)$(PREFIX)/bin || mkdirhier $(DESTDIR)$(PREFIX)/bin
	install -m755 ivyprobe $(DESTDIR)$(PREFIX)/bin

installbins_omp:  $(OMP_TARGET)
	test -d $(DESTDIR)$(PREFIX)/bin || mkdirhier $(DESTDIR)$(PREFIX)/bin
	install -m755 ivyprobe_omp $(DESTDIR)$(PREFIX)/bin

install: installbins 
install_omp: installbins_omp


clean:
	rm -fR $(TARGETS) $(OMP_TARGET) *~