summaryrefslogtreecommitdiff
path: root/Lib/ruby/Makefile.swig
blob: a7f3ae3d225e7b4c72d50844c1e26aa4af230ee0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File : Makefile.swig
# Makefile for a SWIG module.  Use this file if you are
# producing a Ruby extension for general use or distribution.
#
# 1.  Prepare extconf.rb.
# 2.  Modify this file as appropriate.
# 3.  Type 'make -f Makefile.swig' to generate wrapper code and Makefile.
# 4.  Type 'make' to build your extension.
# 5.  Type 'make install' to install your extension.
# 

MODULE    = yourmodule
FEATURE   = $(MODULE)
INTERFACE = $(MODULE).i
RUBY      = ruby
SWIG      = swig

# for C extension
SWIGOPT   = -ruby
WRAPPER   = $(MODULE)_wrap.c

## for C++ extension
#SWIGOPT   = -ruby -c++
#WRAPPER   = $(MODULE)_wrap.cc


swigall: $(WRAPPER) Makefile

$(WRAPPER): $(INTERFACE)
	$(SWIG) $(SWIGOPT) -o $@ $(INTERFACE)

Makefile: extconf.rb
	$(RUBY) extconf.rb
	@if [ -f Makefile ] ; then\
		echo "include Makefile.swig" >> Makefile;\
	fi

swigclean:
	@if [ -f Makefile ] ; then\
		make -f Makefile clean;\
	fi
	rm -f Makefile $(WRAPPER)