]> pd.if.org Git - liblfds/blob - liblfds/liblfds7.0.0/test/build/sdk_for_windows_7_and_gnumake/makefile
Initial import (all versions, including the new 7.1.0)
[liblfds] / liblfds / liblfds7.0.0 / test / build / sdk_for_windows_7_and_gnumake / makefile
1 ##### paths #####
2 BINDIR := ..\..\bin
3 OBJDIR := ..\..\obj
4 SRCDIR := ..\..\src
5
6 ##### misc #####
7 QUIETLY := 1>nul 2>nul
8 NULL    := 
9 SPACE   := $(NULL) # TRD : necessary trailing space after the close bracket
10
11 ##### sources, objects and libraries #####
12 BINNAME := test
13 BINARY  := $(BINDIR)\$(BINNAME).exe
14 SRCDIRS := .
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
31 EXTLIBS := 
32 USRLIBS := ../../../liblfds700/bin/liblfds700.lib
33
34 ##### default paths fix up #####
35 INCLUDE += ;../../../../liblfds700/inc/
36 LIB     += ;../../../../liblfds700/bin/
37
38 ##### tools #####
39 MAKE    := make
40 MFLAGS  := 
41
42 CC      := cl
43 CFBASE  := /c /D_CRT_SECURE_NO_WARNINGS /DWIN32_LEAN_AND_MEAN /DUNICODE /D_UNICODE /DUNICODE "/Fd$(BINDIR)\$(BINNAME).pdb" /nologo /W4 /WX
44 CFREL   := /DNDEBUG /Ox
45 CFDBG   := /D_DEBUG /Od /Gm /Zi
46
47 LD      := link
48 LFBASE  := /nologo /subsystem:console /nodefaultlib /nxcompat /wx
49 LFREL   := /incremental:no
50 LFDBG   := /debug "/pdb:$(BINDIR)\$(BINNAME).pdb"
51
52 ##### variants #####
53 CFLAGS  := $(CFBASE) $(CFDBG) /MTd
54 LFLAGS  := $(LFBASE) $(LFDBG)
55 CLIB    := libcmtd.lib
56
57 ifeq ($(MAKECMDGOALS),librel)
58   CFLAGS := $(CFBASE) $(CFREL) /MT
59   LFLAGS := $(LFBASE) $(LFREL)
60   CLIB   := libcmt.lib
61 endif
62
63 ifeq ($(MAKECMDGOALS),libdbg)
64   CFLAGS := $(CFBASE) $(CFDBG) /MTd
65   LFLAGS := $(LFBASE) $(LFDBG)
66   CLIB   := libcmtd.lib
67 endif
68
69 ifeq ($(MAKECMDGOALS),dllrel)
70   CFLAGS := $(CFBASE) $(CFREL) /MD
71   LFLAGS := $(LFBASE) $(LFREL)
72   CLIB   := msvcrt.lib
73 endif
74
75 ifeq ($(MAKECMDGOALS),dlldbg)
76   CFLAGS := $(CFBASE) $(CFDBG) /MDd
77   LFLAGS := $(LFBASE) $(LFDBG)
78   CLIB   := msvcrtd.lib
79 endif
80
81 ##### search paths #####
82 vpath %.c $(patsubst %,$(SRCDIR)/%;,$(SRCDIRS))
83
84 ##### implicit rules #####
85 $(OBJDIR)/%.obj : %.c
86         $(CC) $(CFLAGS) "/Fo$@" $<
87
88 ##### explicit rules #####
89 $(BINARY) : $(OBJECTS) $(USRLIBS)
90         $(LD) $(LFLAGS) $(CLIB) $(SYSLIBS) $(EXTLIBS) $(USRLIBS) $(OBJECTS) /out:$(BINARY)
91
92 ##### phony #####
93 .PHONY : clean librel libdbg dllrel dlldbg
94
95 clean : 
96         @erase /Q $(OBJDIR)\*.obj $(OBJDIR)\*.res $(BINDIR)\$(BINNAME).* $(QUIETLY)
97
98 dlldbg : $(BINARY)
99 dllrel : $(BINARY)
100
101 libdbg : $(BINARY)
102 librel : $(BINARY)
103
104 ##### notes #####
105 # TRD : we fix up the default paths because cl and link require an extra argument per additional path, which is ugly as hell
106