From 1418c2843e910cbc703ceff4d8d15748047513d3 Mon Sep 17 00:00:00 2001 From: AustrianToast Date: Wed, 21 May 2025 17:49:38 +0200 Subject: [PATCH] trying out shared lib --- .gitignore | 1 + Makefile | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 1615488..ba6f55f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ strops.o +libstrops.so libstrops.a tests diff --git a/Makefile b/Makefile index 96ad052..a0b5438 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,13 @@ -tests : libstrops.a +tests : libstrops.a libstrops.so gcc -ansi -I . -L. -o tests tests.c -Wl,-Bstatic -lstrops -Wl,-Bdynamic +# gcc -ansi -I . -L. -o tests tests.c -lstrops + +libstrops.so : strops.o + gcc -shared -o libstrops.so strops.o libstrops.a : strops.o ar cr libstrops.a strops.o - rm strops.o strops.o : strops.c strops.h - gcc -c -ansi -ggdb -o strops.o strops.c + gcc -c -fPIC -ansi -ggdb -o strops.o strops.c # gcc -c -ansi -O2 -pipe -o strops.o strops.c