Makefile.am 3.37 KB
Newer Older
Uwe Schulzweida's avatar
Uwe Schulzweida committed
1
2
## Process this file with automake to produce Makefile.in
#
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
SWIG_FILE = $(abs_top_srcdir)/interfaces/cdi.i
BINDINGS  =

INTERFACES_FILES = \
	$(abs_top_srcdir)/interfaces/ruby/test.rb \
	$(abs_top_srcdir)/interfaces/ruby/setup.rb \
	$(abs_top_srcdir)/interfaces/python/test.py \
	$(abs_top_srcdir)/interfaces/python/setup.py \
	$(abs_top_srcdir)/interfaces/python/table.py \
	$(abs_top_srcdir)/interfaces/python/Cdi.py \
	$(abs_top_srcdir)/interfaces/CdiInfo.cpp \
	$(abs_top_srcdir)/interfaces/f2003/bindGen.rb

EXTRA_DIST = $(SWIG_FILE) $(INTERFACES_FILES)

MODULE_NAME         = Cdi
RUBY_WRAPPER_FILE   = $(abs_top_builddir)/interfaces/ruby/cdi_wrapper.cpp
RUBY_SHARED_LIB     = $(abs_top_builddir)/interfaces/ruby/$(MODULE_NAME).so
RUBY_MAKEFILE       = $(abs_top_builddir)/interfaces/ruby/Makefile
PYTHON_WRAPPER_FILE = $(abs_top_builddir)/interfaces/python/cdi_wrapper.cpp
PYTHON_SHARED_LIB   = $(abs_top_builddir)/interfaces/python/$(MODULE_NAME).so
PYTHON_MAKEFILE     = $(abs_top_builddir)/interfaces/python/Makefile
25

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

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

Ralf Mueller's avatar
Ralf Mueller committed
41
42
CdiInfo_SOURCES     = CdiInfo.cpp
CdiInfo_LDADD       = libcdipp.la
Uwe Schulzweida's avatar
Uwe Schulzweida committed
43
CdiInfo_LDFLAGS     = @NETCDF_LIBS@ @SZLIB_LIBS@ $(LDFLAGS)
44
#
Uwe Schulzweida's avatar
Uwe Schulzweida committed
45
#
46
if ENABLE_RUBY
47
BINDINGS += ruby-binding
Uwe Schulzweida's avatar
Uwe Schulzweida committed
48
# Ruby ====================================================
49
50
51
$(RUBY_WRAPPER_FILE): $(SWIG_FILE)
	mkdir -p $(dir $@)
	$(SWIG) -ruby -c++ -globalmodule -debug-classes -o $@ $(AM_CPPFLAGS) $<
Uwe Schulzweida's avatar
Uwe Schulzweida committed
52

53
54
55
$(RUBY_MAKEFILE): $(abs_top_srcdir)/interfaces/ruby/setup.rb
	mkdir -p $(dir $@)
	cd ruby && CFLAGS="$(CFLAGS)" LIBS="$(LIBS)" LDFLAGS="$(LDFLAGS)" INCFLAGS="-I$(abs_top_srcdir)/interfaces" ruby $<
Uwe Schulzweida's avatar
Uwe Schulzweida committed
56

57
58
$(RUBY_SHARED_LIB): $(RUBY_WRAPPER_FILE) $(RUBY_MAKEFILE)
	cd ruby && make
Uwe Schulzweida's avatar
Uwe Schulzweida committed
59

60
ruby-binding: $(RUBY_SHARED_LIB)
Uwe Schulzweida's avatar
Uwe Schulzweida committed
61

62
63
rubyTest: $(RUBY_SHARED_LIB)
	cd ruby && ruby $(abs_top_srcdir)/interfaces/ruby/test.rb
Uwe Schulzweida's avatar
Uwe Schulzweida committed
64

65
66
install-ruby: $(RUBY_SHARED_LIB)
	cd ruby && make install
Uwe Schulzweida's avatar
Uwe Schulzweida committed
67
68
endif
# =========================================================
69
if ENABLE_PYTHON
70
BINDINGS += python-binding
Uwe Schulzweida's avatar
Uwe Schulzweida committed
71
# Python ==================================================
72
73
74
$(PYTHON_WRAPPER_FILE): $(SWIG_FILE)
	mkdir -p $(dir $@)
	$(SWIG) -python -c++ -debug-classes -o $(PYTHON_WRAPPER_FILE) $(AM_CPPFLAGS) $<
Uwe Schulzweida's avatar
Uwe Schulzweida committed
75

76
77
78
$(PYTHON_SHARED_LIB): $(PYTHON_WRAPPER_FILE) $(abs_top_srcdir)/interfaces/python/setup.py
	mkdir -p $(dir $@)
	cd python; CC="$(CC)" CXX="$(CXX)" BUILDLIBDIR="$(top_builddir)/src/.libs" LIBDIR=$(libdir) CFLAGS="$(CFLAGS)" LIBS="$(LIBS)" LDFLAGS="-L../../src/.libs $(LDFLAGS)" INCFLAGS="-I$(abs_top_srcdir)/interfaces" python $(abs_top_srcdir)/interfaces/python/setup.py build_ext --inplace
Uwe Schulzweida's avatar
Uwe Schulzweida committed
79

80
python-binding: $(PYTHON_SHARED_LIB)
Uwe Schulzweida's avatar
Uwe Schulzweida committed
81

82
83
pythonTest: $(abs_top_srcdir)/interfaces/python/test.py
	@cd python; python $<
Uwe Schulzweida's avatar
Uwe Schulzweida committed
84

85
86
install-python: $(PYTHON_SHARED_LIB)
	cd python; CC="$(CC)" CXX="$(CXX)" BUILDLIBDIR="$(top_builddir)/src/.libs" LIBDIR=$(libdir) CFLAGS="$(CFLAGS)" LIBS="$(LIBS)" LDFLAGS="-L../../src/.libs $(LDFLAGS)" INCFLAGS="-I$(abs_top_srcdir)/interfaces" python setup.py install --prefix=$(prefix)
Uwe Schulzweida's avatar
Uwe Schulzweida committed
87
88
89
90
endif
#
AM_CPPFLAGS = -I$(top_srcdir)/src
#
91
all-local: $(BINDINGS)
Uwe Schulzweida's avatar
Uwe Schulzweida committed
92
#
93
CLEANFILES  = `ls *~ *.o *.so */*.o */*.so`