summaryrefslogtreecommitdiff
path: root/tools/Makefile.osx
blob: 7ce66ab590b3268c5a71f732d0d472201f759a64 (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
TARGETS = ivyprobe ivythroughput ivyperf #ivyprobe_efence 
OMP_TARGET= ivyprobe_omp ivythroughput_omp 
OMPLIB = -lgomp -lpthread
OMPCC = gcc-mp-4.4  
OMPCPP =  g++-mp-4.4
CC = gcc -g -Wall
CPP='g++'
#CC = $(OMPCC)
#CPP= $(OMPCPP)

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

.SUFFIXES: .c .o

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


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

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

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

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



ivyprobe_omp: ivyprobe.o ../src/libivy_omp.a
	$(OMPCC)  $(CFLAGS) $(FPIC) $(EXTRAINC) $(PCREINCL) -o $@ ivyprobe.o -L../src -livy_omp $(PCRELIB) $(EXTRALIB) $(OMPLIB) -lgcc_s.1

ivythroughput_omp: ivythroughput.o ../src/libivy_omp.a
	$(OMPCPP)  $(CFLAGS) $(FPIC)$(EXTRAINC) $(PCREINCL) -o $@ ivythroughput.o -L../src -livy_omp -lpcrecpp $(PCRELIB) $(EXTRALIB) $(OMPLIB) -lgcc_s.1

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

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


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

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

install: installbins 
install_omp: installbins_omp


clean:
	rm -fR $(TARGETS) *~ *.o