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