replace_document: Only force load values for same docid
[xapian.git] / xapian-maintainer-tools / win32msvc / win32_bindings_ruby.mak
bloba870bd1418eec08e15cbdf5bfb5dfd1017cedf4e
1 # Makefile for Microsoft Visual C++ 7.0 (or compatible)
2 # Written by Zsolt Sz. Sztupák by modifying the Python bindings code made by Ulrik Petersen
3 # and Modified by Charlie Hull, Lemur Consulting Ltd.
4 # email: mail AT sztupy DOT hu
6 # Will build the Ruby bindings
8 # Where the core is, relative to the Ruby bindings
9 # Change this to match your environment
10 XAPIAN_CORE_REL_RUBY=..\..\xapian-core$(VERSION_SUFFIX)
12 OUTLIBDIR=$(XAPIAN_CORE_REL_RUBY)\win32\$(XAPIAN_DEBUG_OR_RELEASE)\libs
14 !INCLUDE $(XAPIAN_CORE_REL_RUBY)\win32\config.mak
16 LIB_XAPIAN_OBJS= ".\xapian_wrap.obj"
18 OUTDIR=$(XAPIAN_CORE_REL_RUBY)\win32\$(XAPIAN_DEBUG_OR_RELEASE)\Ruby
19 INTDIR=.\
21 ALL : "$(OUTDIR)\_xapian.so" "$(OUTDIR)\xapian.rb" "$(OUTDIR)\smoketest.rb"
23 CLEAN :
24 -@erase $(LIB_XAPIAN_OBJS)
25 -@erase /Q /s "$(OUTDIR)\$(RUBY_PACKAGE)"
26 -@erase /Q /s "$(OUTDIR)"
27 -@erase *.so
29 CLEANSWIG:
30 -@erase xapian_wrap.cc
31 -@erase xapian_wrap.h
34 DOTEST :
35 cd "$(OUTDIR)"
36 copy "$(ZLIB_BIN_DIR)\zlib1.dll"
37 "$(RUBY_EXE)" -I. smoketest.rb
39 CHECK: ALL DOTEST
41 # currently the bindings fail a test so we need a target that builds DIST without CHECKing
42 # not great and should be fixed in the next release
43 DISTNOCHECK: ALL DISTROOT
44 @echo *** Built Ruby without running tests!!!! ***
46 DIST: CHECK DISTROOT
48 DISTROOT:
49 cd $(MAKEDIR)
50 if not exist "$(OUTDIR)\dist\$(NULL)" mkdir "$(OUTDIR)\dist"
51 if not exist "$(OUTDIR)\dist\docs\$(NULL)" mkdir "$(OUTDIR)\dist\docs"
52 if not exist "$(OUTDIR)\dist\docs\rdocs\$(NULL)" mkdir "$(OUTDIR)\dist\docs\rdocs"
53 if not exist "$(OUTDIR)\dist\docs\examples/$(NULL)" mkdir "$(OUTDIR)\dist\docs\examples"
54 copy "$(OUTDIR)\xapian.rb" "$(OUTDIR)\dist"
55 copy "$(OUTDIR)\_xapian.so" "$(OUTDIR)\dist"
56 if exist docs copy docs\*.htm* "$(OUTDIR)\dist\docs"
57 if exist docs\rdocs xcopy docs\rdocs\*.* "$(OUTDIR)\dist\docs\rdocs" /s
58 if exist docs\examples xcopy docs\examples\*.* "$(OUTDIR)\dist\docs\examples" /s
60 "$(OUTDIR)" :
61 if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
63 CPP_PROJ=$(CPPFLAGS_EXTRA) /GR \
64 /I "$(XAPIAN_CORE_REL_RUBY)" /I "$(XAPIAN_CORE_REL_RUBY)\include" \
65 /I "$(RUBY_INCLUDE)" /I"." \
66 /Fo"$(INTDIR)\\" /Tp$(INPUTNAME)
67 CPP_OBJS=$(XAPIAN_CORE_REL_RUBY)\win32\$(XAPIAN_DEBUG_OR_RELEASE)\
68 CPP_SBRS=.
70 ALL_LINK32_FLAGS=$(LINK32_FLAGS) $(XAPIAN_LIBS) $(RUBY_LIB_DIR)\msvcrt-ruby18.lib "/LIBPATH:$(RUBY_LIB_DIR)"
72 !IF "$(SWIGBUILD)" == "1"
73 xapian_wrap.cc xapian_wrap.h: util.i ..\xapian.i
74 $(SWIG) $(SWIG_FLAGS) -I$(XAPIAN_CORE_REL_RUBY)\include -I..\generic \
75 -c++ \
76 -initname _xapian -ruby \
77 -o xapian_wrap.cc ..\xapian.i
79 !ENDIF
81 "$(OUTDIR)\_xapian.so" : "$(OUTDIR)" $(DEF_FILE) $(LIB_XAPIAN_OBJS)
83 $(LINK32) @<<
84 $(ALL_LINK32_FLAGS) /DLL /out:"$(OUTDIR)\_xapian.so" $(DEF_FLAGS) $(LIB_XAPIAN_OBJS)
87 "$(OUTDIR)\xapian.rb" : ".\xapian.rb"
88 -copy $** "$(OUTDIR)\xapian.rb"
89 $(MANIFEST) "$(OUTDIR)\_xapian.so.manifest" -outputresource:"$(OUTDIR)\_xapian.so;2"
92 "$(OUTDIR)\smoketest.rb" : ".\smoketest.rb"
93 -copy $** "$(OUTDIR)\smoketest.rb"
95 INSTALL : ALL
96 -copy "$(OUTDIR)\xapian.rb" "$(RUBY_RB_DIR)\xapian.rb"
97 -copy "$(OUTDIR)\_xapian.so" "$(RUBY_SO_DIR)\_xapian.so"
99 TEST : INSTALL
100 $(RUBY_EXE) smoketest.rb
102 # Rules
105 ".\xapian_wrap.obj" : ".\xapian_wrap.cc"
106 $(CPP) @<<
107 $(CPP_PROJ) $**
110 .c{$(CPP_OBJS)}.obj::
111 $(CPP) @<<
112 $(CPP_PROJ) $<
115 .cpp{$(CPP_OBJS)}.obj::
116 $(CPP) @<<
117 $(CPP_PROJ) $<
120 .cxx{$(CPP_OBJS)}.obj::
121 $(CPP) @<<
122 $(CPP_PROJ) $<
125 .c{$(CPP_SBRS)}.sbr::
126 $(CPP) @<<
127 $(CPP_PROJ) $<
130 .cpp{$(CPP_SBRS)}.sbr::
131 $(CPP) @<<
132 $(CPP_PROJ) $<
135 .cxx{$(CPP_SBRS)}.sbr::
136 $(CPP) @<<
137 $(CPP_PROJ) $<