diff --git a/mex/build/matlab/mex.am b/mex/build/matlab/mex.am index 89caf3954..6bc9a4308 100644 --- a/mex/build/matlab/mex.am +++ b/mex/build/matlab/mex.am @@ -17,4 +17,6 @@ all-local: done clean-local: - cd $(top_srcdir)/../../matlab && rm -f $(PROGRAMS) + if test -d $(top_srcdir)/../../matlab; then \ + cd $(top_srcdir)/../../matlab && rm -f $(PROGRAMS); \ + fi diff --git a/mex/build/octave/mex.am b/mex/build/octave/mex.am index 0bcd97ebb..029dc4521 100644 --- a/mex/build/octave/mex.am +++ b/mex/build/octave/mex.am @@ -29,4 +29,6 @@ all-local: done clean-local: - cd $(top_srcdir)/../../octave && rm -f $(PROGRAMS) + if test -d $(top_srcdir)/../../octave; then \ + cd $(top_srcdir)/../../octave && rm -f $(PROGRAMS); \ + fi