Browse Source

Makefile: some refactoring for "make vanilla"

* mk/default.mk (BTEST_INIT): Isolate load-path manipulation into
  BTEST_LOAD and do whitespace cleanup.  (EMACSQ): New variable for an
  Emacs with no configuration files.  (NOBATCH, BATCH): Use EMACSQ.

* mk/targets.mk (vanilla): Do not echo command line and explicitly say
  that we don't get a return value.  (CONF_CALL): Add NOBATCH to the
  list of things shown in `make config-all´.
Achim Gratz 11 năm trước cách đây
mục cha
commit
49c128c300
2 tập tin đã thay đổi với 21 bổ sung16 xóa
  1. 19 14
      mk/default.mk
  2. 2 2
      mk/targets.mk

+ 19 - 14
mk/default.mk

@@ -53,20 +53,22 @@ BTEST_EXTRA =
 req-ob-lang = --eval '(require '"'"'ob-$(ob-lang))'
 lst-ob-lang = ($(ob-lang) . t)
 req-extra   = --eval '(require '"'"'$(req))'
-BTEST_RE ?= \\(org\\|ob\\)
-BTEST_INIT = $(BATCH) \
-	  $(BTEST_PRE) \
-	  --eval '(add-to-list '"'"'load-path (concat default-directory "lisp"))' \
-	  --eval '(add-to-list '"'"'load-path (concat default-directory "testing"))' \
-	  $(BTEST_POST)
-BTEST	= $(BTEST_INIT) \
+BTEST_RE   ?= \\(org\\|ob\\)
+BTEST_LOAD  = \
+	--eval '(add-to-list '"'"'load-path (concat default-directory "lisp"))' \
+	--eval '(add-to-list '"'"'load-path (concat default-directory "testing"))'
+BTEST_INIT  = $(BTEST_PRE) $(BTEST_LOAD) $(BTEST_POST)
+
+BTEST = $(BATCH) $(BTEST_INIT) \
 	  -l org-batch-test-init \
 	  --eval '(setq \
 		org-batch-test t \
 		org-babel-load-languages \
-	          (quote ($(foreach ob-lang,$(BTEST_OB_LANGUAGES) emacs-lisp shell org,$(lst-ob-lang)))) \
-	    org-test-select-re "$(BTEST_RE)" \
-	  )' \
+		  (quote ($(foreach ob-lang,\
+				$(BTEST_OB_LANGUAGES) emacs-lisp shell org,\
+				$(lst-ob-lang)))) \
+		org-test-select-re "$(BTEST_RE)" \
+		)' \
 	  -l org-loaddefs.el \
 	  -l cl -l testing/org-test.el \
 	  -l ert -l org -l ox \
@@ -74,12 +76,15 @@ BTEST	= $(BTEST_INIT) \
 	  --eval '(org-test-run-batch-tests org-test-select-re)'
 
 # Running a plain emacs with no config and this Org-mode loaded.  This
-# should be useful for testing and for manually verrifying problems.
-NOBATCH = $(filter-out -batch,$(BTEST_INIT)) -l org -f org-version
+# should be useful for manual testing and verification of problems.
+NOBATCH = $(EMACSQ) $(BTEST_INIT) -l org -f org-version
+
+# start Emacs with no user and site configuration
+# EMACSQ = -vanilla # XEmacs
+EMACSQ  = $(EMACS)  -Q
 
 # Using emacs in batch mode.
-# BATCH = $(EMACS) -batch -vanilla # XEmacs
-BATCH	= $(EMACS) -batch -Q \
+BATCH	= $(EMACSQ) -batch \
 	  --eval '(setq vc-handled-backends nil org-startup-folded nil)'
 
 # Emacs must be started in toplevel directory

+ 2 - 2
mk/targets.mk

@@ -38,7 +38,7 @@ CONF_BASE = EMACS DESTDIR ORGCM ORG_MAKE_DOC
 CONF_DEST = lispdir infodir datadir testdir
 CONF_TEST = BTEST_PRE BTEST_POST BTEST_OB_LANGUAGES BTEST_EXTRA BTEST_RE
 CONF_EXEC = CP MKDIR RM RMR FIND SUDO PDFTEX TEXI2PDF TEXI2HTML MAKEINFO INSTALL_INFO
-CONF_CALL = BATCH BATCHL ELC ELCDIR BTEST MAKE_LOCAL_MK MAKE_ORG_INSTALL MAKE_ORG_VERSION
+CONF_CALL = BATCH BATCHL ELC ELCDIR NOBATCH BTEST MAKE_LOCAL_MK MAKE_ORG_INSTALL MAKE_ORG_VERSION
 config-eol:: EOL = \#
 config-eol:: config-all
 config config-all::
@@ -96,7 +96,7 @@ all clean-install::
 	$(foreach dir, $(SUBDIRS), $(MAKE) -C $(dir) $@;)
 
 vanilla:
-	$(NOBATCH) &
+	-@$(NOBATCH) &
 
 check test::	compile
 check test test-dirty::