1 # -fno-schedule-insns -fno-rerun-loop-opt are a workaround for a compiler error in 4.2
2 # -Wno-unused-parameter
5 CFLAGS = -g -O3 -fopenmp -fno-schedule-insns -fno-schedule-insns2 -W -Wall #-Wno-unused-parameter
6 CFLAGS += `pkg-config --cflags glib-2.0`
8 #CFLAGS += -march=core2
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`
15 #compile-time parameters
17 CFLAGS += -DN_PRODUCERS=$(N_PRODUCERS)
20 CFLAGS += -DN_CONSUMERS=$(N_CONSUMERS)
23 CFLAGS += -DN_ITERATIONS=$(N_ITERATIONS)
26 CFLAGS += -DQUEUE_SIZE=$(QUEUE_SIZE)
30 LOCK_FREE_Q_INCLUDE = \
31 array_lock_free_queue.h \
32 array_lock_free_queue_impl.h
34 BLOCKING_Q_INCLUDE = \
36 g_blocking_queue_impl.h
38 LOCK_FREE_SINGLE_PRODUCER_Q_INCLUDE = \
39 array_lock_free_queue_single_producer.h \
40 array_lock_free_queue_single_producer_impl.h
45 all : test_lock_free_q test_lock_free_single_producer_q test_blocking_q
47 test_lock_free_q : test_lock_free_q.o
48 $(CC) $(OBJS) -o $@ $@.o $(LDFLAGS)
50 test_blocking_q : test_blocking_q.o
51 $(CC) $(OBJS) -o $@ $@.o $(LDFLAGS) $(LDFLAGS_GTHREAD)
53 test_lock_free_single_producer_q : test_lock_free_single_producer_q.o
54 $(CC) $(OBJS) -o $@ $@.o $(LDFLAGS)
56 test_lock_free_q.o : test_lock_free_q.cpp $(SHARED_INCLUDE) $(LOCK_FREE_Q_INCLUDE)
59 test_lock_free_single_producer_q.o : test_lock_free_single_producer_q.cpp $(SHARED_INCLUDE) $(LOCK_FREE_SINGLE_PRODUCER_Q_INCLUDE)
62 test_blocking_q.o: test_blocking_q.cpp $(SHARED_INCLUDE) $(BLOCKING_Q_INCLUDE)
63 $(CC) -c $< $(CFLAGS) $(CFLAGS_GTHREAD)
66 rm test_lock_free_q test_blocking_q test_lock_free_single_producer_q; rm *.o