Makefile.am 4.41 KB
Newer Older
Uwe Schulzweida's avatar
Uwe Schulzweida committed
1
2
3
4
## Process this file with automake to produce Makefile.in
#
SWIGCDILIB = cdilib.i
SWIGCDIOBJ = cdiobj.i
5
BINDINGS   =
6

7
INTERFACES_FILES = ruby/cdilib_wrap.c ruby/cdiobj_wrap.cpp ruby/testLib.rb \
8
9
10
11
12
13
14
15
16
17
18
	ruby/testObj.rb \
	\
	python/cdilib_wrap.c python/cdiobj_wrap.cpp python/testLib.py \
	python/testObj.py python/setupObj.py python/setupLib.py \
	python/setup.py python/table.py python/CdiLib.py \
	python/CdiObj.py \
	\
	CdiInfo.cpp \
	\
	f2003/bindGen.rb

19
20
EXTRA_DIST = $(SWIGCDIOBJ) $(SWIGCDILIB) $(INTERFACES_FILES)

21
22
23
if CREATE_INTERFACES
BINDINGS += help
endif
Uwe Schulzweida's avatar
Uwe Schulzweida committed
24
25
26
#
bin_PROGRAMS =
noinst_PROGRAMS = 
27
noinst_LTLIBRARIES = 
28
if CREATE_INTERFACES
Uwe Schulzweida's avatar
Uwe Schulzweida committed
29
noinst_PROGRAMS += CdiInfo
30
noinst_LTLIBRARIES += libcdipp.la
Uwe Schulzweida's avatar
Uwe Schulzweida committed
31
32
endif
#
33
locallibs = $(abs_top_builddir)/src/.libs/libcdi.so @LTLIBOBJS@ @NETCDF_LIBS@ @SZLIB_LIBS@
34
35

libcdipp_la_SOURCES = cdi.cpp cdi.hpp
Ralf Mueller's avatar
Ralf Mueller committed
36
libcdipp_la_LIBADD  = $(top_builddir)/src/libcdi.la
Uwe Schulzweida's avatar
Uwe Schulzweida committed
37
libcdipp_la_LDFLAGS = @NETCDF_LIBS@ @SZLIB_LIBS@ $(LDFLAGS)
38

Ralf Mueller's avatar
Ralf Mueller committed
39
40
CdiInfo_SOURCES     = CdiInfo.cpp
CdiInfo_LDADD       = libcdipp.la
Uwe Schulzweida's avatar
Uwe Schulzweida committed
41
CdiInfo_LDFLAGS     = @NETCDF_LIBS@ @SZLIB_LIBS@ $(LDFLAGS)
42
#
Uwe Schulzweida's avatar
Uwe Schulzweida committed
43
#
44
if ENABLE_RUBY
Uwe Schulzweida's avatar
Uwe Schulzweida committed
45
46
47
BINDINGS += rubyObj
# Ruby ====================================================
rubyLibMakefile:
48
	cd ruby; CFLAGS="$(CFLAGS)" LIBS="$(LIBS)" LDFLAGS="$(locallibs) $(LDFLAGS)" INCFLAGS="-I../../src" ruby extconfLib.rb
Uwe Schulzweida's avatar
Uwe Schulzweida committed
49
50

rubyLibWrapper: cdilib.i
51
if ENABLE_SWIG
Uwe Schulzweida's avatar
Uwe Schulzweida committed
52
53
54
55
56
57
58
59
60
61
62
63
64
	$(SWIG) -ruby -module CdiLib -o ruby/cdilib_wrap.c $(AM_CPPFLAGS) cdilib.i
endif

rubyLib: rubyLibWrapper rubyLibMakefile
	@cd ruby; make

rubyLibTest: rubyLib
	@cd ruby; ruby testLib.rb
# =========================================================
rubyObjMakefile:
	cd ruby; CFLAGS="$(CFLAGS)" LIBS="$(LIBS)" LDFLAGS="$(LDFLAGS)" INCFLAGS="-I../" ruby extconfObj.rb

rubyObjWrapper: cdiobj.i
65
if ENABLE_SWIG
Uwe Schulzweida's avatar
Uwe Schulzweida committed
66
67
68
69
70
71
72
73
74
75
76
77
78
	$(SWIG) -ruby -c++ -module CdiObj -o ruby/cdiobj_wrap.cpp $(AM_CPPFLAGS) cdiobj.i
endif

rubyObj: rubyObjWrapper rubyObjMakefile
	@cd ruby; make

rubyObjTest: rubyObj
	@cd ruby; ruby testObj.rb

rubyObjInstall: rubyObj
	@cd ruby; make install
endif
# =========================================================
79
if ENABLE_PYTHON
80
BINDINGS += pythonObj
Uwe Schulzweida's avatar
Uwe Schulzweida committed
81
82
# Python ==================================================
pythonLibWrapper: cdilib.i
83
if ENABLE_SWIG
Uwe Schulzweida's avatar
Uwe Schulzweida committed
84
85
86
87
88
89
90
91
92
	$(SWIG) -python -module CdiLib -o python/cdilib_wrap.c $(AM_CPPFLAGS) cdilib.i
endif

pythonLib: pythonLibWrapper
	@cd python; CFLAGS="$(CFLAGS)" LIBS="$(LIBS)" LDFLAGS="$(LDFLAGS)" INCFLAGS="-I../../src" python setupLib.py build_ext --inplace

pythonLibTest: pythonLib
	@cd python; python testLib.py
# =========================================================
93
python/cdiobj_wrap.cpp: cdiobj.i
94
if ENABLE_SWIG
Uwe Schulzweida's avatar
Uwe Schulzweida committed
95
96
97
	$(SWIG) -python -c++ -module CdiObj -o python/cdiobj_wrap.cpp $(AM_CPPFLAGS) cdiobj.i
endif

98
pythonObj: python/cdiobj_wrap.cpp
99
	cd python; CC="$(CC)" CXX="$(CXX)" BUILDLIBDIR="$(top_builddir)/src/.libs" LIBDIR=$(libdir) CFLAGS="$(CFLAGS)" LIBS="$(LIBS)" LDFLAGS="-L../../src/.libs $(LDFLAGS)" INCFLAGS="-I../" python setupObj.py build_ext --inplace
Uwe Schulzweida's avatar
Uwe Schulzweida committed
100
101
102
103
104

pythonObjTest: pythonObj
	@cd python; python testObj.py

pythonObjInstall: pythonObj
105
	cd python; CC="$(CC)" CXX="$(CXX)" BUILDLIBDIR="$(top_builddir)/src/.libs" LIBDIR=$(libdir) CFLAGS="$(CFLAGS)" LIBS="$(LIBS)" LDFLAGS="-L../../src/.libs $(LDFLAGS)" INCFLAGS="-I../" python setupObj.py install --prefix=$(prefix)
Uwe Schulzweida's avatar
Uwe Schulzweida committed
106
107
108
endif
# =========================================================
help:
109
110
	@echo "#=====================================================#"
	@echo "# EXPERIMENTAL FEATURE ===============================#"
Uwe Schulzweida's avatar
Uwe Schulzweida committed
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
	@echo "#=====================================================#"
	@echo "Bindings for: python ruby"
	@echo "(please exchange <lang> with the corresponding language)"
	@echo "#=====================================================#"
	@echo "  help             - this message"
	@echo "  <lang>Obj        - create object interface for Ruby"
	@echo "  <lang>Lib        - create function interface for Ruby"
	@echo "  <lang>ObjWrapper - create the wrapper files using swig (object interface)"
	@echo "  <lang>LibWrapper - create the wrapper files using swig (function interface)"
	@echo "  <lang>ObjTest    - run object interface test (./<lang>/testObj.rb). Accepts input file argument."
	@echo "  <lang>LibTest    - run function library test (./<lang>/testLib.rb). Accepts input file argument."
	@echo "  <lang>ObjInstall - install shared libraries and optional language files for <lang>"
	@echo "  <lang>LibInstall - see <lang>ObjInstall"
#
AM_CPPFLAGS = -I$(top_srcdir)/src
#
Ralf Mueller's avatar
Ralf Mueller committed
127
#all-local: $(BINDINGS)
Uwe Schulzweida's avatar
Uwe Schulzweida committed
128
129
#
CLEANFILES  = `ls *~`