diff Makefile.am @ 21398:7e8a410e6124

break generated file dependence on Makefile (bug #46063) * build-aux/mk-mxarray-h.in.sh, build-aux/mk-version-h.in.sh, build-aux/subst-config-vals.in.sh, build-aux/subst-cross-config-vals.in.sh, build-aux/subst-default-vals.in.sh, build-aux/subst-f77-isnan-macro.in.sh, build-aux/subst-script-vals.in.sh: New files with commands extracted from build-aux/common.mk. * build-aux/common.mk (ADDRESS_SANITIZER_OPTIONS, do_subst_config_vals, do_subst_cross_config_vals, do_subst_default_vals, do_subst_script_vals): Eliminate macros that are now in script files. (FONTCONFIG_CPPFLAGS, FT2_CPPFLAGS, LIBEXT): Move definition to configure.ac, use AC_SUBST to put values in subst-config-vals.sh and build-aux/subst-cross-config-vals.sh. (startupfiledir, localstartupfiledir): Move definition to configure.ac, use AC_SUBST to put values in subst-default-vals.sh. (ALL_FFLAGS): Delete unused macro. (simple-filter-rule): New macro. * build-aux/mk-default-qt-settings.in.sh: Rename and adapt from libgui/mk-default-qt-settings.in. * build-aux/mk-f77-def.in.sh: Rename and adapt from liboctave/cruft/mkf77def.in. * Makefile.am (EXTRA_DIST): Include new files in the list. * acinclude.m4 (OCTAVE_CONFIG_MOVE_IF_CHANGE_FILES): Assume file names have the suffix .sh and are generated from .in.sh. * Makefile.am (run-octave): Depend on build-aux/subst-script-vals.sh instead of Makefile. (octave-config.h): Use move-if-change rule. * configure.ac: Use ${X} instead of $(X) for variables in OCTAVE_SET_DEFAULT args. (SHARED_LIBS, STATIC_LIBS): AC_SUBST them. Protect timestamp of oct-conf-post.h with a move-if-change rule. * etc/module.mk (etc/icons/octave.appdata.xml, etc/icons/octave.desktop): Don't depend on Makefile. * libgui/module.mk (libgui/default-qt-settings): Depend on build-aux/mk-default-qt-settings.sh instead of Makefile. * build-env.h, build-env.cc (ALL_CFLAGS, ALL_CXXFLAGS, ALL_FFLAGS, ALL_LDFLAGS, LIBFLAGS): Delete variables. * libinterp/corefcn/module.mk ($(OPT_HANDLERS), $(COREFCN_FT2_DF), libinterp/corefcn/defaults.h, libinterp/corefcn/graphics.h, libinterp/corefcn/graphics-props.cc, libinterp/corefcn/oct-errno.cc, libinterp/corefcn/mxarray.h, libinterp/corefcn/oct-tex-lexer.ll): Depend on timestamp file to ensure destination directory exists. (libinterp/corefcn/graphics.h, libinterp/corefcn/graphics-props.cc, libinterp/corefcn/oct-errno.cc, libinterp/corefcn/oct-tex-lexer.ll, libinterp/corefcn/oct-tex-symbols.cc): Use mv instead of move-if-change. (libinterp/corefcn/mxarray.h): Use script to substitute values. Depend on libinterp/corefcn/mxarray.in.h instead of Makefile * libinterp/corefcn/toplev.cc (octave_config_info): Don't include ALL_CFLAGS, ALL_CXXFLAGS, ALL_FFLAGS, ALL_LDFLAGS, of LIBFLAGS in the list. * libinterp/module.mk ($(SRC_DEF_FILES)): Don't depend on Makefile. (libinterp/build-env.cc, libinterp/build-env-features.cc, libinterp/builtins.cc, libinterp/builtin-defun-decls.h, libinterp/dldfcn/PKG_ADD, libinterp/.DOCSTRINGS): Depend on timestamp file to ensure destination directory exists. (libinterp/build-env.cc): Depend on build-aux/subst-config-vals.sh instead of Makefile. (libinterp/version.h): Use script to substitute values. Depend on build-aux/mk-version-h.sh instead of libinterp/version.in.h. * liboctave/cruft/module.mk (liboctave/cruft/cruft.def): Depend on timestamp file to ensure destination directory exists. (liboctave_DISTCLEANFILES): Remove liboctave/cruft/mkf77def from the list. (liboctave_EXTRA_DIST): Don't add liboctave/cruft/mkf77def.in to the list. * liboctave/cruft/ranlib/module.mk (liboctave/cruft/ranlib/ranlib.def): Depend on timestamp file to ensure destination directory exists. * liboctave/cruft/slatec-fn/module.mk (liboctave/cruft/slatec-fn/erfc.f, liboctave/cruft/slatec-fn/derfc.f): Depend on timestamp file to ensure destination directory exists. Use script to substitute values. Depend on build-aux/subst-f77-isnan-macro.sh instead of Makefile. (do-subst-isnan-macro): Delete macro. * scripts/module.mk (GEN_FCN_FILES_TEMPLATE): Use simple-filter-rule to execute build-aux/subst-config-vals.sh. Depend on build-aux/subst-config-vals.sh instead of Makefile. (scripts/.DOCSTRINGS): Don't depend on Makefile. Do depend on timestamp file to ensure destination directory exists. * src/module.mk (src/$(host_triplet)-mkoctfile.cc, src/$(host_triplet)-octave-config.cc): Depend on build-aux/subst-cross-config-vals.sh instead of Makefile. (src/octave-config.cc, src/mkoctfile.cc, src/main.cc): Depend on build-aux/subst-default-vals.sh instead of Makefile.
author John W. Eaton <jwe@octave.org>
date Fri, 04 Mar 2016 12:51:00 -0500
parents 4f994c3f88fc
children 9773a1c2b55f
line wrap: on
line diff
--- a/Makefile.am	Wed Mar 02 16:46:23 2016 -0500
+++ b/Makefile.am	Fri Mar 04 12:51:00 2016 -0500
@@ -47,10 +47,19 @@
   README \
   build-aux/OctJavaQry.class \
   build-aux/find-files-with-tests.sh \
+  build-aux/mk-default-qt-settings.in.sh \
+  build-aux/mk-f77-def.in.sh \
+  build-aux/mk-mxarray-h.in.sh \
+  build-aux/mk-version-h.in.sh \
   build-aux/mk-octave-config-h.sh \
   build-aux/mk-opts.pl \
   build-aux/move-if-change \
   build-aux/stl_algo.h-fixed \
+  build-aux/subst-config-vals.in.sh \
+  build-aux/subst-cross-config-vals.in.sh \
+  build-aux/subst-default-vals.in.sh \
+  build-aux/subst-f77-isnan-macro.in.sh \
+  build-aux/subst-script-vals.in.sh \
   run-octave.in \
   $(BUILT_DISTFILES)
 
@@ -196,13 +205,13 @@
 	@echo "   make install    - to install (PREFIX=$(prefix))"
 	@echo ""
 
-run-octave: run-octave.in Makefile
-	$(AM_V_GEN)$(do_subst_script_vals) && \
-	chmod a+rx "$@"
+run-octave: run-octave.in build-aux/subst-script-vals.sh
+	$(AM_V_GEN)$(call simple-filter-rule,build-aux/subst-script-vals.sh) && \
+	chmod a+rx $@
 
 octave-config.h: config.h build-aux/mk-octave-config-h.sh
 	$(AM_V_GEN)$(SHELL) $(srcdir)/build-aux/mk-octave-config-h.sh $< > $@-t && \
-	mv $@-t $@
+	$(simple_move_if_change_rule)
 
 bits/stl_algo.h: build-aux/stl_algo.h-fixed
 	$(AM_V_GEN)$(MKDIR_P) bits && \