This is actually part of an assignment. Basically, we need to write a library, which will be linked against test programs the professor writes, like so:
gcc -o libexample.o -c libexample.c
ar rvs libexample.a libexample.o
#later
gcc -o test test.c -L . -lexample
The thing is that libexample uses POSIX semaphores, which needs linking with the pthread library when generating the final executable. Without changing the way test program compiles, is there a way to package the pthread library with libexample.a?
Thanks!