summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAchim Gratz <Stromeko@Stromeko.DE>2012-01-02 20:30:32 +0100
committerAchim Gratz <Stromeko@Stromeko.DE>2012-04-20 21:04:11 +0200
commit24fa46a9e507684f0b5cd9413004c9d585e9b9c1 (patch)
treeb668827b8bce085d1b25ade22bc790c3b4f64506
parent6a3ec67abd61b4707ec4847ac81e3612201e5ec5 (diff)
downloadorg-mode-24fa46a9e507684f0b5cd9413004c9d585e9b9c1.tar.gz
more robust shell code for install/clean-install
{etc,lisp}/Makefile: use shell instead of make for looping, make code more robust
-rw-r--r--etc/Makefile16
-rw-r--r--lisp/Makefile9
2 files changed, 18 insertions, 7 deletions
diff --git a/etc/Makefile b/etc/Makefile
index 9ef280d..1c9e2cc 100644
--- a/etc/Makefile
+++ b/etc/Makefile
@@ -12,12 +12,20 @@ endif
all:
install: $(ETCDIRS)
- $(foreach dir, $?, if [ ! -d $(DESTDIR)$(datadir)/$(dir) ]; then $(MKDIR) $(DESTDIR)$(datadir)/$(dir); else true; fi ; $(CP) $(dir)/* $(DESTDIR)$(datadir)/$(dir); )
+ for dir in $? ; do \
+ if [ ! -d $(DESTDIR)$(datadir)/$${dir} ] ; then \
+ $(MKDIR) $(DESTDIR)$(datadir)/$${dir} ; \
+ fi ; \
+ $(CP) $${dir}/* $(DESTDIR)$(datadir)/$${dir} ; \
+ done ;
clean:
cleanall:
-clean-install:
- if [ ! -d $(DESTDIR)$(datadir) ]; then $(MKDIR) $(DESTDIR)$(datadir); else true; fi ;
- $(RMR) $(DESTDIR)$(datadir)
+clean-install: $(ETCDIRS)
+ for dir in $? ; do \
+ if [ -d $(DESTDIR)$(datadir)/$${dir} ] ; then \
+ $(RMR) $(DESTDIR)$(datadir)/$${dir} ; \
+ fi ; \
+ done ;
diff --git a/lisp/Makefile b/lisp/Makefile
index 31ecdb7..0824ffe 100644
--- a/lisp/Makefile
+++ b/lisp/Makefile
@@ -33,7 +33,9 @@ org-install.el: $(LISPF)
$(ORG-INSTALL)
install: $(LISPF) compile autoloads
- if [ ! -d $(DESTDIR)$(lispdir) ]; then $(MKDIR) $(DESTDIR)$(lispdir); else true; fi ;
+ if [ ! -d $(DESTDIR)$(lispdir) ] ; then \
+ $(MKDIR) $(DESTDIR)$(lispdir) ; \
+ fi ;
$(CP) $(LISPC) $(LISPF) $(LISPO) $(DESTDIR)$(lispdir)
clean:
@@ -46,5 +48,6 @@ cleanall:
$(RM) *.elc $(LISPO)
clean-install:
- if [ ! -d $(DESTDIR)$(lispdir) ]; then $(MKDIR) $(DESTDIR)$(lispdir); else true; fi ;
- $(RM) $(DESTDIR)$(lispdir)/org*.el* $(DESTDIR)$(lispdir)/ob*.el*
+ if [ -d $(DESTDIR)$(lispdir) ] ; then \
+ $(RM) $(DESTDIR)$(lispdir)/org*.el* $(DESTDIR)$(lispdir)/ob*.el* ; \
+ fi ;