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
21 ALL
: "$(OUTDIR)\_xapian.so" "$(OUTDIR)\xapian.rb" "$(OUTDIR)\smoketest.rb"
24 -@erase
$(LIB_XAPIAN_OBJS
)
25 -@erase
/Q
/s
"$(OUTDIR)\$(RUBY_PACKAGE)"
26 -@erase
/Q
/s
"$(OUTDIR)"
30 -@erase xapian_wrap.
cc
36 copy
"$(ZLIB_BIN_DIR)\zlib1.dll"
37 "$(RUBY_EXE)" -I. smoketest.rb
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
!!!! ***
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
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
)\
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 \
76 -initname _xapian
-ruby \
77 -o xapian_wrap.
cc ..\xapian.i
81 "$(OUTDIR)\_xapian.so" : "$(OUTDIR)" $(DEF_FILE
) $(LIB_XAPIAN_OBJS
)
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"
96 -copy
"$(OUTDIR)\xapian.rb" "$(RUBY_RB_DIR)\xapian.rb"
97 -copy
"$(OUTDIR)\_xapian.so" "$(RUBY_SO_DIR)\_xapian.so"
100 $(RUBY_EXE
) smoketest.rb
105 ".\xapian_wrap.obj" : ".\xapian_wrap.cc"
110 .c
{$(CPP_OBJS
)}.obj
::
115 .
cpp{$(CPP_OBJS
)}.obj
::
120 .
cxx{$(CPP_OBJS
)}.obj
::
125 .c
{$(CPP_SBRS
)}.sbr
::
130 .
cpp{$(CPP_SBRS
)}.sbr
::
135 .
cxx{$(CPP_SBRS
)}.sbr
::