]> pd.if.org Git - liblfds/blob - liblfds/liblfds7.1.0/test_and_benchmark/libbenchmark/build/msvc_gnumake/makefile
Initial import (all versions, including the new 7.1.0)
[liblfds] / liblfds / liblfds7.1.0 / test_and_benchmark / libbenchmark / build / msvc_gnumake / makefile
1 ##### paths #####
2 BINDIR := ..\..\bin
3 INCDIR := ..\..\inc
4 OBJDIR := ..\..\obj
5 SRCDIR := ..\..\src
6
7 ##### misc #####
8 QUIETLY := 1>nul 2>nul
9 NULL := 
10 SPACE := $(NULL) # TRD : with a trailing space
11
12 ##### sources, objects and libraries #####
13 BINNAME    := libbenchmark
14 LIB_BINARY := $(BINDIR)\$(BINNAME).lib
15 DLL_BINARY := $(BINDIR)\$(BINNAME).dll
16 SRCDIRS    := libbenchmark_benchmarkinstance libbenchmark_benchmarks_btree_au_readn_writen libbenchmark_benchmarkset libbenchmark_benchmarks_freelist_push1_then_pop1 libbenchmark_benchmarks_queue_umm_enqueue1_then_dequeue1 libbenchmark_benchmarksuite libbenchmark_datastructures_btree_au libbenchmark_datastructures_freelist libbenchmark_datastructures_queue_umm libbenchmark_misc libbenchmark_porting_abstraction_layer libbenchmark_results libbenchmark_threadset libbenchmark_topology libbenchmark_topology_node
17 SOURCES    := libbenchmark_benchmarkinstance_cleanup.c libbenchmark_benchmarkinstance_init.c libbenchmark_benchmarkinstance_run.c \
18               libbenchmark_benchmarkset_add.c libbenchmark_benchmarkset_cleanup.c libbenchmark_benchmarkset_gnuplot.c libbenchmark_benchmarkset_init.c libbenchmark_benchmarkset_run.c \
19               libbenchmark_benchmarks_btree_au_gcc_spinlock_atomic_readn_writen.c libbenchmark_benchmarks_btree_au_gcc_spinlock_sync_readn_writen.c libbenchmark_benchmarks_btree_au_liblfds700_lockfree_readn_writen.c libbenchmark_benchmarks_btree_au_liblfds710_lockfree_readn_writen.c libbenchmark_benchmarks_btree_au_msvc_spinlock_readn_writen.c libbenchmark_benchmarks_btree_au_pthread_mutex_readn_writen.c libbenchmark_benchmarks_btree_au_pthread_rwlock_readn_writen.c libbenchmark_benchmarks_btree_au_pthread_spinlock_process_private_readn_writen.c libbenchmark_benchmarks_btree_au_pthread_spinlock_process_shared_readn_writen.c libbenchmark_benchmarks_btree_au_windows_critical_section_readn_writen.c libbenchmark_benchmarks_btree_au_windows_mutex_readn_writen.c \
20               libbenchmark_benchmarks_freelist_gcc_spinlock_atomic_push1_then_pop1.c libbenchmark_benchmarks_freelist_gcc_spinlock_sync_push1_then_pop1.c libbenchmark_benchmarks_freelist_liblfds700_lockfree_push1_then_pop1.c libbenchmark_benchmarks_freelist_liblfds710_lockfree_push1_then_pop1.c libbenchmark_benchmarks_freelist_msvc_spinlock_push1_then_pop1.c libbenchmark_benchmarks_freelist_pthread_mutex_push1_then_pop1.c libbenchmark_benchmarks_freelist_pthread_rwlock_push1_then_pop1.c libbenchmark_benchmarks_freelist_pthread_spinlock_process_private_push1_then_pop1.c libbenchmark_benchmarks_freelist_pthread_spinlock_process_shared_push1_then_pop1.c libbenchmark_benchmarks_freelist_windows_critical_section_push1_then_pop1.c libbenchmark_benchmarks_freelist_windows_mutex_push1_then_pop1.c \
21               libbenchmark_benchmarks_queue_umm_gcc_spinlock_atomic_enqueue1_dequeue1.c libbenchmark_benchmarks_queue_umm_gcc_spinlock_sync_enqueue1_dequeue1.c libbenchmark_benchmarks_queue_umm_liblfds700_lockfree_enqueue1_dequeue1.c libbenchmark_benchmarks_queue_umm_liblfds710_lockfree_enqueue1_dequeue1.c libbenchmark_benchmarks_queue_umm_msvc_spinlock_enqueue1_dequeue1.c libbenchmark_benchmarks_queue_umm_pthread_mutex_enqueue1_dequeue1.c libbenchmark_benchmarks_queue_umm_pthread_rwlock_enqueue1_dequeue1.c libbenchmark_benchmarks_queue_umm_pthread_spinlock_process_private_enqueue1_dequeue1.c libbenchmark_benchmarks_queue_umm_pthread_spinlock_process_shared_enqueue1_dequeue1.c libbenchmark_benchmarks_queue_umm_windows_critical_section_enqueue1_dequeue1.c libbenchmark_benchmarks_queue_umm_windows_mutex_enqueue1_dequeue1.c \
22               libbenchmark_benchmarksuite_add.c libbenchmark_benchmarksuite_cleanup.c libbenchmark_benchmarksuite_gnuplot.c libbenchmark_benchmarksuite_init.c libbenchmark_benchmarksuite_run.c \
23               libbenchmark_datastructure_btree_au_gcc_spinlock_atomic.c libbenchmark_datastructure_btree_au_gcc_spinlock_sync.c libbenchmark_datastructure_btree_au_msvc_spinlock.c libbenchmark_datastructure_btree_au_pthread_mutex.c libbenchmark_datastructure_btree_au_pthread_rwlock.c libbenchmark_datastructure_btree_au_pthread_spinlock_process_private.c libbenchmark_datastructure_btree_au_pthread_spinlock_process_shared.c libbenchmark_datastructure_btree_au_windows_critical_section.c libbenchmark_datastructure_btree_au_windows_mutex.c \
24               libbenchmark_datastructure_freelist_gcc_spinlock_atomic.c libbenchmark_datastructure_freelist_gcc_spinlock_sync.c libbenchmark_datastructure_freelist_msvc_spinlock.c libbenchmark_datastructure_freelist_pthread_mutex.c libbenchmark_datastructure_freelist_pthread_rwlock.c libbenchmark_datastructure_freelist_pthread_spinlock_process_private.c libbenchmark_datastructure_freelist_pthread_spinlock_process_shared.c libbenchmark_datastructure_freelist_windows_critical_section.c libbenchmark_datastructure_freelist_windows_mutex.c \
25               libbenchmark_datastructure_queue_umm_gcc_spinlock_atomic.c libbenchmark_datastructure_queue_umm_gcc_spinlock_sync.c libbenchmark_datastructure_queue_umm_msvc_spinlock.c libbenchmark_datastructure_queue_umm_pthread_mutex.c libbenchmark_datastructure_queue_umm_pthread_rwlock.c libbenchmark_datastructure_queue_umm_pthread_spinlock_process_private.c libbenchmark_datastructure_queue_umm_pthread_spinlock_process_shared.c libbenchmark_datastructure_queue_umm_windows_critical_section.c libbenchmark_datastructure_queue_umm_windows_mutex.c \
26               libbenchmark_misc_globals.c libbenchmark_misc_pal_helpers.c libbenchmark_misc_query.c \
27               libbenchmark_porting_abstraction_layer_populate_topology.c libbenchmark_porting_abstraction_layer_print_string.c \
28               libbenchmark_results_cleanup.c libbenchmark_results_compare.c libbenchmark_results_get_result.c libbenchmark_results_init.c libbenchmark_results_put_result.c \
29               libbenchmark_threadset_cleanup.c libbenchmark_threadset_init.c libbenchmark_threadset_operations.c \
30               libbenchmark_topology_cleanup.c libbenchmark_topology_compare.c libbenchmark_topology_init.c libbenchmark_topology_insert.c libbenchmark_topology_iterate.c libbenchmark_topology_lpsets.c libbenchmark_topology_numa.c libbenchmark_topology_query.c libbenchmark_topology_string.c \
31               libbenchmark_topology_node_cleanup.c libbenchmark_topology_node_compare.c libbenchmark_topology_node_init.c
32 OBJECTS    := $(patsubst %.c,$(OBJDIR)/%.obj,$(notdir $(SOURCES)))
33 SYSLIBS    := kernel32.lib
34 USRLIBS    := ..\..\..\..\..\liblfds7.0.0\liblfds700\bin\liblfds700.lib ..\..\..\..\liblfds710\bin\liblfds710.lib ..\..\..\libshared\bin\libshared.lib
35
36 ##### default paths fix up #####
37 INCDIRS := $(patsubst %,%;,$(INCDIR))
38 INCLUDE += $(subst $(SPACE),,$(INCDIRS))
39
40 ##### tools #####
41 CC                    := cl
42 CFLAGS_MANDATORY      := /c "/Fd$(BINDIR)\$(BINNAME).pdb" /wd 4068
43 CFLAGS_OPTIONAL       := /DWIN32_LEAN_AND_MEAN /DUNICODE /D_UNICODE /nologo /W4 /WX
44 CFLAGS_MANDATORY_DBG  := /Od /Gm /Zi /D_DEBUG
45 CFLAGS_MANDATORY_REL  := /Ox /DNDEBUG
46
47 AR                    := lib
48 ARFLAGS               :=
49 ARFLAGS_MANDATORY     := /subsystem:console
50 ARFLAGS_OPTIONAL      := /nologo /wx /verbose
51
52 LD                    := link
53 LDFLAGS_MANDATORY     := /def:$(BINNAME).def /dll /nodefaultlib /subsystem:console
54 LDFLAGS_OPTIONAL      := /nologo /nxcompat /wx
55 LDFLAGS_MANDATORY_DBG := /debug "/pdb:$(BINDIR)\$(BINNAME).pdb"
56 LDFLAGS_MANDATORY_REL := /incremental:no
57
58 ##### variants #####
59 ifeq ($(MAKECMDGOALS),) # TRD : default to debug lib
60   CFLAGS_MANDATORY  += $(CFLAGS_MANDATORY_DBG) /MTd
61   LDFLAGS_MANDATORY += $(LDFLAGS_MANDATORY_DBG)
62   CLIB              := libcmtd.lib
63 endif
64
65 ifeq ($(MAKECMDGOALS),libdbg)
66   CFLAGS_MANDATORY  += $(CFLAGS_MANDATORY_DBG) /MTd
67   LDFLAGS_MANDATORY += $(LDFLAGS_MANDATORY_DBG)
68   CLIB              := libcmtd.lib
69 endif
70
71 ifeq ($(MAKECMDGOALS),librel)
72   CFLAGS_MANDATORY  += $(CFLAGS_MANDATORY_REL) /MT
73   LDFLAGS_MANDATORY += $(LDFLAGS_MANDATORY_REL)
74   CLIB              := libcmt.lib
75 endif
76
77 ifeq ($(MAKECMDGOALS),dlldbg)
78   CFLAGS_MANDATORY  += $(CFLAGS_MANDATORY_DBG) /MDd
79   LDFLAGS_MANDATORY += $(LDFLAGS_MANDATORY_DBG)
80   CLIB              := msvcrtd.lib
81 endif
82
83 ifeq ($(MAKECMDGOALS),dllrel)
84   CFLAGS_MANDATORY  += $(CFLAGS_MANDATORY_REL) /MD
85   LDFLAGS_MANDATORY += $(LDFLAGS_MANDATORY_REL)
86   CLIB              := msvcrt.lib
87 endif
88
89 ##### search paths #####
90 vpath %.c $(patsubst %,$(SRCDIR)/%;,$(SRCDIRS))
91
92 ##### implicit rules #####
93 $(OBJDIR)/%.obj : %.c
94         $(CC) $(CFLAGS_OPTIONAL) $(CFLAGS) $(CFLAGS_MANDATORY) "/Fo$@" $<
95
96 ##### explicit rules #####
97 $(LIB_BINARY) : $(OBJECTS)
98         $(AR) $(ARFLAGS_OPTIONAL) $(AFLAGS) $(ARFLAGS_MANDATORY) $(OBJECTS) /out:$(LIB_BINARY)
99
100 $(DLL_BINARY) : $(OBJECTS)
101         $(LD) $(LDFLAGS_OPTIONAL) $(LFLAGS) $(LDFLAGS_MANDATORY) $(CLIB) $(SYSLIBS) $(USRLIBS) $(OBJECTS) /out:$(DLL_BINARY)
102
103 ##### phony #####
104 .PHONY : clean librel libdbg dllrel dlldbg
105
106 clean : 
107         @erase /Q $(BINDIR)\$(BINNAME).* $(OBJDIR)\*.obj $(QUIETLY)
108
109 dllrel : $(DLL_BINARY)
110 dlldbg : $(DLL_BINARY)
111
112 librel : $(LIB_BINARY)
113 libdbg : $(LIB_BINARY)
114
115 ##### notes #####
116 # /wd 4068 : turn off "unknown pragma" warning
117