Skip to content

Instantly share code, notes, and snippets.

@r10r
Created January 30, 2014 10:31
Show Gist options
  • Save r10r/8705995 to your computer and use it in GitHub Desktop.
Save r10r/8705995 to your computer and use it in GitHub Desktop.
Generate CFLAGS from libraries installed through homebrew.
#!/bin/sh
brew_cflags() {
local flags
for lib in $@; do
P=`brew --prefix $lib`
name=`echo $lib | sed 's/^lib//'`
flags="$flags -L$P/lib -I$P/include -l$name"
done
echo $flags
}
brew_cflags "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment