diff --git a/Makefile b/Makefile index 089fd33..249b621 100644 --- a/Makefile +++ b/Makefile @@ -1,25 +1,26 @@ -prefix ?= /usr/local +DESTDIR ?= /usr/local +LIB ?= lib all: - $(error "Usage: make [prefix=/install/me/here] install | uninstall") + $(error "Usage: make [DESTDIR=/install/me/here] install | uninstall") install: - mkdir -p $(prefix)/include/libspotify - install include/libspotify/api.h $(prefix)/include/libspotify + mkdir -p $(DESTDIR)/include/libspotify + install include/libspotify/api.h $(DESTDIR)/include/libspotify - mkdir -p $(prefix)/lib - install -T lib/libspotify.so.12 $(prefix)/lib/libspotify.so.12.1.51 + mkdir -p $(DESTDIR)/$(LIB) + install -T lib/libspotify.so.12 $(DESTDIR)/$(LIB)/libspotify.so.12.1.51 - cd $(prefix)/lib && ln -sf libspotify.so.12.1.51 libspotify.so.12 && ln -sf libspotify.so.12.1.51 libspotify.so + cd $(DESTDIR)/$(LIB) && ln -sf libspotify.so.12.1.51 libspotify.so.12 && ln -sf libspotify.so.12.1.51 libspotify.so - mkdir -p $(prefix)/lib/pkgconfig - sed -e s:PKG_PREFIX:$(prefix):g $(prefix)/lib/pkgconfig/libspotify.pc + mkdir -p $(DESTDIR)/$(LIB)/pkgconfig + sed -e s:PKG_PREFIX:$(DESTDIR):g $(DESTDIR)/$(LIB)/pkgconfig/libspotify.pc ldconfig uninstall: - rm -rf $(prefix)/include/libspotify - rm -f $(prefix)/lib/libspotify.so.12.1.51 - rm -f $(prefix)/lib/libspotify.so.12 - rm -f $(prefix)/lib/libspotify.so - rm -f $(prefix)/lib/pkgconfig/libspotify.pc + rm -rf $(DESTDIR)/include/libspotify + rm -f $(DESTDIR)/lib/libspotify.so.12.1.51 + rm -f $(DESTDIR)/lib/libspotify.so.12 + rm -f $(DESTDIR)/lib/libspotify.so + rm -f $(DESTDIR)/lib/pkgconfig/libspotify.pc