9 SPACE := $(NULL) # TRD : necessary trailing space after the close bracket
11 ##### sources, objects and libraries #####
13 BINARY := $(BINDIR)\$(BINNAME).exe
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)/%.obj,$(notdir $(SOURCES)))
29 RESFILE := $(patsubst %.rc,$(OBJDIR)/%.res,$(notdir $(RCFILE)))
30 SYSLIBS := kernel32.lib
32 USRLIBS := ../../../liblfds700/bin/liblfds700.lib
34 ##### default paths fix up #####
35 INCLUDE += ;../../../../liblfds700/inc/
36 LIB += ;../../../../liblfds700/bin/
43 CFBASE := /c /D_CRT_SECURE_NO_WARNINGS /DWIN32_LEAN_AND_MEAN /DUNICODE /D_UNICODE /DUNICODE "/Fd$(BINDIR)\$(BINNAME).pdb" /nologo /W4 /WX
45 CFDBG := /D_DEBUG /Od /Gm /Zi
48 LFBASE := /nologo /subsystem:console /nodefaultlib /nxcompat /wx
49 LFREL := /incremental:no
50 LFDBG := /debug "/pdb:$(BINDIR)\$(BINNAME).pdb"
53 CFLAGS := $(CFBASE) $(CFDBG) /MTd
54 LFLAGS := $(LFBASE) $(LFDBG)
57 ifeq ($(MAKECMDGOALS),librel)
58 CFLAGS := $(CFBASE) $(CFREL) /MT
59 LFLAGS := $(LFBASE) $(LFREL)
63 ifeq ($(MAKECMDGOALS),libdbg)
64 CFLAGS := $(CFBASE) $(CFDBG) /MTd
65 LFLAGS := $(LFBASE) $(LFDBG)
69 ifeq ($(MAKECMDGOALS),dllrel)
70 CFLAGS := $(CFBASE) $(CFREL) /MD
71 LFLAGS := $(LFBASE) $(LFREL)
75 ifeq ($(MAKECMDGOALS),dlldbg)
76 CFLAGS := $(CFBASE) $(CFDBG) /MDd
77 LFLAGS := $(LFBASE) $(LFDBG)
81 ##### search paths #####
82 vpath %.c $(patsubst %,$(SRCDIR)/%;,$(SRCDIRS))
84 ##### implicit rules #####
86 $(CC) $(CFLAGS) "/Fo$@" $<
88 ##### explicit rules #####
89 $(BINARY) : $(OBJECTS) $(USRLIBS)
90 $(LD) $(LFLAGS) $(CLIB) $(SYSLIBS) $(EXTLIBS) $(USRLIBS) $(OBJECTS) /out:$(BINARY)
93 .PHONY : clean librel libdbg dllrel dlldbg
96 @erase /Q $(OBJDIR)\*.obj $(OBJDIR)\*.res $(BINDIR)\$(BINNAME).* $(QUIETLY)
105 # TRD : we fix up the default paths because cl and link require an extra argument per additional path, which is ugly as hell