#!/bin/bash set -ave source $HOME/code/brace/sh.conf.mac CFLAGS="-O3 -s -D_GNU_SOURCE=1 -I/Users/sam/inst/include/SDL -D_GNU_SOURCE=1 -D_THREAD_SAFE -I/Users/sam/inst/include" LDFLAGS= LDLIBS="-L. -lSDLmain -lSDL -Wl,-framework,Cocoa,-framework,OpenGL -lb -lSDL_image -lSDL_mixer" PATH="$HOME/code/brace/.build/exe:$PATH" BR_DEBUG=1 OPTIMIZE=3 br rescue cp -a .rescue rescue-exe strip -S rescue-exe lib_path_to_rm=/Users/sam/inst/lib/ for bin in *.dylib rescue-exe; do otool -L $bin | tr -d '\t' | sed 's/ .*//' | grep "^$lib_path_to_rm" | while read A; do install_name_tool -change $A `basename $A` $bin; done done for bin in *.dylib; do otool -D $bin | grep "^$lib_path_to_rm" | while read B; do install_name_tool -id `basename $B` $bin; done; done