afsmonitor: avoid double free on exit
[openafs.git] / src / mcas / Makefile.mcas
1
2 ARCH      := SPARC
3 DEBUGGING := -DNDEBUG
4
5 ifeq ($(ARCH),INTEL)
6 CC          := gcc
7 CFLAGS      := -O3 -DINTEL -fomit-frame-pointer -march=i686
8 LDFLAGS     := -lpthread
9 endif
10
11 ifeq ($(ARCH),PPC)
12 CC          := cc_r
13 CFLAGS      := -O3 -DPPC -q64 -w
14 LDFLAGS     := -lpthread -q64
15 ASFLAGS     := -a64
16 endif
17
18 ifeq ($(ARCH),IA64)
19 CC          := gcc
20 CFLAGS      := -O3 -DIA64 -fomit-frame-pointer
21 LDFLAGS     := -lpthread
22 endif
23
24 ifeq ($(ARCH),MIPS)
25 CC          := gcc
26 CFLAGS      := -O3 -DMIPS -fomit-frame-pointer
27 LDFLAGS     := -lpthread
28 endif
29
30 ifeq ($(ARCH),SPARC)
31 CC          := /opt/SUNWspro/bin/cc
32 CFLAGS      := -xO3 -DSPARC sparc_mcas.il -xarch=v9b
33 LDFLAGS     := -DSPARC sparc_mcas.il -xarch=v9b -lthread -lrt
34 endif
35
36 ifeq ($(ARCH),ALPHA)
37 CC          := cc
38 CFLAGS      := -accept vaxc_keywords -O3 -DALPHA
39 CFLAGS      += -fomit-frame-pointer -DWEAK_MEM_ORDER
40 LDFLAGS     := -lpthread 
41 endif
42
43 CFLAGS      += $(DEBUGGING)
44 COMMON_DEPS += Makefile $(wildcard *.h)
45
46 GC_HARNESS_TARGETS := skip_lock_perlist skip_lock_pernode skip_lock_perpointer
47 GC_HARNESS_TARGETS += skip_cas skip_mcas
48
49 GC_HARNESS_TARGETS += bst_lock_fraser bst_lock_manber bst_lock_kung
50 GC_HARNESS_TARGETS += bst_mcas
51
52 GC_HARNESS_TARGETS += rb_lock_concurrentwriters rb_lock_serialisedwriters
53 GC_HARNESS_TARGETS += rb_lock_mutex
54
55 TARGETS    := $(GC_HARNESS_TARGETS)
56 TARGETS    += rb_stm_fraser rb_stm_herlihy rb_stm_lock
57 TARGETS    += skip_stm_fraser skip_stm_herlihy skip_stm_lock
58
59 all: $(TARGETS) replay
60
61 clean:
62         rm -f $(TARGETS) replay *~ core *.o *.a
63
64 replay: %: %.c $(COMMON_DEPS)
65         $(CC) $(CFLAGS) -c -o $(patsubst %.c,%.o,$<) $<
66         $(CC) -o $@ $(patsubst %.c,%.o,$<) $(LDFLAGS)
67
68 tree_mcas.o: tree_mcas.c mcas.c $(COMMON_DEPS)
69         $(CC) $(CFLAGS) -c ${srcdir}/tree_mcas.c
70 skip_lock_perpointer.o: skip_lock.c $(COMMON_DEPS)
71         $(CC) $(CFLAGS) -DTINY_MTX -c -o skip_lock_perpointer.o ${srcdir}/skip_lock.c
72 skip_lock_pernode.o: skip_lock.c $(COMMON_DEPS)
73         $(CC) $(CFLAGS) -c -o skip_lock_pernode.o ${srcdir}/skip_lock.c
74 skip_lock_perlist.o: skip_lock.c $(COMMON_DEPS)
75         $(CC) $(CFLAGS) -DFAT_MTX -c -o skip_lock_perlist.o ${srcdir}/skip_lock.c
76 skip_mcas.o: skip_mcas.c mcas.c $(COMMON_DEPS)
77         $(CC) $(CFLAGS) -c ${srcdir}/skip_mcas.c
78
79 %.o: %.c $(COMMON_DEPS)
80         $(CC) $(CFLAGS) -c -o $@ $<
81
82 skip_stm_lock: skip_stm.o stm_lock.o set_harness.o ptst.o gc.o
83         $(CC) -o $@ $^ $(LDFLAGS)
84 skip_stm_fraser: skip_stm.o stm_fraser.o set_harness.o ptst.o gc.o
85         $(CC) -o $@ $^ $(LDFLAGS)
86 skip_stm_herlihy: skip_stm.o stm_herlihy.o set_harness.o ptst.o gc.o
87         $(CC) -o $@ $^ $(LDFLAGS)
88
89 rb_stm_lock: rb_stm.o stm_lock.o set_harness.o ptst.o gc.o
90         $(CC) -o $@ $^ $(LDFLAGS)
91 rb_stm_fraser: rb_stm.o stm_fraser.o set_harness.o ptst.o gc.o
92         $(CC) -o $@ $^ $(LDFLAGS)
93 rb_stm_herlihy: rb_stm.o stm_herlihy.o set_harness.o ptst.o gc.o
94         $(CC) -o $@ $^ $(LDFLAGS)
95
96 $(GC_HARNESS_TARGETS): %: %.o set_harness.o ptst.o gc.o
97         $(CC) -o $@ $^ $(LDFLAGS)