5 LIBINCDIRS := ../../../liblfds700/inc/
6 LIBBINDIRS := ../../../liblfds700/bin/
11 ##### sources, objects and libraries #####
13 BINARY := $(BINDIR)/$(BINNAME)
15 SOURCES := main.c misc.c \
16 test_lfds700_btree_addonly_unbalanced.c test_lfds700_btree_addonly_unbalanced_alignment.c test_lfds700_btree_addonly_unbalanced_random_adds_fail.c test_lfds700_btree_addonly_unbalanced_random_adds_fail_and_overwrite.c test_lfds700_btree_addonly_unbalanced_random_adds_overwrite.c \
17 test_lfds700_freelist.c test_lfds700_freelist_alignment.c test_lfds700_freelist_popping.c test_lfds700_freelist_popping_and_pushing.c test_lfds700_freelist_pushing.c test_lfds700_freelist_rapid_popping_and_pushing.c \
18 test_lfds700_hash_addonly.c test_lfds700_hash_addonly_alignment.c test_lfds700_hash_addonly_iterate.c test_lfds700_hash_addonly_random_adds_fail.c test_lfds700_hash_addonly_random_adds_fail_and_overwrite.c test_lfds700_hash_addonly_random_adds_overwrite.c \
19 test_lfds700_list_addonly_ordered_singlylinked.c test_lfds700_list_addonly_ordered_singlylinked_alignment.c test_lfds700_list_addonly_ordered_singlylinked_new_ordered.c test_lfds700_list_addonly_ordered_singlylinked_new_ordered_with_cursor.c \
20 test_lfds700_list_addonly_singlylinked_unordered.c test_lfds700_list_addonly_singlylinked_unordered_alignment.c test_lfds700_list_addonly_singlylinked_unordered_new_after.c test_lfds700_list_addonly_singlylinked_unordered_new_end.c test_lfds700_list_addonly_singlylinked_unordered_new_start.c \
21 test_lfds700_porting_abstraction_layer_atomic.c test_lfds700_porting_abstraction_layer_atomic_cas.c test_lfds700_porting_abstraction_layer_atomic_dcas.c test_lfds700_porting_abstraction_layer_atomic_exchange.c \
22 test_lfds700_queue.c test_lfds700_queue_alignment.c test_lfds700_queue_dequeuing.c test_lfds700_queue_enqueuing.c test_lfds700_queue_enqueuing_and_dequeuing.c test_lfds700_queue_enqueuing_and_dequeuing_with_free.c test_lfds700_queue_enqueuing_with_malloc_and_dequeuing_with_free.c test_lfds700_queue_rapid_enqueuing_and_dequeuing.c \
23 test_lfds700_queue_bounded_singleconsumer_singleproducer.c test_lfds700_queue_bounded_singleconsumer_singleproducer_dequeuing.c test_lfds700_queue_bounded_singleconsumer_singleproducer_enqueuing.c test_lfds700_queue_bounded_singleconsumer_singleproducer_enqueuing_and_dequeuing.c \
24 test_lfds700_ringbuffer.c test_lfds700_ringbuffer_reading.c test_lfds700_ringbuffer_reading_and_writing.c test_lfds700_ringbuffer_writing.c \
25 test_lfds700_stack.c test_lfds700_stack_alignment.c test_lfds700_stack_popping.c test_lfds700_stack_popping_and_pushing.c test_lfds700_stack_pushing.c test_lfds700_stack_rapid_popping_and_pushing.c \
26 test_porting_abstraction_layer_get_logical_core_ids.c test_porting_abstraction_layer_thread_start.c test_porting_abstraction_layer_thread_wait.c \
27 util_cmdline.c util_memory_helpers.c util_thread_starter.c
28 OBJECTS := $(patsubst %.c,$(OBJDIR)/%.o,$(notdir $(SOURCES)))
29 SYSLIBS := -lm -lpthread -lrt
32 ##### default paths #####
33 CPATH += $(LIBINCDIRS)
34 LIBRARY_PATH += $(LIBBINDIRS)
43 DGFLAGS := -MM -std=gnu89
46 CFBASE := -c -pthread -std=gnu89 -Wall -Wno-unknown-pragmas
47 CFCOV := -O0 -ggdb -DCOVERAGE -fprofile-arcs -ftest-coverage
48 CFDBG := -O0 -ggdb -D_DEBUG
49 CFPROF := -O0 -ggdb -DPROF -pg
50 CFREL := -O2 -DNDEBUG -finline-functions -Wno-strict-aliasing
51 CFTSAN := -O0 -ggdb -DTSAN -fsanitize=thread -fPIE
54 LFBASE := -pthread -std=gnu89 -Wall -Werror
55 LFCOV := -O0 -fprofile-arcs -ftest-coverage
58 LFREL := -O2 -s -finline-functions
59 LFTSAN := -O0 -fsanitize=thread -pie
62 PFBASE := -b -p -Q $(BINARY) gmon.out
64 ##### variants and libnuma check #####
68 ifeq ($(MAKECMDGOALS),)
73 ifeq ($(MAKECMDGOALS),cov)
79 ifeq ($(MAKECMDGOALS),dbg)
84 ifeq ($(MAKECMDGOALS),prof)
89 ifeq ($(MAKECMDGOALS),rel)
94 ifeq ($(MAKECMDGOALS),tsan)
99 ##### search paths #####
100 vpath %.c $(patsubst %,$(SRCDIR)/%:,$(SRCDIRS))
102 ##### implicit rules #####
104 $(DG) $(DGFLAGS) $< >$(OBJDIR)/$*.d
105 $(CC) $(CFLAGS) -o $@ $<
107 ##### explicit rules #####
108 $(BINARY) : $(OBJECTS)
109 $(LD) -o $(BINARY) $(LFLAGS) $(OBJECTS) $(USRLIBS) $(SYSLIBS)
113 .PHONY : clean cov dbg prof rel tsan
116 @rm -f $(BINDIR)/$(BINNAME) $(OBJDIR)/*.o $(OBJDIR)/*.d $(OBJDIR)/*.gcno
127 ##### dependencies #####