aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile17
-rw-r--r--README6
2 files changed, 22 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index eaadd6f..f6491d8 100644
--- a/Makefile
+++ b/Makefile
@@ -4,6 +4,12 @@
DEBUG ?= no
# Specify your favourite C compiler here:
CC ?= gcc
+# Specify your include directory (headers location):
+INCDIR ?= /usr/include
+# Specify your libraries directory:
+LIBDIR ?= /usr/lib
+# Specify location of man pages on your machine:
+MANDIR ?= /usr/share/man
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
@@ -25,6 +31,7 @@ INCLUDE = include
BUILD = build
SRCDIR = src
EXADIR = examples
+MAN = man
# Library itself:
LIB = libmagi.a
# Modules:
@@ -63,6 +70,16 @@ examples: all $(XBLD) $(EXAMPLES)
clean:
rm -f $(TARGET) $(OBJ) $(EXAMPLES) $(DEPS)
+install: all
+ cp -r $(INCLUDE)/* $(INCDIR)
+ cp $(TARGET) $(LIBDIR)
+ cp $(MAN)/* $(MANDIR)/man3
+
+uninstall:
+ rm -r $(INCDIR)/magi.h $(INCDIR)/magi.hpp $(INCDIR)/magi
+ rm $(LIBDIR)/$(LIB)
+ rm $(MANDIR)/man3/magi.3 $(MANDIR)/man3/libmagi.3
+
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# Compilation
diff --git a/README b/README
index ffc70d0..d2c7574 100644
--- a/README
+++ b/README
@@ -15,7 +15,11 @@ For detailed documentation look into 'man' directory.
Compiling
Compilation and its options are described in the Makefile.
Running make produces 'build/libmagi.a', which is precompiled library itself,
-ready to be statically linked into your project.
+ready to be statically linked into your project. In order to install magi
+you can run 'make install', and to uninstall run 'make uninstall'.
+Since default include (/usr/include), lib (/usr/lib) and man (/usr/share/man)
+directories can be not valid for you, don't forget to specify them in either
+environment variables or the Makefile itself.
Examples
Running 'make examples' produces executable for each example in 'examples'.