Permalink
Browse files

Makefile: various fixes for install rules

 * use the common variable DESTDIR to install to a temporary directory.
 * use install rather than cp/mkdir
  • Loading branch information...
1 parent a8f8ea9 commit 7b88af93dec8220ec7f112261b6b3ceb73769265 @abique abique committed Mar 15, 2012
Showing with 5 additions and 7 deletions.
  1. +5 −7 Makefile
View
@@ -27,7 +27,7 @@ BATCH=$(EMACS) -batch -q -no-site-file -eval \
ELC= $(BATCH) -f batch-byte-compile
# How to copy the lisp files and elc files to their distination.
-CP = cp -p
+CP = install -m 644
##----------------------------------------------------------------------
## BELOW THIS LINE ON YOUR OWN RISK!
@@ -43,13 +43,11 @@ default: $(ELCFILES)
install: install-lisp
install-lisp: $(LISPFILES) $(ELCFILES)
- if [ ! -d $(lispdir) ]; then $(MKDIR) $(lispdir); else true; fi ;
- $(CP) $(LISPFILES) $(lispdir)
- $(CP) $(ELCFILES) $(lispdir)
-
-clean:
- ${MAKE} cleanelc
+ install -d -m 755 $(DESTDIR)$(lispdir)
+ $(CP) $(LISPFILES) $(DESTDIR)$(lispdir)
+ $(CP) $(ELCFILES) $(DESTDIR)$(lispdir)
+clean: cleanelc
cleanelc:
rm -f $(ELCFILES)

0 comments on commit 7b88af9

Please sign in to comment.