Andy1978 / octave-video

A GNU Octave wrapper for OpenCV's CvCapture_FFMPEG and CvVideoWriter_FFMPEG
Other
2 stars 0 forks source link

Makefile should use "$(SED)" rather than "sed" #2

Open dasergatskov opened 2 days ago

dasergatskov commented 2 days ago

Makefile checks for SED variable, but then ignores it and uses "sed". That causes some problems on systems w/ non-GNU default sed (like MacOS). The diff:

% git diff Makefile 
diff --git a/Makefile b/Makefile
index 2c1b335..e8fb62b 100644
--- a/Makefile
+++ b/Makefile
@@ -56,7 +56,7 @@ $(RELEASE_DIR): all
        cp COPYING DESCRIPTION NEWS $@
        cp -r ./inst $@
        cp ./src/configure ./src/configure.ac ./src/bootstrap ./src/Makefile.in ./src/cap_ffmpeg_impl_ov.hpp ./src/cap_ffmpeg_wrapper.cc $@/src
-       sed -i '/###/q' $@/src/Makefile.in
+       $(SED) -i '/###/q' $@/src/Makefile.in
        chmod -R a+rX,u+w,go-w $@

 $(RELEASE_TARBALL): $(RELEASE_DIR)
@@ -117,7 +117,7 @@ debug: clean
          --eval 'system (sprintf ("xfce4-terminal --command \"gdb -p %d\"", getpid ()), "async");'

 style:
-       find ./src \( -name "*.cc" -or -name "*.h" -or -name "*.m" \) -exec sed -i 's/[[:space:]]*$$//' {} \;
+       find ./src \( -name "*.cc" -or -name "*.h" -or -name "*.m" \) -exec $(SED) -i 's/[[:space:]]*$$//' {} \;
        find ./src \( -name "*.cc" -or -name "*.h" \) -exec astyle --style=gnu -s2 -n {} \;

 doc:

fixes this issue for me (I used "gmake SED=gsed TAR=gtar dist").

Dmitri.