summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2014-06-12 15:16:56 -0400
committerOri Bernstein <ori@eigenstate.org>2014-06-12 15:16:56 -0400
commit20bd6c23d6b53a27e2a2a52f0d61004360bcd6c1 (patch)
tree3fab0991b75eb5320a9446e3204e7967a9fabb98 /mk
parent9810831f6006e9c9604f343f7f7754529c380673 (diff)
downloadmc-20bd6c23d6b53a27e2a2a52f0d61004360bcd6c1.tar.gz
Add support for DESTDIR
Diffstat (limited to 'mk')
-rw-r--r--mk/c.mk40
1 files changed, 20 insertions, 20 deletions
diff --git a/mk/c.mk b/mk/c.mk
index 6c1da86..e60f318 100644
--- a/mk/c.mk
+++ b/mk/c.mk
@@ -52,24 +52,24 @@ clean: subdirs-clean
install: subdirs-install $(INSTBIN) $(INSTLIB) $(INSTHDR) $(INSTPKG)
@if [ ! -z "$(INSTBIN)" ]; then \
- echo install $(INSTBIN) $(INST_ROOT)/bin; \
- mkdir -p $(INST_ROOT)/bin; \
- install $(INSTBIN) $(INST_ROOT)/bin; \
+ echo install $(abspath $(INSTBIN) $(DESTDIR)/$(INST_ROOT)/bin); \
+ mkdir -p $(abspath $(DESTDIR)/$(INST_ROOT)/bin); \
+ install $(INSTBIN) $(abspath $(DESTDIR)/$(INST_ROOT)/bin); \
fi
@if [ ! -z "$(INSTLIB)" ]; then \
- echo install -m 644 $(INSTLIB) $(INST_ROOT)/lib; \
- mkdir -p $(INST_ROOT)/lib; \
- install -m 644 $(INSTLIB) $(INST_ROOT)/lib; \
+ echo install -m 644 $(INSTLIB) $(abspath $(DESTDIR)/$(INST_ROOT)/lib); \
+ mkdir -p $(abspath $(DESTDIR)/$(INST_ROOT)/lib); \
+ install -m 644 $(INSTLIB) $(abspath $(DESTDIR)/$(INST_ROOT)/lib); \
fi
@if [ ! -z "$(INSTHDR)" ]; then \
- echo install $(INSTHDR) $(INST_ROOT)/include; \
- mkdir -p $(INST_ROOT)/include; \
- install $(INSTHDR) $(INST_ROOT)/include; \
+ echo install $(INSTHDR) $(abspath $(DESTDIR)/$(INST_ROOT)/include); \
+ mkdir -p $(abspath $(DESTDIR)/$(INST_ROOT)/include); \
+ install $(INSTHDR) $(abspath $(DESTDIR)/$(INST_ROOT)/include); \
fi
@if [ ! -z "$(INSTPKG)" ]; then \
- echo install $(INSTPKG) $(INST_ROOT)/lib/pkgconfig; \
- mkdir -p $(INST_ROOT)/lib/pkgconfig; \
- install $(INSTPKG) $(INST_ROOT)/lib/pkgconfig; \
+ echo install $(abspath $(INSTPKG) $(DESTDIR)/$(INST_ROOT)/lib/pkgconfig); \
+ mkdir -p $(abspath $(DESTDIR)/$(INST_ROOT)/lib/pkgconfig); \
+ install $(abspath $(INSTPKG) $(DESTDIR)/$(INST_ROOT)/lib/pkgconfig); \
fi
subdirs-uninstall:
@@ -81,20 +81,20 @@ subdirs-uninstall:
uninstall: subdirs-uninstall
@for i in $(INSTBIN); do \
- echo rm -f $(INST_ROOT)/bin/$$i; \
- rm -f $(INST_ROOT)/bin/$$i; \
+ echo rm -f $(abspath $(DESTDIR)/$(INST_ROOT)/bin/$$i); \
+ rm -f $(abspath $(DESTDIR)/$(INST_ROOT)/bin/$$i); \
done
@for i in $(INSTLIB); do \
- echo rm -f $(INST_ROOT)/lib/$$i; \
- rm -f $(INST_ROOT)/lib/$$i; \
+ echo rm -f $(abspath $(DESTDIR)/$(INST_ROOT)/lib/$$i); \
+ rm -f $(abspath $(DESTDIR)/$(INST_ROOT)/lib/$$i); \
done
@for i in $(INSTHDR); do \
- echo rm -f $(INST_ROOT)/include/$$i; \
- rm -f $(INST_ROOT)/include/$$i; \
+ echo rm -f $(abspath $(DESTDIR)/$(INST_ROOT)/include/$$i); \
+ rm -f $(abspath $(DESTDIR)/$(INST_ROOT)/include/$$i); \
done
@for i in $(INSTPKG); do \
- echo rm -f $(INST_ROOT)/lib/pkgconfig/$$i; \
- rm -f $(INST_ROOT)/lib/pkgconfig/$$i; \
+ echo rm -f $(abspath $(DESTDIR)/$(INST_ROOT)/lib/pkgconfig/$$i); \
+ rm -f $(abspath $(DESTDIR)/$(INST_ROOT)/lib/pkgconfig/$$i); \
done
clean-backups: