rsys

Basic data structures and low-level features
git clone git://git.meso-star.fr/rsys.git
Log | Files | Refs | README | LICENSE

commit bb6e72ecd4e68e128799a0132c76d25efe34c17f
parent 42625e3a9d80106e6f9324af1e0956d805ba42dc
Author: vaplv <vaplv@free.fr>
Date:   Sun,  7 May 2023 17:23:49 +0200

Update options when editing links in the shared library

Add the CFLAGS used during compilation. This follows the recommendation
of the GCC manual for the -shared option: "For predictable results, you
must also specify the same set of options used for compilation".

Note that in this commit, we also remove all use of the raw library name
and replace it with the LIBNAME_<STATIC|SHARED> macros that was already
defined.

Diffstat:
MMakefile | 10+++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/Makefile b/Makefile @@ -50,10 +50,10 @@ build_library: $(DEP) $(OBJ): config.mk -librsys.so: $(OBJ) - $(CC) -o $@ $(OBJ) $(LDFLAGS_$(BUILD_TYPE)) $(SOFLAGS) $(LIBS) +$(LIBNAME_SHARED): $(OBJ) + $(CC) $(CFLAGS_$(BUILD_TYPE)) -o $@ $(OBJ) $(LDFLAGS_$(BUILD_TYPE)) $(SOFLAGS) $(LIBS) -librsys.a: $(OBJ) +$(LIBNAME_STATIC): $(OBJ) $(AR) -rc $@ $? $(RANLIB) $@ @@ -150,7 +150,7 @@ uninstall: all: build_library build_tests clean: clean_test - @rm -f $(OBJ) $(TEST_OBJ) librsys.so librsys.a libtest_lib.so test_lib.o\ + @rm -f $(OBJ) $(TEST_OBJ) $(LIBNAME_$(LIB_TYPE)) libtest_lib.so test_lib.o\ .test rsys.pc .test.ppm test_text_reader.txt test.ppm distclean: clean @@ -206,7 +206,7 @@ TEST_SRC =\ TEST_OBJ = $(TEST_SRC:.c=.o) TEST_DEP = $(TEST_SRC:.c=.d) -RSYS_LIBS_STATIC = librsys.a -ldl -lpthread -lm +RSYS_LIBS_STATIC = $(LIBNAME_STATIC) -ldl -lpthread -lm RSYS_LIBS_SHARED = -L./ -lrsys build_tests: build_library $(TEST_DEP) .test