Chris@40: ## Process this file with automake to produce Makefile.in Chris@40: Chris@40: # Prevent any extension. Chris@40: EXEEXT = Chris@40: Chris@40: CXXLD = $(CXX) Chris@40: CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \ Chris@40: $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ Chris@40: Chris@40: EXTRA_DIST = sndfile_load.m sndfile_save.m sndfile_play.m \ Chris@40: octave_test.m octave_test.sh $(oct_module_srcs) PKG_ADD Chris@40: Chris@40: octconfigdir = $(exec_prefix)/share/octave/site/m Chris@40: octconfig_DATA = sndfile_load.m sndfile_save.m sndfile_play.m Chris@40: Chris@40: OCTAVE_DEST_MDIR = @OCTAVE_DEST_MDIR@ Chris@40: OCTAVE_DEST_ODIR = @OCTAVE_DEST_ODIR@/sndfile Chris@40: Chris@40: OCT_CXXFLAGS = @OCT_CXXFLAGS@ Chris@40: OCT_LIB_DIR = @OCT_LIB_DIR@ Chris@40: OCT_LIBS = @OCT_LIBS@ Chris@40: Chris@40: SNDFILEDIR = $(top_builddir)/src Chris@40: AM_CPPFLAGS = -I$(SNDFILEDIR) Chris@40: Chris@40: oct_module_srcs = sndfile.cc Chris@40: oct_module_files = sndfile.oct PKG_ADD Chris@40: Chris@40: # Make these noinst so they can be installed manually. Chris@40: noinst_DATA = $(oct_module_files) Chris@40: Chris@40: Chris@40: # Used by shave which cleans up automake generated Makefile output. Chris@40: V = @ Chris@40: Q = $(V:1=) Chris@40: QUIET_GEN = $(Q:@=@echo ' GEN '$@;) Chris@40: Chris@40: Chris@40: # Use Octave's mkoctfile to do all the heavy lifting. Unfortunately, its Chris@40: # a little dumb so we need to guide it carefully. Chris@40: sndfile.oct : sndfile.o Chris@40: $(QUIET_GEN) $(MKOCTFILE) -v $(INCLUDES) $(top_builddir)/Octave/$+ -L$(SNDFILEDIR)/.libs -L$(SNDFILEDIR) -lsndfile -o $(top_builddir)/Octave/$@ > /dev/null Chris@40: Chris@40: sndfile.o : sndfile.cc Chris@40: $(QUIET_GEN) $(MKOCTFILE) -v $(INCLUDES) -c $+ -o $(top_builddir)/Octave/$@ > /dev/null Chris@40: Chris@40: # Allow for the test being run in the build dir, but the test script Chris@40: # being located in the source dir. Chris@40: check : Chris@40: octave_src_dir=$(srcdir) $(srcdir)/octave_test.sh Chris@40: Chris@40: Chris@40: # Since the octave modules are installed in a special location, a custom install Chris@40: # and uninstall routine must be specified. Chris@40: install-exec-local : $(oct_module_files) Chris@40: @$(NORMAL_INSTALL) Chris@40: test -z "$(OCTAVE_DEST_ODIR)" || $(mkdir_p) "$(DESTDIR)$(OCTAVE_DEST_ODIR)" Chris@40: @list='$(oct_module_files)'; for p in $$list; do \ Chris@40: p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ Chris@40: if test -f $$p \ Chris@40: || test -f $$p1 \ Chris@40: ; then \ Chris@40: f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ Chris@40: echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(INSTALL) '$$p' '$(DESTDIR)$(OCTAVE_DEST_ODIR)/$$f'"; \ Chris@40: $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(INSTALL) "$$p" "$(DESTDIR)$(OCTAVE_DEST_ODIR)/$$f" || exit 1; \ Chris@40: else :; fi; \ Chris@40: done Chris@40: Chris@40: uninstall-local : Chris@40: @$(NORMAL_UNINSTALL) Chris@40: @list='$(oct_module_files)'; for p in $$list; do \ Chris@40: f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ Chris@40: echo " rm -f '$(DESTDIR)$(OCTAVE_DEST_ODIR)/$$f'"; \ Chris@40: rm -f "$(DESTDIR)$(OCTAVE_DEST_ODIR)/$$f"; \ Chris@40: done Chris@40: Chris@40: clean-local : Chris@40: rm -f sndfile.o sndfile.oct Chris@40: @if test $(abs_builddir) != $(abs_srcdir) ; then rm -f PKG_ADD ; fi