aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlessandro Iezzi <aiezzi@alessandroiezzi.it>2023-02-04 01:06:40 +0100
committerAlessandro Iezzi <aiezzi@alessandroiezzi.it>2023-02-04 01:06:40 +0100
commita07a7d1583a2488dd38a1c4d52b9313551047591 (patch)
treeb1e87d6c71d31ae9c55452aa6db494e11777995b
parent5f93e47f7e4aa784e87cd86668cab26393278761 (diff)
downloadlog-a07a7d1583a2488dd38a1c4d52b9313551047591.tar.gz
log-a07a7d1583a2488dd38a1c4d52b9313551047591.zip
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.
-rw-r--r--Makefile10
1 files 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