Skip to content

Instantly share code, notes, and snippets.

@JCash
Created June 6, 2019 14:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JCash/ac7360de5cb161aaaba7eafb1fecedec to your computer and use it in GitHub Desktop.
Save JCash/ac7360de5cb161aaaba7eafb1fecedec to your computer and use it in GitHub Desktop.
A simple way to compile the WebP encoder, since the vanilla makefiles fail on OSX
#!/usr/bin/env bash
CC=clang
CCFLAGS="-c -I./libwebp-1.0.2"
function compile {
local DIR=$1
local NAME=$2
for file in `ls $DIR/*.c`; do
echo $file
${CC} ${CCFLAGS} $file
done
ar -rcs $NAME *.o
echo "Wrote" $NAME
}
compile ./libwebp-1.0.2/src/enc libwebpencode.a
compile ./libwebp-1.0.2/src/dsp libwebpdsp.a
compile ./libwebp-1.0.2/src/utils libwebputils.a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment