From 7a947552d7374f9e99bdf128a9969ad042e1a6bf Mon Sep 17 00:00:00 2001
From: Mason X <me@masonx.ca>
Date: Wed, 29 Nov 2017 18:07:28 +0000
Subject: [PATCH] Create shared object/library

---
 make-compile.sh | 2 +-
 make-makelib.sh | 5 +++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/make-compile.sh b/make-compile.sh
index a1eb501..b0be539 100644
--- a/make-compile.sh
+++ b/make-compile.sh
@@ -1 +1 @@
-echo exec "$CC" -c '${1+"$@"}'
+echo exec "$CC" -c -fPIC '${1+"$@"}'
diff --git a/make-makelib.sh b/make-makelib.sh
index d6b7c8c..ed01101 100644
--- a/make-makelib.sh
+++ b/make-makelib.sh
@@ -1,6 +1,7 @@
 echo 'main="$1"; shift'
-echo 'rm -f "$main"'
-echo 'ar cr "$main" ${1+"$@"}'
+echo 'rm -f `echo "$main" | cut -f 1 -d '.'`.so "$main"'
+echo 'ar cr "$main" ${1+"$@"}'
+echo 'gcc -shared -o `echo "$main" | cut -f 1 -d '.'`.so ${1+"$@"}'
 
 case "$1" in
 sunos-5.*) ;;
-- 
2.14.2

