Skip to content

Commit

Permalink
ch7: make shared
Browse files Browse the repository at this point in the history
  • Loading branch information
im-zhong committed Mar 3, 2023
1 parent ef46d25 commit b0860a3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion chapter7/figure7.6-7/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@ all: addvec.o multvec.o main.o
gcc -o main.out main.o libvector.a
gcc -static -o main.out main.o -L. -lvector

shared: addvec.c multvec.c main.c
gcc -shared -fpic -o libvector.so addvec.c multvec.c
gcc -o main.out main.c ./libvector.so

addvec.o: vector.h addvec.c
multvec.o: vector.h multvec.c
main.o: vector.h main.c

.PHONYL: clean
clean:
rm *.o *.a main.out
rm *.o *.a *.so main.out

0 comments on commit b0860a3

Please sign in to comment.