aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2021-04-17 12:59:32 +0200
committerMattias Andrée <maandree@kth.se>2021-04-17 12:59:32 +0200
commit87148522816a0329fceff9d46f6252a8921e653f (patch)
tree14b3c89783bc96e0618e6dfe20c2c084842bf4a5 /Makefile
parentm (diff)
downloadlibparser-87148522816a0329fceff9d46f6252a8921e653f.tar.gz
libparser-87148522816a0329fceff9d46f6252a8921e653f.tar.bz2
libparser-87148522816a0329fceff9d46f6252a8921e653f.tar.xz
Makefile: add install and uninstall rules
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile15
1 files changed, 14 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index c8628b0..0b424bd 100644
--- a/Makefile
+++ b/Makefile
@@ -27,6 +27,19 @@ calc-example/calc: calc-example/calc.o calc-example/calc-syntax.o libparser.a
calc-example/calc-syntax.c: libparser-generate calc-example/calc.syntax
./libparser-generate _expr < calc-example/calc.syntax > $@
+install: libparser.a libparser-generate
+ mkdir -p -- "$(DESTDIR)$(PREFIX)/bin"
+ mkdir -p -- "$(DESTDIR)$(PREFIX)/lib"
+ mkdir -p -- "$(DESTDIR)$(PREFIX)/include"
+ cp -- libparser-generate "$(DESTDIR)$(PREFIX)/bin"
+ cp -- libparser.a "$(DESTDIR)$(PREFIX)/lib"
+ cp -- libparser.h "$(DESTDIR)$(PREFIX)/include"
+
+uninstall:
+ -rm -f -- "$(DESTDIR)$(PREFIX)/bin/libparser-generate"
+ -rm -f -- "$(DESTDIR)$(PREFIX)/lib/libparser.a"
+ -rm -f -- "$(DESTDIR)$(PREFIX)/include/libparser.h"
+
clean:
-rm -f -- *.o *.lo *.a *.so *.su *-example/*.o *-example/*.su *-example/*-syntax.c libparser-generate
-rm -f -- calc-example/calc
@@ -34,4 +47,4 @@ clean:
.SUFFIXES:
.SUFFIXES: .c .o .lo
-.PHONY: all clean
+.PHONY: all install uninstall clean