aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlessandro Iezzi <aiezzi@alessandroiezzi.it>2023-04-05 00:07:35 +0200
committerAlessandro Iezzi <aiezzi@alessandroiezzi.it>2023-04-05 00:07:35 +0200
commit1f62527c487bb1890e1caedf33b930f2ce8b09a0 (patch)
treeb4f8879bbb0e5020a2604f15bdd232eede93a28a
parentae06c0483f3e48ff664da4678e519e9a69cd453b (diff)
downloadlog-1f62527c487bb1890e1caedf33b930f2ce8b09a0.tar.gz
log-1f62527c487bb1890e1caedf33b930f2ce8b09a0.zip
Add install and unistall targets
-rw-r--r--Makefile10
-rw-r--r--config.mk5
2 files changed, 14 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 7edbff9..07ac309 100644
--- a/Makefile
+++ b/Makefile
@@ -32,3 +32,13 @@ clean:
tests: dist
cd test && make clean tests
+
+install: dist
+ cp src/log.h ${PREFIX}/include/log.h
+ mkdir -p ${PREFIX}/lib/log
+ cp ${LIBNAME:=.so} ${PREFIX}/lib/log/${LIBNAME:=.so}
+ cp ${LIBNAME:=.a} ${PREFIX}/lib/log/${LIBNAME:=.a}
+
+uninstall:
+ rm -f ${PREFIX}/include/log.h
+ rm -rf ${PREFIX}/lib/log
diff --git a/config.mk b/config.mk
index 17be91f..0acf5b5 100644
--- a/config.mk
+++ b/config.mk
@@ -1,5 +1,7 @@
# See LICENSE file for copyright and license details.
+PREFIX = /usr/local
+
CC = cc
SRC != find src -name "*.c"
OBJ = ${SRC:.c=.o}
@@ -7,4 +9,5 @@ OBJ = ${SRC:.c=.o}
LIBNAME = liblog
LIBVER = 0.0.0-a1
-CFLAGS = -Wall -ansi --std=c89 -pedantic ${OPT} -DLIBVER=\"${LIBVER}\" \ No newline at end of file
+CFLAGS = -Wall -ansi --std=c89 -pedantic ${OPT} -DLIBVER=\"${LIBVER}\"
+