From 9768f39396023afee0e2ba66534c547d290ca643 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Tue, 9 Aug 2022 12:31:44 +0200 Subject: Add Makefile --- Makefile | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..f862452 --- /dev/null +++ b/Makefile @@ -0,0 +1,27 @@ +.POSIX: + +CFLAGS = -std=c11 -pipe -O3 -Wall -Wextra -Werror -pedantic +PREFIX = /usr +MANDIR = ${PREFIX}/share/man + +sources = liblux.o lux.h +outputs = liblux.so liblux.a + +all: ${outputs} + +liblux.o: liblux.c + +liblux.a: ${sources} + ${AR} ${ARFLAGS} $@ liblux.o + +liblux.so: ${sources} + ${CC} ${CFLAGS} -o $@ -fPIC -shared liblux.o + +install: + mkdir -p ${PREFIX}/include ${PREFIX}/lib ${MANDIR}/man3 + cp ${outputs} ${PREFIX}/lib + cp lux.h ${PREFIX}/include + cp man/* ${MANDIR}/man3 + +clean: + rm -f ${outputs} liblux.o -- cgit v1.2.3