diff options
author | Jonas Gunz <himself@jonasgunz.de> | 2019-06-12 00:49:33 +0200 |
---|---|---|
committer | Jonas Gunz <himself@jonasgunz.de> | 2019-06-12 00:49:33 +0200 |
commit | 26621149476aefccdbfe56f6bef5011322eb4ff7 (patch) | |
tree | 1c2cf29f234587712c8c92b3c6c0b04b72dfba5b | |
parent | 99107be8a997eb453b989e1b31123708685696dc (diff) | |
download | termgl-26621149476aefccdbfe56f6bef5011322eb4ff7.tar.gz |
Added install & uninstall to Makefile
-rw-r--r-- | Makefile | 20 |
1 files changed, 18 insertions, 2 deletions
@@ -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" |