aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Voss <thomasvoss@live.com> 2022-08-09 12:31:44 +0200
committerThomas Voss <thomasvoss@live.com> 2022-08-09 12:31:44 +0200
commit9768f39396023afee0e2ba66534c547d290ca643 (patch)
treee6defea8cd98c0150f6e7702361f954912643c0f
parentdc668bb046f2b03ee37dd81cb54541fa18f8e8ee (diff)
Add Makefile
-rw-r--r--Makefile27
1 files changed, 27 insertions, 0 deletions
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