summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAchim Gratz <Stromeko@Stromeko.DE>2011-07-18 17:55:23 +0200
committerAchim Gratz <Stromeko@Stromeko.DE>2012-04-20 21:04:08 +0200
commit501f9b17419ffaafa0ab2d167247a393ab855d7f (patch)
tree03cd5470cb00a0c71230d880809f6f7112c364c0
parent00d357ab9822bbc2c8808d44256d9b490d6cf281 (diff)
downloadorg-mode-501f9b17419ffaafa0ab2d167247a393ab855d7f.tar.gz
use sed instead of perl, add target clean-install
* Makefile, lisp/Makefile, doc/Makefile: add target clean-install to remove files in install-directories * default.mk: add customization variable $(SED) * doc/Makefile: do not remove dir while cleaning * lisp/Makefile: use sed instead of perl to weave git-status into org.el and ignore any errors while doing it. Keep git status in $(GITSTATUS) to make it more clear what happens in the check.
-rw-r--r--default.mk3
-rw-r--r--doc/Makefile8
-rw-r--r--lisp/Makefile17
-rw-r--r--targets.mk3
4 files changed, 22 insertions, 9 deletions
diff --git a/default.mk b/default.mk
index cb92181..cb61ff3 100644
--- a/default.mk
+++ b/default.mk
@@ -51,6 +51,9 @@ RM = rm -f
# How to remove files recursively
RMR = rm -fr
+# How to stream edit a file
+SED = sed
+
# How to copy the lisp files and elc files to their destination.
# CP = cp -p # try this if there is no install
CP = install -p
diff --git a/doc/Makefile b/doc/Makefile
index 251ee56..8ce5328 100644
--- a/doc/Makefile
+++ b/doc/Makefile
@@ -2,7 +2,7 @@ ifeq ($(MAKELEVEL), 0)
$(error This make needs to be started as a sub-make from the toplevel directory.)
endif
-.PHONY: all info html pdf card manual guide install clean cleanall
+.PHONY: all info html pdf card manual guide install clean cleanall clean-install
all: info html pdf card
@@ -30,10 +30,14 @@ install: org
$(INSTALL_INFO) --infodir=$(infodir) org
clean cleanall:
- $(RM) dir org *.pdf *.html *_letter.tex \
+ $(RM) org *.pdf *.html *_letter.tex \
*.aux *.cp *.cps *.dvi *.fn *.fns *.ky *.kys *.pg *.pgs \
*.toc *.tp *.tps *.vr *.vrs *.log *.html *.ps
+clean-install:
+ $(RM) $(infodir)/org*
+ @echo You should run $(INSTALL_INFO) again to correct dir entries.
+
.SUFFIXES: # we don't need default suffix rules
.SUFFIXES: .texi .tex .txt
diff --git a/lisp/Makefile b/lisp/Makefile
index 963d08c..0845113 100644
--- a/lisp/Makefile
+++ b/lisp/Makefile
@@ -2,8 +2,9 @@ ifeq ($(MAKELEVEL), 0)
$(error This make needs to be started as a sub-make from the toplevel directory.)
endif
-GITVERSION = $(shell git describe --abbrev=6 HEAD)
-ifneq ($(shell git status -uno --porcelain), '')
+GITVERSION = $(shell git describe --abbrev=6 HEAD)
+GITSTATUS = $(shell git status -uno --porcelain)
+ifneq ("$(GITSTATUS)", "")
GITVERSION := $(GITVERSION).dirty
endif
@@ -13,7 +14,7 @@ LISPC = $(LISPF:%el=%elc)
include dependencies.mk
-.PHONY: autoloads compile install clean cleanall
+.PHONY: all autoloads compile install clean cleanall clean-install
all compile: $(LISPC)
@@ -31,14 +32,18 @@ org-install.el: $(LISPC)
install: $(LISPF) compile autoloads
if [ ! -d $(lispdir) ]; then $(MKDIR) $(lispdir); else true; fi ;
$(CP) $(LISPC) $(LISPF) $(LISPO) $(lispdir)
- perl -i -pe 's/^(\(defconst org-git-version ).*/\1 "$(GITVERSION)"/;' $(lispdir)/org.el
+ -$(SED) -e 's/^\((defconst org-git-version \).*/\1 "$(GITVERSION)"/;' org.el > $(lispdir)/org.el
$(MAKE) $(lispdir)/org.elc
clean:
- $(RM) $(LISPC)
+ $(RM) *.elc
cleanall:
- $(RM) $(LISPC) $(LISPO)
+ $(RM) *.elc $(LISPO)
+
+clean-install:
+ if [ ! -d $(lispdir) ]; then $(MKDIR) $(lispdir); else true; fi ;
+ $(RM) $(lispdir)/org*.el* $(lispdir)/ob*.el*
$(LISPC): dependencies.mk
diff --git a/targets.mk b/targets.mk
index df54cf3..219e61c 100644
--- a/targets.mk
+++ b/targets.mk
@@ -12,7 +12,8 @@ SUBDIRS = doc $(LISPDIRS) #contrib
compile: lisp
$(MAKE) -C $< $@
-all: $(SUBDIRS)
+all \
+clean-install: $(SUBDIRS)
$(foreach dir, $?, $(MAKE) -C $(dir) $@;)
up2: update