Skip to content

Instantly share code, notes, and snippets.

@alex4o
Created January 28, 2021 12:47
Show Gist options
  • Save alex4o/2a72535101f078f4b390e8fb1487f5bb to your computer and use it in GitHub Desktop.
Save alex4o/2a72535101f078f4b390e8fb1487f5bb to your computer and use it in GitHub Desktop.
#/bin/sh
set -e
CC=${CC:-clang}
for source_file in *.c; do
echo "lib${source_file%.c}.so"
${CC} ${source_file} -fPIC -Wno-parentheses-equality -shared -glldb -lm -o lib${source_file%.c}.so
done
set libs=""
for lib in *.so; do
libs=$libs$(echo $lib | sed -E 's/lib(.*)\.so/ -l\1/gm')
done
echo $libs
exit 0
echo clang main.o -lm -glldb $libs -o lua.shared
clang main.o -lm -glldb -L. $libs -Wl,-rpath,. -o lua.shared
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment