Add proper SONAME to TOML shared library

This patch renames the shared library output to libtoml.so.$(LIB_VERSION) instead of libtoml.so. This matches the Yocto standards so that the library can be integrated into Yocto build.
This commit is contained in:
mweshahy 2021-02-16 12:45:18 +01:00 committed by GitHub
parent c5d2e37db7
commit 970ab84bae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4,8 +4,9 @@ OBJ = $(CFILES:.c=.o)
EXEC = toml_json toml_cat toml_sample
CFLAGS = -std=c99 -Wall -Wextra -fpic
LIB_VERSION = 1.0
LIB = libtoml.a
LIB_SHARED = libtoml.so
LIB_SHARED = libtoml.so.$(LIB_VERSION)
# to compile for debug: make DEBUG=1
# to compile for no debug: make
@ -23,7 +24,7 @@ all: $(LIB) $(LIB_SHARED) $(EXEC)
libtoml.a: toml.o
ar -rcs $@ $^
libtoml.so: toml.o
libtoml.so.$(LIB_VERSION): toml.o
$(CC) -shared -o $@ $^
toml_json: toml_json.c $(LIB)