<commit_before># libcouchbase
# Copyright (C) 2010 - 1012 Couchbase, Inc
# All rights reserved.
#
#   Licensed under the Apache License, Version 2.0 (the "License");
#   you may not use this file except in compliance with the License.
#   You may obtain a copy of the License at
#
#       http://www.apache.org/licenses/LICENSE-2.0
#
#   Unless required by applicable law or agreed to in writing, software
#   distributed under the License is distributed on an "AS IS" BASIS,
#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#   See the License for the specific language governing permissions and
#   limitations under the License.

INSTALL=..\deps
CC_NODEBUG = cl.exe /O2 /DNDEBUG /MD /LD
CC_DEBUG = cl.exe /Od /D_DEBUG /RTC1 /Z7 /LDd /W3 /MDd
CFLAGS = /Iinclude /Iwin32 /Icontrib /Iplugins\io\win32 /I$(INSTALL)\include /Isrc /I. /nologo /W3 /EHsc /DWIN32 /FD /c -D_CRT_SECURE_NO_WARNINGS -DLIBCOUCHBASE_INTERNAL=1
DLLLDFLAGS = /dll /incremental:no /opt:ref,icf /version:1.1
LDFLAGS =  /nologo /LIBPATH:$(INSTALL)\lib
LD = link.exe
RM = del

lib_LTLIBRARIES = libcouchbase.dll libcouchbase_debug.dll
check_PROGRAMS =
bin_PROGRAMS = tools\cbc.exe
example_PROGRAMS = example\pillowfight.exe

libcouchbase_SOURCES = src\arithmetic.c src\base64.c src\behavior.c \
    src\cookie.c src\error.c src\event.c src\flush.c src\get.c \
    src\handler.c src\instance.c src\iofactory_win32.c src\packet.c \
    src\remove.c src\ringbuffer.c src\hashset.c src\server.c src\stats.c \
    src\store.c src\strerror.c src\synchandler.c \
    src\timeout.c src\timings.c src\touch.c src\utilities.c \
    src\wait.c src\gethrtime.c plugins\io\win32\plugin-win32.c src\isasl.c \
    src\compat.c contrib\http_parser\http_parser.c src\http.c \
    src\observe.c src\timer.c src\verbosity.c \
    contrib\libvbucket\crc32.c contrib\libvbucket\cJSON.c \
    contrib\libvbucket\vbucket.c contrib\libvbucket\ketama.c \
    contrib\libvbucket\rfc1321\md5c.c

# Unfortunately nmake is a bit limited in its substitute functions.
# Work around that by using dobj to represent debug object files ;)
libcouchbase_la_OBJECTS=$(libcouchbase_SOURCES:.c=.obj)
libcouchbase_la_debug_OBJECTS=$(libcouchbase_SOURCES:.c=.dobj)

tools_cbc_CXX_SOURCES = tools\cbc.cc \
     tools\cbc-util.cc tools\commandlineparser.cc tools\configuration.cc
tools_cbc_C_SOURCES = win32\getopt.c
tools_cbc_OBJECTS = $(tools_cbc_CXX_SOURCES:.cc=.obj) \
                    $(tools_cbc_C_SOURCES:.c=.obj)

example_pillowfight_CXX_SOURCES =  tools\commandlineparser.cc example\pillowfight.cc
example_pillowfight_C_SOURCES = win32\getopt.c
example_pillowfight_OBJECTS = $(example_pillowfight_CXX_SOURCES:.cc=.obj) \
                              $(example_pillowfight_C_SOURCES:.c=.obj)

all_OBJS=$(libcouchbase_la_OBJECTS) $(libcouchbase_la_debug_OBJECTS) \
   $(tools_cbc_OBJECTS) $(example_pillowfight_OBJECTS)

all: $(lib_LTLIBRARIES) \
     libcouchbase.dll \
     $(bin_PROGRAMS) \
     $(check_PROGRAMS) \
     $(example_PROGRAMS)

check: $(check_PROGRAMS)
    set PATH=$(PATH);$(INSTALL)\bin
    for %%t in ($(check_PROGRAMS)) do %t

libcouchbase.dll: $(libcouchbase_la_OBJECTS)
	$(LD) $(LDFLAGS) $(DLLLDFLAGS) /out:libcouchbase.dll \
          $(libcouchbase_la_OBJECTS) \
          ws2_32.lib

libcouchbase_debug.dll: $(libcouchbase_la_debug_OBJECTS)
	$(LD) $(LDFLAGS)  $(DLLLDFLAGS) /out:libcouchbase_debug.dll \
          $(libcouchbase_la_debug_OBJECTS) \
          ws2_32.lib

tools\cbc.exe: $(tools_cbc_OBJECTS) libcouchbase.dll
	$(LD) $(LDFLAGS) -out:tools\cbc.exe $(tools_cbc_OBJECTS) \
          libcouchbase.lib ws2_32.lib

example\pillowfight.exe: $(example_pillowfight_OBJECTS) libcouchbase_debug.dll
	$(LD) $(LDFLAGS) -out:example\pillowfight.exe $(example_pillowfight_OBJECTS) \
          libcouchbase_debug.lib ws2_32.lib

.SUFFIXES: .c .cc .obj .dobj .res

.c.dobj:
	$(CC_DEBUG) $(CFLAGS) /Fo"$@"  $<

.c.obj:
	$(CC_NODEBUG) $(CFLAGS) /Fo"$@"  $<

.cc.dobj:
	$(CC_DEBUG) $(CFLAGS) /Fo"$@"  $<

.cc.obj:
	$(CC_NODEBUG) $(CFLAGS) /Fo"$@"  $<


clean:
	-del $(all_OBJS) \
		 libcouchbase.dll libcouchbase.exp libcouchbase.lib \
		 libcouchbase_debug.dll libcouchbase_debug.exp libcouchbase_debug.lib \
		 vc100.idb vc100.pdb \
         $(bin_PROGRAMS) $(check_PROGRAMS)

INSTALLDIRS=$(INSTALL) $(INSTALL)\include $(INSTALL)\include\libcouchbase $(INSTALL)\lib $(INSTALL)\bin

install: $(INSTALLDIRS) libcouchbase.dll libcouchbase_debug.dll $(bin_PROGRAMS)
	copy include\libcouchbase\** $(INSTALL)\include\libcouchbase
	-del $(INSTALL)\include\libcouchbase\configuration.h.in
	copy win32\libcouchbase\configuration.h $(INSTALL)\include\libcouchbase
	copy libcouchbase.dll $(INSTALL)\lib
	copy libcouchbase.dll $(INSTALL)\bin
	copy libcouchbase.exp $(INSTALL)\lib
	copy libcouchbase.lib $(INSTALL)\lib
	copy libcouchbase_debug.dll $(INSTALL)\lib
	copy libcouchbase_debug.dll $(INSTALL)\bin
	copy libcouchbase_debug.exp $(INSTALL)\lib
	copy libcouchbase_debug.lib $(INSTALL)\lib
	copy tools\cbc.exe $(INSTALL)\bin

uninstall:
	-del $(INSTALL)\lib\libcouchbase_debug.dll \
         $(INSTALL)\bin\libcouchbase_debug.dll \
         $(INSTALL)\lib\libcouchbase_debug.exp \
         $(INSTALL)\lib\libcouchbase_debug.lib \
         $(INSTALL)\lib\libcouchbase.dll \
         $(INSTALL)\bin\libcouchbase.dll \
         $(INSTALL)\lib\libcouchbase.exp \
         $(INSTALL)\lib\libcouchbase.lib \
         $(INSTALL)\include\libcouchbase\behavior.h \
         $(INSTALL)\include\libcouchbase\callbacks.h \
         $(INSTALL)\include\libcouchbase\configuration.h \
         $(INSTALL)\include\libcouchbase\couchbase.h \
         $(INSTALL)\include\libcouchbase\libevent_io_opts.h \
         $(INSTALL)\include\libcouchbase\timings.h \
         $(INSTALL)\include\libcouchbase\types.h \
         $(INSTALL)\include\libcouchbase\arguments.h \
         $(INSTALL)\include\libcouchbase\visibility.h \
         $(INSTALL)\include\libcouchbase\winsock_io_opts.h \
         $(INSTALL)\bin\cbc.exe
	-rmdir $(INSTALL)\lib $(INSTALL)\bin $(INSTALL)\include\libcouchbase $(INSTALL)\include $(INSTALL)

PKG=$(INSTALL)\dist\libcouchbase$(VERSION)$(ARCH)$(MSVCC_VER)
PKGDIRS=$(PKG)\include $(PKG)\include\libcouchbase $(PKG)\lib $(PKG)\bin

package: $(PKGDIRS) libcouchbase.dll libcouchbase_debug.dll $(bin_PROGRAMS)
	copy include\libcouchbase\** $(PKG)\include\libcouchbase
	-del $(PKG)\include\libcouchbase\configuration.h.in
	copy win32\libcouchbase\configuration.h $(PKG)\include\libcouchbase
	copy libcouchbase.dll $(PKG)\lib
	copy libcouchbase.dll $(PKG)\bin
	copy libcouchbase.exp $(PKG)\lib
	copy libcouchbase.lib $(PKG)\lib
	copy libcouchbase_debug.dll $(PKG)\lib
	copy libcouchbase_debug.dll $(PKG)\bin
	copy libcouchbase_debug.exp $(PKG)\lib
	copy libcouchbase_debug.lib $(PKG)\lib
	copy tools\cbc.exe $(PKG)\bin
	7z a -r $(INSTALL)\libcouchbase$(VERSION)$(ARCH)$(MSVCC_VER).zip $(PKG)

$(INSTALLDIRS) $(PKGDIRS):; -@mkdir $@
<commit_msg>Leave windows packages into workspace<commit_after># libcouchbase
# Copyright (C) 2010 - 1012 Couchbase, Inc
# All rights reserved.
#
#   Licensed under the Apache License, Version 2.0 (the "License");
#   you may not use this file except in compliance with the License.
#   You may obtain a copy of the License at
#
#       http://www.apache.org/licenses/LICENSE-2.0
#
#   Unless required by applicable law or agreed to in writing, software
#   distributed under the License is distributed on an "AS IS" BASIS,
#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#   See the License for the specific language governing permissions and
#   limitations under the License.

INSTALL=..\deps
CC_NODEBUG = cl.exe /O2 /DNDEBUG /MD /LD
CC_DEBUG = cl.exe /Od /D_DEBUG /RTC1 /Z7 /LDd /W3 /MDd
CFLAGS = /Iinclude /Iwin32 /Icontrib /Iplugins\io\win32 /I$(INSTALL)\include /Isrc /I. /nologo /W3 /EHsc /DWIN32 /FD /c -D_CRT_SECURE_NO_WARNINGS -DLIBCOUCHBASE_INTERNAL=1
DLLLDFLAGS = /dll /incremental:no /opt:ref,icf /version:1.1
LDFLAGS =  /nologo /LIBPATH:$(INSTALL)\lib
LD = link.exe
RM = del

lib_LTLIBRARIES = libcouchbase.dll libcouchbase_debug.dll
check_PROGRAMS =
bin_PROGRAMS = tools\cbc.exe
example_PROGRAMS = example\pillowfight.exe

libcouchbase_SOURCES = src\arithmetic.c src\base64.c src\behavior.c \
    src\cookie.c src\error.c src\event.c src\flush.c src\get.c \
    src\handler.c src\instance.c src\iofactory_win32.c src\packet.c \
    src\remove.c src\ringbuffer.c src\hashset.c src\server.c src\stats.c \
    src\store.c src\strerror.c src\synchandler.c \
    src\timeout.c src\timings.c src\touch.c src\utilities.c \
    src\wait.c src\gethrtime.c plugins\io\win32\plugin-win32.c src\isasl.c \
    src\compat.c contrib\http_parser\http_parser.c src\http.c \
    src\observe.c src\timer.c src\verbosity.c \
    contrib\libvbucket\crc32.c contrib\libvbucket\cJSON.c \
    contrib\libvbucket\vbucket.c contrib\libvbucket\ketama.c \
    contrib\libvbucket\rfc1321\md5c.c

# Unfortunately nmake is a bit limited in its substitute functions.
# Work around that by using dobj to represent debug object files ;)
libcouchbase_la_OBJECTS=$(libcouchbase_SOURCES:.c=.obj)
libcouchbase_la_debug_OBJECTS=$(libcouchbase_SOURCES:.c=.dobj)

tools_cbc_CXX_SOURCES = tools\cbc.cc \
     tools\cbc-util.cc tools\commandlineparser.cc tools\configuration.cc
tools_cbc_C_SOURCES = win32\getopt.c
tools_cbc_OBJECTS = $(tools_cbc_CXX_SOURCES:.cc=.obj) \
                    $(tools_cbc_C_SOURCES:.c=.obj)

example_pillowfight_CXX_SOURCES =  tools\commandlineparser.cc example\pillowfight.cc
example_pillowfight_C_SOURCES = win32\getopt.c
example_pillowfight_OBJECTS = $(example_pillowfight_CXX_SOURCES:.cc=.obj) \
                              $(example_pillowfight_C_SOURCES:.c=.obj)

all_OBJS=$(libcouchbase_la_OBJECTS) $(libcouchbase_la_debug_OBJECTS) \
   $(tools_cbc_OBJECTS) $(example_pillowfight_OBJECTS)

all: $(lib_LTLIBRARIES) \
     libcouchbase.dll \
     $(bin_PROGRAMS) \
     $(check_PROGRAMS) \
     $(example_PROGRAMS)

check: $(check_PROGRAMS)
    set PATH=$(PATH);$(INSTALL)\bin
    for %%t in ($(check_PROGRAMS)) do %t

libcouchbase.dll: $(libcouchbase_la_OBJECTS)
	$(LD) $(LDFLAGS) $(DLLLDFLAGS) /out:libcouchbase.dll \
          $(libcouchbase_la_OBJECTS) \
          ws2_32.lib

libcouchbase_debug.dll: $(libcouchbase_la_debug_OBJECTS)
	$(LD) $(LDFLAGS)  $(DLLLDFLAGS) /out:libcouchbase_debug.dll \
          $(libcouchbase_la_debug_OBJECTS) \
          ws2_32.lib

tools\cbc.exe: $(tools_cbc_OBJECTS) libcouchbase.dll
	$(LD) $(LDFLAGS) -out:tools\cbc.exe $(tools_cbc_OBJECTS) \
          libcouchbase.lib ws2_32.lib

example\pillowfight.exe: $(example_pillowfight_OBJECTS) libcouchbase_debug.dll
	$(LD) $(LDFLAGS) -out:example\pillowfight.exe $(example_pillowfight_OBJECTS) \
          libcouchbase_debug.lib ws2_32.lib

.SUFFIXES: .c .cc .obj .dobj .res

.c.dobj:
	$(CC_DEBUG) $(CFLAGS) /Fo"$@"  $<

.c.obj:
	$(CC_NODEBUG) $(CFLAGS) /Fo"$@"  $<

.cc.dobj:
	$(CC_DEBUG) $(CFLAGS) /Fo"$@"  $<

.cc.obj:
	$(CC_NODEBUG) $(CFLAGS) /Fo"$@"  $<


clean:
	-del $(all_OBJS) \
		 libcouchbase.dll libcouchbase.exp libcouchbase.lib \
		 libcouchbase_debug.dll libcouchbase_debug.exp libcouchbase_debug.lib \
		 vc100.idb vc100.pdb \
         $(bin_PROGRAMS) $(check_PROGRAMS)

INSTALLDIRS=$(INSTALL) $(INSTALL)\include $(INSTALL)\include\libcouchbase $(INSTALL)\lib $(INSTALL)\bin

install: $(INSTALLDIRS) libcouchbase.dll libcouchbase_debug.dll $(bin_PROGRAMS)
	copy include\libcouchbase\** $(INSTALL)\include\libcouchbase
	-del $(INSTALL)\include\libcouchbase\configuration.h.in
	copy win32\libcouchbase\configuration.h $(INSTALL)\include\libcouchbase
	copy libcouchbase.dll $(INSTALL)\lib
	copy libcouchbase.dll $(INSTALL)\bin
	copy libcouchbase.exp $(INSTALL)\lib
	copy libcouchbase.lib $(INSTALL)\lib
	copy libcouchbase_debug.dll $(INSTALL)\lib
	copy libcouchbase_debug.dll $(INSTALL)\bin
	copy libcouchbase_debug.exp $(INSTALL)\lib
	copy libcouchbase_debug.lib $(INSTALL)\lib
	copy tools\cbc.exe $(INSTALL)\bin

uninstall:
	-del $(INSTALL)\lib\libcouchbase_debug.dll \
         $(INSTALL)\bin\libcouchbase_debug.dll \
         $(INSTALL)\lib\libcouchbase_debug.exp \
         $(INSTALL)\lib\libcouchbase_debug.lib \
         $(INSTALL)\lib\libcouchbase.dll \
         $(INSTALL)\bin\libcouchbase.dll \
         $(INSTALL)\lib\libcouchbase.exp \
         $(INSTALL)\lib\libcouchbase.lib \
         $(INSTALL)\include\libcouchbase\behavior.h \
         $(INSTALL)\include\libcouchbase\callbacks.h \
         $(INSTALL)\include\libcouchbase\configuration.h \
         $(INSTALL)\include\libcouchbase\couchbase.h \
         $(INSTALL)\include\libcouchbase\libevent_io_opts.h \
         $(INSTALL)\include\libcouchbase\timings.h \
         $(INSTALL)\include\libcouchbase\types.h \
         $(INSTALL)\include\libcouchbase\arguments.h \
         $(INSTALL)\include\libcouchbase\visibility.h \
         $(INSTALL)\include\libcouchbase\winsock_io_opts.h \
         $(INSTALL)\bin\cbc.exe
	-rmdir $(INSTALL)\lib $(INSTALL)\bin $(INSTALL)\include\libcouchbase $(INSTALL)\include $(INSTALL)

PKG=libcouchbase$(VERSION)$(ARCH)$(MSVCC_VER)
PKGDIRS=$(PKG)\include $(PKG)\include\libcouchbase $(PKG)\lib $(PKG)\bin

package: $(PKGDIRS) libcouchbase.dll libcouchbase_debug.dll $(bin_PROGRAMS)
	copy include\libcouchbase\** $(PKG)\include\libcouchbase
	-del $(PKG)\include\libcouchbase\configuration.h.in
	copy win32\libcouchbase\configuration.h $(PKG)\include\libcouchbase
	copy libcouchbase.dll $(PKG)\lib
	copy libcouchbase.dll $(PKG)\bin
	copy libcouchbase.exp $(PKG)\lib
	copy libcouchbase.lib $(PKG)\lib
	copy libcouchbase_debug.dll $(PKG)\lib
	copy libcouchbase_debug.dll $(PKG)\bin
	copy libcouchbase_debug.exp $(PKG)\lib
	copy libcouchbase_debug.lib $(PKG)\lib
	copy tools\cbc.exe $(PKG)\bin
	7z a -r $(PKG).zip $(PKG)

$(INSTALLDIRS) $(PKGDIRS):; -@mkdir $@

{'fraction_non_alphanumeric': 0.13605392867497826, 'fraction_numerical': 0.009857929834734706, 'mean_word_length': 3.8241258741258743, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2688305', 'n_tokens_mistral': 5577, 'n_tokens_neox': 4967, 'n_words': 876}