From a07a7d1583a2488dd38a1c4d52b9313551047591 Mon Sep 17 00:00:00 2001 From: Alessandro Iezzi Date: Sat, 4 Feb 2023 01:06:40 +0100 Subject: Edit targets to generate static and shared libraries I need to clean all objects because I have to compile objects for shared library using `-fPIC` flag and the archive library doesn't must have that flag. This is only a shit! BSD make is missing of functionality to compile objects inside a different directory than soruces. --- Makefile | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 2279615..afec99d 100644 --- a/Makefile +++ b/Makefile @@ -11,14 +11,16 @@ LIBNAME = liblog CFLAGS = -Wall -ansi --std=c89 -pedantic ${OPT} ${LIBINC} LDFLAGS = ${LIBS} -dist: - @make OPT='-O2 -pipe -Werror' all +dist: static shared -static: clean libs +# ar -rc libaz.a libabc.a libxyz.a +static: libs @make OPT='-O2 -pipe -Werror' ${LIBNAME:=.a} + rm -f ${OBJ} -shared: clean libs +shared: libs @make OPT='-O2 -pipe -Werror -fPIC' ${LIBNAME:=.so} + rm -f ${OBJ} debug: @make OPT=-g all -- cgit v1.2.3