From 26621149476aefccdbfe56f6bef5011322eb4ff7 Mon Sep 17 00:00:00 2001 From: Jonas Gunz Date: Wed, 12 Jun 2019 00:49:33 +0200 Subject: Added install & uninstall to Makefile --- Makefile | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index b13428f..c26407b 100644 --- a/Makefile +++ b/Makefile @@ -17,6 +17,8 @@ SRCS = $(wildcard $(SOURCEDIR)/*.cpp) OBJS = $(SRCS:.cpp=.o) OBJ = $(OBJS:$(SOURCEDIR)/%=$(OBJECTDIR)/%) +PREFIX = / + build: dir genversion $(OBJ) @echo [LD] $(OBJ) @$(CC) $(CPPFLAGS) -o $(BUILDDIR)/lib/$(OUTPUT) $(OBJ) $(LDFLAGS) -Wl,-soname=lib$(SONAME).so.$(VERSION) @@ -47,8 +49,7 @@ debug: build all: clean build -.PHONY: clean doc - +.PHONY: clean clean: @echo [ RM ] $(OBJ) @echo [ RM ] $(TESTSOURCE).o @@ -79,6 +80,21 @@ run: gentest memleak: gentest @valgrind -v --track-origins=yes "./$(BUILDDIR)/test/test" +.PHONY: doc doc: genversion @mkdir -p doc @doxygen .doxygen + +.PHONY: install +install: build + @echo "Installing..." + @install -D $(BUILDDIR)/lib/$(OUTPUT) $(PREFIX)/usr/lib/$(OUTPUT) + @ln -sf $(PREFIX)/usr/lib/$(OUTPUT) $(PREFIX)/usr/lib/lib$(SONAME).so.$(VERSION) + @ln -sf $(PREFIX)/usr/lib/$(OUTPUT) $(PREFIX)/usr/lib/lib$(SONAME).so + @echo "Finished!" + +.PHONY: uninstall +uninstall: + @echo "Removing..." + @rm $(PREFIX)/usr/lib/lib$(SONAME)* + @echo "Finished" -- cgit v1.2.3