Skip to content
Newer
Older
100644 128 lines (102 sloc) 4.75 KB
a4397f3 @trondn Fix up NMakefile
trondn authored
1 # libvbucket
2 # Copyright (C) 2010 - 1012 Couchbase, Inc
0a44a37 @trondn Add support for building with msvc using nmake
trondn authored
3 # All rights reserved.
4 #
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
8 #
9 # http://www.apache.org/licenses/LICENSE-2.0
10 #
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
16
a4397f3 @trondn Fix up NMakefile
trondn authored
17 CC_NODEBUG = cl.exe /O2 /DNDEBUG /MD /LD
18 CC_DEBUG = cl.exe /Od /D_DEBUG /RTC1 /Z7 /LDd /W3 /MDd
463f12d @avsej make test more portable (for windows)
avsej authored
19 CFLAGS = /Iinclude /I. /Iwin32 /nologo /W3 /EHsc /DWIN32 /FD /c -D_CRT_SECURE_NO_WARNINGS -DBUILDING_LIBVBUCKET=1
a4397f3 @trondn Fix up NMakefile
trondn authored
20 LDFLAGS = /nologo /dll /incremental:no /opt:ref,icf /version:1.0
21 LD = link.exe
22 RM = del
0a44a37 @trondn Add support for building with msvc using nmake
trondn authored
23
463f12d @avsej make test more portable (for windows)
avsej authored
24 libvbucket_SOURCES= src\crc32.c src\cJSON.c src\vbucket.c src\ketama.c src\rfc1321\md5c.c
a4397f3 @trondn Fix up NMakefile
trondn authored
25 vbucketkeygen_SOURCES = src\vbucketkeygen.c
463f12d @avsej make test more portable (for windows)
avsej authored
26 testketama_SOURCES = tests\testketama.c src\ketama.c src\rfc1321\md5c.c
a4397f3 @trondn Fix up NMakefile
trondn authored
27 regression_SOURCES = tests\regression.c
28 testapp_SOURCES = tests\testapp.c
29 vbuckettool_SOURCES=src\vbuckettool.c
0a44a37 @trondn Add support for building with msvc using nmake
trondn authored
30
6b344b1 @trondn Fix compilation on win32 with msdev
trondn authored
31
a4397f3 @trondn Fix up NMakefile
trondn authored
32 # Unfortunately nmake is a bit limited in its substitute functions.
33 # Work around that by using dobj to represent debug object files ;)
34 libvbucket_la_OBJECTS=$(libvbucket_SOURCES:.c=.obj)
35 libvbucket_la_debug_OBJECTS=$(libvbucket_SOURCES:.c=.dobj)
6b344b1 @trondn Fix compilation on win32 with msdev
trondn authored
36
463f12d @avsej make test more portable (for windows)
avsej authored
37 vbucketkeygen_OBJECTS=$(vbuckettool_SOURCES:.c=.dobj)
38 testketama_OBJECTS=$(testketama_SOURCES:.c=.dobj)
39 regression_OBJECTS=$(regression_SOURCES:.c=.dobj)
40 testapp_OBJECTS=$(testapp_SOURCES:.c=.dobj)
41 vbuckettool_OBJECTS=$(vbuckettool_SOURCES:.c=.dobj)
6b344b1 @trondn Fix compilation on win32 with msdev
trondn authored
42
a4397f3 @trondn Fix up NMakefile
trondn authored
43 all_OBJS=$(vbucketkeygen_OBJECTS) $(testketama_OBJECTS) \
44 $(testketama_OBJECTS) $(regression_OBJECTS) \
45 $(testapp_OBJECTS) $(vbuckettool_OBJECTS) \
46 $(libvbucket_la_OBJECTS) $(libvbucket_la_debug_OBJECTS)
045e223 @avsej CCBC-8 Remove libhashkit dependency
avsej authored
47
a4397f3 @trondn Fix up NMakefile
trondn authored
48 check_PROGRAMS = testapp.exe regression.exe testketama.exe
49 bin_PROGRAMS = vbuckettool.exe vbucketkeygen.exe
6b344b1 @trondn Fix compilation on win32 with msdev
trondn authored
50
a4397f3 @trondn Fix up NMakefile
trondn authored
51 all: libvbucket_debug.dll \
52 libvbucket.dll \
53 $(bin_PROGRAMS)
0a44a37 @trondn Add support for building with msvc using nmake
trondn authored
54
a4397f3 @trondn Fix up NMakefile
trondn authored
55 check: $(check_PROGRAMS)
463f12d @avsej make test more portable (for windows)
avsej authored
56 set srcdir=.
57 for %%t in ($(check_PROGRAMS)) do %t
6b344b1 @trondn Fix compilation on win32 with msdev
trondn authored
58
a4397f3 @trondn Fix up NMakefile
trondn authored
59 libvbucket.dll: $(libvbucket_la_OBJECTS)
60 $(LD) $(LDFLAGS) /out:libvbucket.dll $(libvbucket_la_OBJECTS)
8e8a491 @avsej CCBC-17 Implement ketama distribution algorithm
avsej authored
61
a4397f3 @trondn Fix up NMakefile
trondn authored
62 libvbucket_debug.dll: $(libvbucket_la_debug_OBJECTS)
63 $(LD) $(LDFLAGS) /out:libvbucket_debug.dll $(libvbucket_la_debug_OBJECTS)
0a44a37 @trondn Add support for building with msvc using nmake
trondn authored
64
a4397f3 @trondn Fix up NMakefile
trondn authored
65 vbucketkeygen.exe: $(vbucketkeygen_OBJECTS) libvbucket.dll
66 $(LD) -out:vbucketkeygen.exe $(vbucketkeygen_OBJECTS) libvbucket.lib
0a44a37 @trondn Add support for building with msvc using nmake
trondn authored
67
a4397f3 @trondn Fix up NMakefile
trondn authored
68 testketama.exe: $(testketama_OBJECTS) libvbucket_debug.dll
69 $(LD) -out:testketama.exe $(testketama_OBJECTS) libvbucket_debug.lib
0a44a37 @trondn Add support for building with msvc using nmake
trondn authored
70
a4397f3 @trondn Fix up NMakefile
trondn authored
71 regression.exe: $(regression_OBJECTS) libvbucket_debug.dll
72 $(LD) -out:regression.exe $(regression_OBJECTS) libvbucket_debug.lib
73
74 testapp.exe: $(testapp_OBJECTS) libvbucket_debug.dll
75 $(LD) -out:testapp.exe $(testapp_OBJECTS) libvbucket_debug.lib
76
77 vbuckettool.exe: $(vbuckettool_OBJECTS) libvbucket.dll
78 $(LD) -out:vbuckettool.exe $(vbuckettool_OBJECTS) libvbucket.lib
79
80 .SUFFIXES: .c .obj .dobj .res
81
82 .c.dobj:
83 $(CC_DEBUG) $(CFLAGS) /Fo"$@" $<
84
85 .c.obj:
86 $(CC_NODEBUG) $(CFLAGS) /Fo"$@" $<
0a44a37 @trondn Add support for building with msvc using nmake
trondn authored
87
88 clean:
a4397f3 @trondn Fix up NMakefile
trondn authored
89 -del $(all_OBJECTS) \
90 libvbucket.dll libvbucket.exp libvbucket.lib \
91 libvbucket_debug.dll libvbucket_debug.exp libvbucket_debug.lib \
92 vc100.idb vc100.pdb \
93 $(bin_PROGRAMS) $(check_PROGRAMS)
94
95 INSTALL=..\deps
96 INSTALLDIRS=$(INSTALL) $(INSTALL)\include $(INSTALL)\include\libvbucket $(INSTALL)\lib $(INSTALL)\bin
0a44a37 @trondn Add support for building with msvc using nmake
trondn authored
97
a4397f3 @trondn Fix up NMakefile
trondn authored
98 install: $(INSTALLDIRS) libvbucket.dll libvbucket_debug.dll $(bin_PROGRAMS)
99 copy include\libvbucket\** $(INSTALL)\include\libvbucket
100 copy libvbucket.dll $(INSTALL)\lib
101 copy libvbucket.dll $(INSTALL)\bin
102 copy libvbucket.exp $(INSTALL)\lib
103 copy libvbucket.lib $(INSTALL)\lib
104 copy libvbucket_debug.dll $(INSTALL)\lib
105 copy libvbucket_debug.dll $(INSTALL)\bin
106 copy libvbucket_debug.exp $(INSTALL)\lib
107 copy libvbucket_debug.lib $(INSTALL)\lib
108 copy vbucketkeygen.exe $(INSTALL)\bin
109 copy vbuckettool.exe $(INSTALL)\bin
110
111
112 uninstall:
113 -del $(INSTALL)\lib\libvbucket_debug.dll \
114 $(INSTALL)\bin\libvbucket_debug.dll \
115 $(INSTALL)\lib\libvbucket_debug.exp \
116 $(INSTALL)\lib\libvbucket_debug.lib \
117 $(INSTALL)\lib\libvbucket.dll \
118 $(INSTALL)\bin\libvbucket.dll \
119 $(INSTALL)\lib\libvbucket.exp \
120 $(INSTALL)\lib\libvbucket.lib \
121 $(INSTALL)\include\libvbucket\vbucket.h \
122 $(INSTALL)\include\libvbucket\visibility.h \
123 $(INSTALL)\bin\vbucketkeygen.exe \
124 $(INSTALL)\bin\vbuckettool.exe
125 -rmdir $(INSTALL)\lib $(INSTALL)\bin $(INSTALL)\include\libvbucket $(INSTALL)\include $(INSTALL)
126
127 $(INSTALL) $(INSTALL)\include $(INSTALL)\include\libvbucket $(INSTALL)\lib $(INSTALL)\bin:; -@mkdir $@
Something went wrong with that request. Please try again.