Commits

Anonymous committed a3fd312

package Makefile overhaul -- remove explicit targets, explicit specification of generated .el files, etc; all is done using directives [i.e. variables], as documented in XEmacs.rules

Comments (0)

Files changed (1)

 REQUIRES = xemacs-base psgml edit-utils mail-lib fsf-compat eterm sh-script
 CATEGORY = standard
 
-ELCS = auto-autoloads.elc
-override GENERATED = 
+include ../../Local.rules.inc
 
 DATA_FILES = $(wildcard etc/[EHRWhsw]*) etc/CATALOG $(wildcard etc/*ent) \
 	     $(wildcard etc/*.dtd) $(wildcard etc/*.mod) $(wildcard etc/*.dcl)
 DATA_DEST = $(PACKAGE)
 
-DATA_1_FILES = $(shell $(XEMACS) -batch -no-autoloads -eval "$(GET_CDTD_FILES)")
 GET_CDTD_FILES = \
 (progn \
   (find-file \
      \"FILE.*[ \\t]+\\\\([^ \\t]+\\\\)[ \\r\\t]*\\n\" \
      \" etc/\\\\1\"))))
 
+# Use := here so that this gets evaluated only once.  With just = it gets
+# run four times!!!
+DATA_1_FILES := $(shell $(XEMACS) -batch -no-autoloads -eval "$(GET_CDTD_FILES)")
+
 DATA_1_DEST = $(PACKAGE)/cdtd
 
 DATA_2_FILES = $(wildcard etc/ISO_8879-1986/entities/[A,D-Z]*) \
                $(wildcard etc/ISO_8879-1986/entities/*.ent)
 DATA_2_DEST = $(PACKAGE)/ISO_8879-1986/entities
 
-include ../../XEmacs.rules
-
 SGML_DATA_DIRECTORY = (expand-file-name \"etc\")
 SGML_ECAT_FILES = (expand-file-name \"ECAT\" sgml-data-directory)
 SGML_CATALOG_FILES = (expand-file-name \"CATALOG\" sgml-data-directory)
 
 PRELOADS = -eval "(setq sgml-data-directory $(SGML_DATA_DIRECTORY))"
 
-$(DATA_1_FILES): force
+EXTRA_DEPENDENCIES = $(DATA_1_FILES)
 
-compile:: auto-autoloads.elc \
-	etc/ECAT etc/CATALOG $(DATA_1_FILES) $(DATA_2_FILES) etc/*.ent
+include ../../XEmacs.rules
+
+# This may not actually recompute anything, so touch the files when done to
+# avoid infinite rebuild.
+$(DATA_1_FILES): $(DATA_FILES) $(DATA_2_FILES)
 	mkdir -p etc/cdtd
 	$(BOOT_XEMACS) -l psgml-html -l psgml-parse \
                -eval "(setq sgml-auto-activate-dtd t  \
 			    sgml-ecat-files (list $(SGML_ECAT_FILES))  \
 			    sgml-catalog-files (list $(SGML_CATALOG_FILES)))" \
-	       -f sgml-compile-all-dtds
-
-# I left this target here even though 'clean' is usually done from
-# XEmacs.rules because it was the easiest way to remove the generated
-# files in 'etc/cdtd/' and keep the directory in tact so a
-# '.cvsignore' file could be used.  And I didn't want to put a special
-# case in XEmacs.rules just for the benefit of 1 package. <youngs@xemacs.org>
-clean:: 
-	rm -f etc/cdtd/docbook etc/cdtd/html* etc/cdtd/mathml \
-		etc/cdtd/xhtml1-* auto-autoloads.elc
-
-binkit: binkit-common
-
-# Force rebuilding with this pseudo-target.
-force:
+	       -f sgml-compile-all-dtds && touch $(DATA_1_FILES)