From 87148522816a0329fceff9d46f6252a8921e653f Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 17 Apr 2021 12:59:32 +0200 Subject: Makefile: add install and uninstall rules MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- Makefile | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'Makefile') 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 -- cgit v1.2.3-70-g09d2