From b88e73b71821b090896b90110ec789d27f9fd01d Mon Sep 17 00:00:00 2001 From: Alessandro Iezzi Date: Wed, 18 Jan 2023 17:40:43 +0100 Subject: Add target to build an archive (.a) --- .gitignore | 1 + Makefile | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index dd06800..49f5cc7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ liblist.so +liblist.a *.o test/list.h test/test1 diff --git a/Makefile b/Makefile index b9561ee..c847f10 100644 --- a/Makefile +++ b/Makefile @@ -28,7 +28,7 @@ WARNINGS = -Wall -Werror CFLAGS = -DVERSION='"${VERSION}"' ${WARNINGS} -ansi -pedantic -fPIC LFLAGS = -all: ${OBJ} liblist.so +all: ${OBJ} liblist.so liblist.a .c.o: ${CC} -c ${CFLAGS} $< -o $@ @@ -36,6 +36,9 @@ all: ${OBJ} liblist.so liblist.so: ${CC} -shared -o $@ ${OBJ} +liblist.a: + ar rcs $@ ${OBJ} + clean: rm -f liblist.so ${OBJ} clist-${VERSION}.tar.gz @make -C test $@ -- cgit v1.2.3