forked from skaphan/stmmap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
76 lines (48 loc) · 1.56 KB
/
Makefile
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
# You need to install the boost library from www.boost.org.
IDIR =/usr/local/boost_1_41_0
#IDIR = ../boost_1_41_0
CC=gcc
CPP=g++
THREADFLAGS = -DTHREADS
CFLAGS = $(shell ./autoconfigure)
CPLUSPLUSFLAGS = $(CFLAGS) -I$(IDIR)
NLIBSTEM = stm
THLIBSTEM = stm-th
NLIB = lib$(NLIBSTEM).a
THLIB = lib$(THLIBSTEM).a
LIBDIR = -L.
LIBS=-lpthread
THLIBS = -l$(THLIBSTEM) $(LIBS)
NLIBS = -l$(NLIBSTEM) $(LIBS)
OBJ = stm.o stmalloc.o atomic-compat.o
NOBJ = AVLtree.o segalloc.o example.o
THOBJ = segalloc.th.o AVLtree.th.o example.th.o
TARGETS = autoconfigure stmtest1 stmtest2
all: $(TARGETS)
# this is a single-threaded test program that uses absolute pointers
# in the shared segment. Uses pthreads library for thread local storage
# which is the same in both single- and multi-threaded versions.
#
stmtest1: autoconfigure example.o $(NLIB)
$(CC) -o $@ example.o $(LIBDIR) $(NLIBS)
# this is a multi-threading test program that uses position-independent
# relative pointers in the shared segment.
#
stmtest2: autoconfigure example.th.o $(THLIB)
$(CPP) -o $@ example.th.o $(LIBDIR) $(THLIBS)
%.o: %.c Makefile
$(CC) -c $(CFLAGS) $< -o $@
# The two following rules must appear in the order they appear here.
%.th.o: %.cpp Makefile
$(CPP) -c $(CPLUSPLUSFLAGS) $(THREADFLAGS) $< -o $@
%.th.o: %.c Makefile
$(CC) -c $(CFLAGS) $(THREADFLAGS) $< -o $@
%: %.c
$(CC) -o $@ [email protected]
$(NLIB): autoconfigure $(NLIB)($(OBJ) $(NOBJ))
ranlib $(NLIB)
$(THLIB): autoconfigure $(THLIB)($(OBJ) $(THOBJ))
ranlib $(THLIB)
.PHONY: clean
clean:
rm -f *.o *~ core $(TARGETS) $(NLIB) $(THLIB)