bench.sh: don't automatically log to file
[model-checker-benchmarks.git] / queue / makefile
1 # -fno-schedule-insns -fno-rerun-loop-opt are a workaround for a compiler error in 4.2
2 # -Wno-unused-parameter
3
4 CC      = g++
5 CFLAGS  = -g -O3 -fopenmp -fno-schedule-insns -fno-schedule-insns2 -W -Wall #-Wno-unused-parameter
6 CFLAGS += `pkg-config --cflags glib-2.0`
7 #CFLAGS += -march=i686
8 #CFLAGS += -march=core2
9 LDFLAGS = -lgomp
10 LDFLAGS+= `pkg-config --libs glib-2.0`
11 # g_blocking_queue also depends on gthread-2.0
12 CFLAGS_GTHREAD = `pkg-config gthread-2.0`
13 LDFLAGS_GTHREAD = `pkg-config --libs gthread-2.0`
14
15 #compile-time parameters
16 ifdef N_PRODUCERS
17 CFLAGS += -DN_PRODUCERS=$(N_PRODUCERS)
18 endif
19 ifdef N_CONSUMERS
20 CFLAGS += -DN_CONSUMERS=$(N_CONSUMERS)
21 endif
22 ifdef N_ITERATIONS
23 CFLAGS += -DN_ITERATIONS=$(N_ITERATIONS)
24 endif
25 ifdef QUEUE_SIZE
26 CFLAGS += -DQUEUE_SIZE=$(QUEUE_SIZE)
27 endif
28
29
30 LOCK_FREE_Q_INCLUDE = \
31     array_lock_free_queue.h \
32     array_lock_free_queue_impl.h
33
34 BLOCKING_Q_INCLUDE = \
35     g_blocking_queue.h \
36     g_blocking_queue_impl.h
37
38 LOCK_FREE_SINGLE_PRODUCER_Q_INCLUDE = \
39     array_lock_free_queue_single_producer.h \
40     array_lock_free_queue_single_producer_impl.h
41
42 SHARED_INCLUDE = \
43     atomic_ops.h
44
45 all : test_lock_free_q  test_lock_free_single_producer_q test_blocking_q
46
47 test_lock_free_q : test_lock_free_q.o
48         $(CC) $(OBJS) -o $@ $@.o $(LDFLAGS)
49
50 test_blocking_q : test_blocking_q.o
51         $(CC) $(OBJS) -o $@ $@.o $(LDFLAGS) $(LDFLAGS_GTHREAD)
52
53 test_lock_free_single_producer_q : test_lock_free_single_producer_q.o
54             $(CC) $(OBJS) -o $@ $@.o $(LDFLAGS)
55     
56 test_lock_free_q.o : test_lock_free_q.cpp $(SHARED_INCLUDE) $(LOCK_FREE_Q_INCLUDE)
57         $(CC) -c $< $(CFLAGS)
58
59 test_lock_free_single_producer_q.o : test_lock_free_single_producer_q.cpp $(SHARED_INCLUDE) $(LOCK_FREE_SINGLE_PRODUCER_Q_INCLUDE)
60         $(CC) -c $< $(CFLAGS)
61     
62 test_blocking_q.o: test_blocking_q.cpp $(SHARED_INCLUDE) $(BLOCKING_Q_INCLUDE)
63         $(CC) -c $< $(CFLAGS) $(CFLAGS_GTHREAD) 
64
65 clean:
66         rm test_lock_free_q test_blocking_q test_lock_free_single_producer_q; rm *.o
67