commit cd5cd2e925f70f972480a80b5a208056ef19cad4
Author:     Quentin Rameau <[email protected]>
AuthorDate: Tue Jan 24 14:37:01 2017 +0100
Commit:     Quentin Rameau <[email protected]>
CommitDate: Tue Jan 24 14:37:01 2017 +0100

    Makefile: add support for DESTDIR installation

diff --git a/Makefile b/Makefile
index 225c505..7aaabaa 100644
--- a/Makefile
+++ b/Makefile
@@ -32,21 +32,21 @@ tests: all
        cd tests/execute && $(MAKE) -e tests
 
 install: all
-       mkdir -p $(PREFIX)/libexec/scc/
-       mkdir -p $(PREFIX)/bin/
-       mkdir -p $(PREFIX)/include/scc
-       cp -f bin/cc?-* $(PREFIX)/libexec/scc/
-       cp -f bin/cc1-$(ARCH) $(PREFIX)/bin/cpp
-       cp -f bin/scc $(PREFIX)/bin/
-       cp -fr libc/include/* $(PREFIX)/include/scc/
-       find $(PREFIX)/include/scc/ -type f | xargs chmod 644
-       cd $(PREFIX)/libexec/scc/ && chmod 755 cc* && strip cc*
-       cd $(PREFIX)/bin && chmod 755 cpp scc && strip cpp scc
+       mkdir -p $(DESTDIR)/$(PREFIX)/libexec/scc/
+       mkdir -p $(DESTDIR)/$(PREFIX)/bin/
+       mkdir -p $(DESTDIR)/$(PREFIX)/include/scc
+       cp -f bin/cc?-* $(DESTDIR)/$(PREFIX)/libexec/scc/
+       cp -f bin/cc1-$(ARCH) $(DESTDIR)/$(PREFIX)/bin/cpp
+       cp -f bin/scc $(DESTDIR)/$(PREFIX)/bin/
+       cp -fr libc/include/* $(DESTDIR)/$(PREFIX)/include/scc/
+       find $(DESTDIR)/$(PREFIX)/include/scc/ -type f | xargs chmod 644
+       cd $(DESTDIR)/$(PREFIX)/libexec/scc/ && chmod 755 cc* && strip cc*
+       cd $(DESTDIR)/$(PREFIX)/bin && chmod 755 cpp scc && strip cpp scc
 
 uninstall:
-       rm -rf $(PREFIX)/libexec/scc/
-       rm -f $(PREFIX)/bin/scc
-       rm -f $(PREFIX)/bin/cpp
+       rm -rf $(DESTDIR)/$(PREFIX)/libexec/scc/
+       rm -f $(DESTDIR)/$(PREFIX)/bin/scc
+       rm -f $(DESTDIR)/$(PREFIX)/bin/cpp
 
 clean-helper:
        for i in $(DIRS); \

Reply via email to