annotate scripts/module.mk @ 31899:c01849481834

avoid problems with $(shell ...) execution in Makefile The $(shell ...) variable in GNU Make is expanded early before Makefile variables are defined or exported. This feature causes trouble for some of Octave's build system shell scripts that may need environment variables and that also need to be executed early to generate lists of dependencies. To work around this problem we can use configure to substitute the needed variables instead of relying on the Make environment. See also the discussion here: https://octave.discourse.group/t/egrep-warning-egrep-is-obsolescent-using-ggrep-e/3484/37 * find-defun-files.in.sh: Rename from find-defun-files.sh. * find-files-with-tests.in.sh: Rename from find-files-with-tests.sh. * build-aux/module.mk: Update. * configure.ac (AC_CONFIG_FILES): Include find-defun-files.sh and find-files-with-tests.sh in the list of output files. * libinterp/module.mk, liboctave/module.mk, scripts/module.mk: Remove "$(srcdir)/" prefix from invocations or find-defun-files.sh and find-files-with-tests.sh.
author John W. Eaton <jwe@octave.org>
date Wed, 08 Mar 2023 15:06:45 -0500
parents 02b97abbc6fc
children 25e8f63da459
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
23495
8308417aff1c use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents: 23348
diff changeset
1 %canon_reldir%_EXTRA_DIST =
20366
9b44691a3520 provide per-directory clean targets
John W. Eaton <jwe@octave.org>
parents: 20364
diff changeset
2
23495
8308417aff1c use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents: 23348
diff changeset
3 %canon_reldir%_CLEANFILES =
8308417aff1c use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents: 23348
diff changeset
4 %canon_reldir%_DISTCLEANFILES =
8308417aff1c use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents: 23348
diff changeset
5 %canon_reldir%_MAINTAINERCLEANFILES =
20366
9b44691a3520 provide per-directory clean targets
John W. Eaton <jwe@octave.org>
parents: 20364
diff changeset
6
23495
8308417aff1c use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents: 23348
diff changeset
7 include %reldir%/+containers/module.mk
26201
750a6f9957ea New functions makeUniqueStrings and makeValidName (bug #52596).
Guillaume Flandin <guillaume.offline@gmail.com>
parents: 25718
diff changeset
8 include %reldir%/+matlab/+lang/module.mk
28769
903fe321649b Add Matlab compatible wrappers for base64_encode and base64_decode.
Markus Mützel <markus.muetzel@gmx.de>
parents: 28427
diff changeset
9 include %reldir%/+matlab/+net/module.mk
23495
8308417aff1c use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents: 23348
diff changeset
10 include %reldir%/audio/module.mk
8308417aff1c use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents: 23348
diff changeset
11 include %reldir%/deprecated/module.mk
8308417aff1c use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents: 23348
diff changeset
12 include %reldir%/elfun/module.mk
8308417aff1c use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents: 23348
diff changeset
13 include %reldir%/general/module.mk
8308417aff1c use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents: 23348
diff changeset
14 include %reldir%/geometry/module.mk
8308417aff1c use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents: 23348
diff changeset
15 include %reldir%/gui/module.mk
8308417aff1c use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents: 23348
diff changeset
16 include %reldir%/help/module.mk
8308417aff1c use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents: 23348
diff changeset
17 include %reldir%/image/module.mk
8308417aff1c use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents: 23348
diff changeset
18 include %reldir%/io/module.mk
8308417aff1c use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents: 23348
diff changeset
19 include %reldir%/java/module.mk
25718
a3448e97ccc8 new scripts/legacy directory for Matlab functions that refuse to die
John W. Eaton <jwe@octave.org>
parents: 24547
diff changeset
20 include %reldir%/legacy/module.mk
23495
8308417aff1c use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents: 23348
diff changeset
21 include %reldir%/linear-algebra/module.mk
8308417aff1c use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents: 23348
diff changeset
22 include %reldir%/miscellaneous/module.mk
8308417aff1c use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents: 23348
diff changeset
23 include %reldir%/ode/module.mk
8308417aff1c use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents: 23348
diff changeset
24 include %reldir%/optimization/module.mk
8308417aff1c use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents: 23348
diff changeset
25 include %reldir%/path/module.mk
8308417aff1c use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents: 23348
diff changeset
26 include %reldir%/pkg/module.mk
8308417aff1c use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents: 23348
diff changeset
27 include %reldir%/plot/appearance/module.mk
8308417aff1c use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents: 23348
diff changeset
28 include %reldir%/plot/draw/module.mk
8308417aff1c use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents: 23348
diff changeset
29 include %reldir%/plot/util/module.mk
8308417aff1c use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents: 23348
diff changeset
30 include %reldir%/polynomial/module.mk
8308417aff1c use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents: 23348
diff changeset
31 include %reldir%/prefs/module.mk
8308417aff1c use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents: 23348
diff changeset
32 include %reldir%/profiler/module.mk
8308417aff1c use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents: 23348
diff changeset
33 include %reldir%/set/module.mk
8308417aff1c use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents: 23348
diff changeset
34 include %reldir%/signal/module.mk
8308417aff1c use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents: 23348
diff changeset
35 include %reldir%/sparse/module.mk
8308417aff1c use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents: 23348
diff changeset
36 include %reldir%/specfun/module.mk
8308417aff1c use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents: 23348
diff changeset
37 include %reldir%/special-matrix/module.mk
8308417aff1c use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents: 23348
diff changeset
38 include %reldir%/startup/module.mk
24547
fdc9ce839afd maint: Remove statistics functions which have been shifted to Octave Forge package.
Rik <rik@octave.org>
parents: 23709
diff changeset
39 include %reldir%/statistics/module.mk
23495
8308417aff1c use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents: 23348
diff changeset
40 include %reldir%/strings/module.mk
8308417aff1c use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents: 23348
diff changeset
41 include %reldir%/testfun/module.mk
8308417aff1c use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents: 23348
diff changeset
42 include %reldir%/time/module.mk
27048
159402e52cfa New implementation of RESTful web services as part of GSoC 2018 (patch #9795).
Sahil Yadav <yadavsahil5198@gmail.com>
parents: 26201
diff changeset
43 include %reldir%/web/module.mk
20328
fa9fa6ab76f0 eliminate recursive make invocation in scripts directory tree
John W. Eaton <jwe@octave.org>
parents:
diff changeset
44
23495
8308417aff1c use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents: 23348
diff changeset
45 ## include %reldir%/@ftp/module.mk
21093
0ebb8e26ebbc build: Document Automake failure to 'include scripts/@ftp/module.mk'.
Rik <rik@octave.org>
parents: 21092
diff changeset
46 ## The include above fails because Automake cannot process the '@' character.
23495
8308417aff1c use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents: 23348
diff changeset
47 ## As a work around, the contents of %reldir%/@ftp/module.mk are placed directly
21093
0ebb8e26ebbc build: Document Automake failure to 'include scripts/@ftp/module.mk'.
Rik <rik@octave.org>
parents: 21092
diff changeset
48 ## in this module.mk file.
28427
7a8c69c4eb55 convert obsolete octave_fcn_inline object to @inline class
John W. Eaton <jwe@octave.org>
parents: 27048
diff changeset
49 scripts_EXTRA_DIST += %reldir%/@ftp/module.mk
23495
8308417aff1c use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents: 23348
diff changeset
50 ######################## include %reldir%/@ftp/module.mk ########################
8308417aff1c use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents: 23348
diff changeset
51 FCN_FILE_DIRS += %reldir%/@ftp
21093
0ebb8e26ebbc build: Document Automake failure to 'include scripts/@ftp/module.mk'.
Rik <rik@octave.org>
parents: 21092
diff changeset
52
28956
0089f0213384 Mark all core script files as encoded in UTF-8 (bug #49685).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28769
diff changeset
53 %canon_reldir%_FCN_FILES = \
28971
02b97abbc6fc maint: rename .oct_config files to .oct-config
John W. Eaton <jwe@octave.org>
parents: 28956
diff changeset
54 %reldir%/.oct-config
28956
0089f0213384 Mark all core script files as encoded in UTF-8 (bug #49685).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28769
diff changeset
55
23495
8308417aff1c use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents: 23348
diff changeset
56 %canon_reldir%_@ftp_FCN_FILES = \
8308417aff1c use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents: 23348
diff changeset
57 %reldir%/@ftp/ascii.m \
8308417aff1c use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents: 23348
diff changeset
58 %reldir%/@ftp/binary.m \
8308417aff1c use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents: 23348
diff changeset
59 %reldir%/@ftp/cd.m \
8308417aff1c use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents: 23348
diff changeset
60 %reldir%/@ftp/close.m \
8308417aff1c use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents: 23348
diff changeset
61 %reldir%/@ftp/delete.m \
8308417aff1c use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents: 23348
diff changeset
62 %reldir%/@ftp/dir.m \
8308417aff1c use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents: 23348
diff changeset
63 %reldir%/@ftp/disp.m \
8308417aff1c use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents: 23348
diff changeset
64 %reldir%/@ftp/ftp.m \
8308417aff1c use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents: 23348
diff changeset
65 %reldir%/@ftp/loadobj.m \
8308417aff1c use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents: 23348
diff changeset
66 %reldir%/@ftp/mget.m \
8308417aff1c use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents: 23348
diff changeset
67 %reldir%/@ftp/mkdir.m \
8308417aff1c use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents: 23348
diff changeset
68 %reldir%/@ftp/mput.m \
8308417aff1c use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents: 23348
diff changeset
69 %reldir%/@ftp/rename.m \
8308417aff1c use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents: 23348
diff changeset
70 %reldir%/@ftp/rmdir.m \
8308417aff1c use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents: 23348
diff changeset
71 %reldir%/@ftp/saveobj.m
21093
0ebb8e26ebbc build: Document Automake failure to 'include scripts/@ftp/module.mk'.
Rik <rik@octave.org>
parents: 21092
diff changeset
72
23495
8308417aff1c use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents: 23348
diff changeset
73 %canon_reldir%_@ftpdir = $(fcnfiledir)/@ftp
21093
0ebb8e26ebbc build: Document Automake failure to 'include scripts/@ftp/module.mk'.
Rik <rik@octave.org>
parents: 21092
diff changeset
74
23495
8308417aff1c use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents: 23348
diff changeset
75 %canon_reldir%_@ftp_DATA = $(%canon_reldir%_@ftp_FCN_FILES)
21093
0ebb8e26ebbc build: Document Automake failure to 'include scripts/@ftp/module.mk'.
Rik <rik@octave.org>
parents: 21092
diff changeset
76
28956
0089f0213384 Mark all core script files as encoded in UTF-8 (bug #49685).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28769
diff changeset
77 FCN_FILES += \
0089f0213384 Mark all core script files as encoded in UTF-8 (bug #49685).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28769
diff changeset
78 $(%canon_reldir%_FCN_FILES) \
0089f0213384 Mark all core script files as encoded in UTF-8 (bug #49685).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28769
diff changeset
79 $(%canon_reldir%_@ftp_FCN_FILES)
21093
0ebb8e26ebbc build: Document Automake failure to 'include scripts/@ftp/module.mk'.
Rik <rik@octave.org>
parents: 21092
diff changeset
80
23495
8308417aff1c use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents: 23348
diff changeset
81 PKG_ADD_FILES += %reldir%/@ftp/PKG_ADD
21093
0ebb8e26ebbc build: Document Automake failure to 'include scripts/@ftp/module.mk'.
Rik <rik@octave.org>
parents: 21092
diff changeset
82
23495
8308417aff1c use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents: 23348
diff changeset
83 DIRSTAMP_FILES += %reldir%/@ftp/$(octave_dirstamp)
8308417aff1c use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents: 23348
diff changeset
84 ####################### end include %reldir%/@ftp/module.mk #####################
21093
0ebb8e26ebbc build: Document Automake failure to 'include scripts/@ftp/module.mk'.
Rik <rik@octave.org>
parents: 21092
diff changeset
85
20328
fa9fa6ab76f0 eliminate recursive make invocation in scripts directory tree
John W. Eaton <jwe@octave.org>
parents:
diff changeset
86 image_DATA += $(SCRIPTS_IMAGES)
fa9fa6ab76f0 eliminate recursive make invocation in scripts directory tree
John W. Eaton <jwe@octave.org>
parents:
diff changeset
87
21959
627f582edbe3 extract documentation from .in.m files instead of generated .m files
John W. Eaton <jwe@octave.org>
parents: 21879
diff changeset
88 GEN_FCN_FILES_IN = $(GEN_FCN_FILES:.m=.in.m)
20328
fa9fa6ab76f0 eliminate recursive make invocation in scripts directory tree
John W. Eaton <jwe@octave.org>
parents:
diff changeset
89
fa9fa6ab76f0 eliminate recursive make invocation in scripts directory tree
John W. Eaton <jwe@octave.org>
parents:
diff changeset
90 ALL_LOCAL_TARGETS += \
fa9fa6ab76f0 eliminate recursive make invocation in scripts directory tree
John W. Eaton <jwe@octave.org>
parents:
diff changeset
91 $(JAR_FILES)
fa9fa6ab76f0 eliminate recursive make invocation in scripts directory tree
John W. Eaton <jwe@octave.org>
parents:
diff changeset
92
21879
1315aa0ca466 build: Ensure gnuplot_binary.m is generated before building docs (bug #48202)
Mike Miller <mtmiller@octave.org>
parents: 21766
diff changeset
93 OCTAVE_INTERPRETER_TARGETS += \
22075
7a4897e07727 build: ensure all files needed to run octave in build dir are declared
Mike Miller <mtmiller@octave.org>
parents: 22074
diff changeset
94 $(GEN_FCN_FILES) \
7a4897e07727 build: ensure all files needed to run octave in build dir are declared
Mike Miller <mtmiller@octave.org>
parents: 22074
diff changeset
95 $(PKG_ADD_FILES)
21879
1315aa0ca466 build: Ensure gnuplot_binary.m is generated before building docs (bug #48202)
Mike Miller <mtmiller@octave.org>
parents: 21766
diff changeset
96
31899
c01849481834 avoid problems with $(shell ...) execution in Makefile
John W. Eaton <jwe@octave.org>
parents: 28971
diff changeset
97 FCN_FILES_WITH_TESTS = $(shell $(SHELL) build-aux/find-files-with-tests.sh "$(srcdir)" $(FCN_FILES) $(GEN_FCN_FILES_IN))
23572
0703d31e1ec0 new script for updating test status for fixed bugs
John W. Eaton <jwe@octave.org>
parents: 23495
diff changeset
98
20328
fa9fa6ab76f0 eliminate recursive make invocation in scripts directory tree
John W. Eaton <jwe@octave.org>
parents:
diff changeset
99 define PKG_ADD_FILE_TEMPLATE
23709
3b68aeeabc40 rename some build scripts for consistency and move them to where they are used
John W. Eaton <jwe@octave.org>
parents: 23572
diff changeset
100 $(1)/PKG_ADD: $$($(2)_FCN_FILES) $$($(2)_GEN_FCN_FILES) $(1)/$(octave_dirstamp) %reldir%/mk-pkg-add.sh
20328
fa9fa6ab76f0 eliminate recursive make invocation in scripts directory tree
John W. Eaton <jwe@octave.org>
parents:
diff changeset
101 $$(AM_V_GEN)rm -f $$@-t $$@ && \
23709
3b68aeeabc40 rename some build scripts for consistency and move them to where they are used
John W. Eaton <jwe@octave.org>
parents: 23572
diff changeset
102 $$(SHELL) $$(srcdir)/%reldir%/mk-pkg-add.sh $(srcdir) $$($(2)_FCN_FILES) -- $$($(2)_GEN_FCN_FILES) > $$@-t && \
20328
fa9fa6ab76f0 eliminate recursive make invocation in scripts directory tree
John W. Eaton <jwe@octave.org>
parents:
diff changeset
103 mv $$@-t $$@
fa9fa6ab76f0 eliminate recursive make invocation in scripts directory tree
John W. Eaton <jwe@octave.org>
parents:
diff changeset
104 endef
fa9fa6ab76f0 eliminate recursive make invocation in scripts directory tree
John W. Eaton <jwe@octave.org>
parents:
diff changeset
105
fa9fa6ab76f0 eliminate recursive make invocation in scripts directory tree
John W. Eaton <jwe@octave.org>
parents:
diff changeset
106 $(foreach d, $(FCN_FILE_DIRS), $(eval $(call PKG_ADD_FILE_TEMPLATE, $(d),$(subst /,_,$(subst -,_,$(d))))))
fa9fa6ab76f0 eliminate recursive make invocation in scripts directory tree
John W. Eaton <jwe@octave.org>
parents:
diff changeset
107
fa9fa6ab76f0 eliminate recursive make invocation in scripts directory tree
John W. Eaton <jwe@octave.org>
parents:
diff changeset
108 define GEN_FCN_FILES_TEMPLATE
21959
627f582edbe3 extract documentation from .in.m files instead of generated .m files
John W. Eaton <jwe@octave.org>
parents: 21879
diff changeset
109 $(1): $(1:.m=.in.m) build-aux/subst-config-vals.sh $(dir $(1))$(octave_dirstamp)
21398
7e8a410e6124 break generated file dependence on Makefile (bug #46063)
John W. Eaton <jwe@octave.org>
parents: 21388
diff changeset
110 $$(AM_V_GEN)$$(call simple-filter-rule,build-aux/subst-config-vals.sh)
20328
fa9fa6ab76f0 eliminate recursive make invocation in scripts directory tree
John W. Eaton <jwe@octave.org>
parents:
diff changeset
111 endef
fa9fa6ab76f0 eliminate recursive make invocation in scripts directory tree
John W. Eaton <jwe@octave.org>
parents:
diff changeset
112
fa9fa6ab76f0 eliminate recursive make invocation in scripts directory tree
John W. Eaton <jwe@octave.org>
parents:
diff changeset
113 $(foreach f, $(GEN_FCN_FILES), $(eval $(call GEN_FCN_FILES_TEMPLATE, $(f))))
fa9fa6ab76f0 eliminate recursive make invocation in scripts directory tree
John W. Eaton <jwe@octave.org>
parents:
diff changeset
114
23495
8308417aff1c use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents: 23348
diff changeset
115 DOCSTRING_FILES += %reldir%/DOCSTRINGS
20393
0fbe2e28ea84 build: Avoid triggering rebuild of docs when DOCSTRINGS regenerated (bug #45567)
Mike Miller <mtmiller@octave.org>
parents: 20366
diff changeset
116
23495
8308417aff1c use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents: 23348
diff changeset
117 %reldir%/DOCSTRINGS: $(FCN_FILES) $(GEN_FCN_FILES_IN) | %reldir%/$(octave_dirstamp)
8308417aff1c use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents: 23348
diff changeset
118 $(AM_V_GEN)rm -f %reldir%/DOCSTRINGS-t && \
23709
3b68aeeabc40 rename some build scripts for consistency and move them to where they are used
John W. Eaton <jwe@octave.org>
parents: 23572
diff changeset
119 $(PERL) $(srcdir)/%reldir%/mk-doc.pl "$(srcdir)" $(FCN_FILES) $(GEN_FCN_FILES_IN) > %reldir%/DOCSTRINGS-t && \
23495
8308417aff1c use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents: 23348
diff changeset
120 $(call move_if_change_rule,%reldir%/DOCSTRINGS-t,$@)
20328
fa9fa6ab76f0 eliminate recursive make invocation in scripts directory tree
John W. Eaton <jwe@octave.org>
parents:
diff changeset
121
23495
8308417aff1c use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents: 23348
diff changeset
122 DIRSTAMP_FILES += %reldir%/$(octave_dirstamp)
22074
5a0eea960bdb build: fix typo of $(octave_dirstamp) in build prerequisites
Mike Miller <mtmiller@octave.org>
parents: 22067
diff changeset
123
20328
fa9fa6ab76f0 eliminate recursive make invocation in scripts directory tree
John W. Eaton <jwe@octave.org>
parents:
diff changeset
124 check-m-sources:
fa9fa6ab76f0 eliminate recursive make invocation in scripts directory tree
John W. Eaton <jwe@octave.org>
parents:
diff changeset
125 @echo "checking whether files in source tree are listed in module.mk files..."; \
fa9fa6ab76f0 eliminate recursive make invocation in scripts directory tree
John W. Eaton <jwe@octave.org>
parents:
diff changeset
126 for f in $$(find $(srcdir)/scripts -name '*.m'); do \
fa9fa6ab76f0 eliminate recursive make invocation in scripts directory tree
John W. Eaton <jwe@octave.org>
parents:
diff changeset
127 found=false; \
fa9fa6ab76f0 eliminate recursive make invocation in scripts directory tree
John W. Eaton <jwe@octave.org>
parents:
diff changeset
128 for m in $(FCN_FILES) $(GEN_FCN_FILES); do \
23495
8308417aff1c use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents: 23348
diff changeset
129 if [ "$$f" = $(srcdir)/%reldir%/"$$m" ]; then \
20328
fa9fa6ab76f0 eliminate recursive make invocation in scripts directory tree
John W. Eaton <jwe@octave.org>
parents:
diff changeset
130 found=true; \
fa9fa6ab76f0 eliminate recursive make invocation in scripts directory tree
John W. Eaton <jwe@octave.org>
parents:
diff changeset
131 break; \
fa9fa6ab76f0 eliminate recursive make invocation in scripts directory tree
John W. Eaton <jwe@octave.org>
parents:
diff changeset
132 fi; \
fa9fa6ab76f0 eliminate recursive make invocation in scripts directory tree
John W. Eaton <jwe@octave.org>
parents:
diff changeset
133 done; \
fa9fa6ab76f0 eliminate recursive make invocation in scripts directory tree
John W. Eaton <jwe@octave.org>
parents:
diff changeset
134 if $$found; then \
fa9fa6ab76f0 eliminate recursive make invocation in scripts directory tree
John W. Eaton <jwe@octave.org>
parents:
diff changeset
135 true; \
fa9fa6ab76f0 eliminate recursive make invocation in scripts directory tree
John W. Eaton <jwe@octave.org>
parents:
diff changeset
136 else \
fa9fa6ab76f0 eliminate recursive make invocation in scripts directory tree
John W. Eaton <jwe@octave.org>
parents:
diff changeset
137 missing=$$(echo $$f | $(SED) "s|^$(srcdir)/scripts||"); \
fa9fa6ab76f0 eliminate recursive make invocation in scripts directory tree
John W. Eaton <jwe@octave.org>
parents:
diff changeset
138 echo "$$missing: not listed in SOURCES"; \
fa9fa6ab76f0 eliminate recursive make invocation in scripts directory tree
John W. Eaton <jwe@octave.org>
parents:
diff changeset
139 fi; \
fa9fa6ab76f0 eliminate recursive make invocation in scripts directory tree
John W. Eaton <jwe@octave.org>
parents:
diff changeset
140 done; \
fa9fa6ab76f0 eliminate recursive make invocation in scripts directory tree
John W. Eaton <jwe@octave.org>
parents:
diff changeset
141 if test -z "$$missing"; then \
fa9fa6ab76f0 eliminate recursive make invocation in scripts directory tree
John W. Eaton <jwe@octave.org>
parents:
diff changeset
142 echo "yes"; \
fa9fa6ab76f0 eliminate recursive make invocation in scripts directory tree
John W. Eaton <jwe@octave.org>
parents:
diff changeset
143 fi
fa9fa6ab76f0 eliminate recursive make invocation in scripts directory tree
John W. Eaton <jwe@octave.org>
parents:
diff changeset
144 .PHONY: check-m-sources
fa9fa6ab76f0 eliminate recursive make invocation in scripts directory tree
John W. Eaton <jwe@octave.org>
parents:
diff changeset
145
fa9fa6ab76f0 eliminate recursive make invocation in scripts directory tree
John W. Eaton <jwe@octave.org>
parents:
diff changeset
146 check-missing-semicolon:
fa9fa6ab76f0 eliminate recursive make invocation in scripts directory tree
John W. Eaton <jwe@octave.org>
parents:
diff changeset
147 @echo "checking for missing semicolons in .m files..."
21385
89fa0694aa2e Fix check-missing-semicolon QA target (bug #47277).
Rik <rik@octave.org>
parents: 21347
diff changeset
148 @( echo "warning on Octave:missing-semicolon;"; \
89fa0694aa2e Fix check-missing-semicolon QA target (bug #47277).
Rik <rik@octave.org>
parents: 21347
diff changeset
149 for m in $(addprefix $(srcdir)/, $(FCN_FILES)) $(GEN_FCN_FILES); do \
89fa0694aa2e Fix check-missing-semicolon QA target (bug #47277).
Rik <rik@octave.org>
parents: 21347
diff changeset
150 ! $(GREP) -q -E '^classdef' $$m || continue; \
89fa0694aa2e Fix check-missing-semicolon QA target (bug #47277).
Rik <rik@octave.org>
parents: 21347
diff changeset
151 ! $(GREP) -q -E '^ *\<function\>' $$m || continue; \
89fa0694aa2e Fix check-missing-semicolon QA target (bug #47277).
Rik <rik@octave.org>
parents: 21347
diff changeset
152 ! (echo $$m | $(GREP) -q __splinefit__.m) || continue; \
20328
fa9fa6ab76f0 eliminate recursive make invocation in scripts directory tree
John W. Eaton <jwe@octave.org>
parents:
diff changeset
153 echo "source ('$$m');"; \
21347
2f9de06a526e maint: Clean up calls to run-octave in build system
Mike Miller <mtmiller@octave.org>
parents: 21290
diff changeset
154 done ) | $(SHELL) run-octave --norc --silent --no-history
20328
fa9fa6ab76f0 eliminate recursive make invocation in scripts directory tree
John W. Eaton <jwe@octave.org>
parents:
diff changeset
155 .PHONY: check-missing-semicolon
fa9fa6ab76f0 eliminate recursive make invocation in scripts directory tree
John W. Eaton <jwe@octave.org>
parents:
diff changeset
156
21388
b9cb3a96849a build: Calculate ctags for m-files as well as C/C++/Fortran sources (bug #47317).
Rik <rik@octave.org>
parents: 21385
diff changeset
157 ## Include m-files in list of sources when building tag files.
b9cb3a96849a build: Calculate ctags for m-files as well as C/C++/Fortran sources (bug #47317).
Rik <rik@octave.org>
parents: 21385
diff changeset
158 ## Automake will not include these because there is no xxx_SOURCES target
b9cb3a96849a build: Calculate ctags for m-files as well as C/C++/Fortran sources (bug #47317).
Rik <rik@octave.org>
parents: 21385
diff changeset
159 TAGS_DEPENDENCIES = $(addprefix $(srcdir)/, $(FCN_FILES)) $(GEN_FCN_FILES)
b9cb3a96849a build: Calculate ctags for m-files as well as C/C++/Fortran sources (bug #47317).
Rik <rik@octave.org>
parents: 21385
diff changeset
160 TAGS_FILES = $(addprefix $(srcdir)/, $(FCN_FILES)) $(GEN_FCN_FILES)
20328
fa9fa6ab76f0 eliminate recursive make invocation in scripts directory tree
John W. Eaton <jwe@octave.org>
parents:
diff changeset
161
fa9fa6ab76f0 eliminate recursive make invocation in scripts directory tree
John W. Eaton <jwe@octave.org>
parents:
diff changeset
162 install-data-local: install-startup-files install-pkg-add
fa9fa6ab76f0 eliminate recursive make invocation in scripts directory tree
John W. Eaton <jwe@octave.org>
parents:
diff changeset
163
fa9fa6ab76f0 eliminate recursive make invocation in scripts directory tree
John W. Eaton <jwe@octave.org>
parents:
diff changeset
164 uninstall-local: uninstall-startup-files uninstall-pkg-add
fa9fa6ab76f0 eliminate recursive make invocation in scripts directory tree
John W. Eaton <jwe@octave.org>
parents:
diff changeset
165
fa9fa6ab76f0 eliminate recursive make invocation in scripts directory tree
John W. Eaton <jwe@octave.org>
parents:
diff changeset
166 install-pkg-add:
fa9fa6ab76f0 eliminate recursive make invocation in scripts directory tree
John W. Eaton <jwe@octave.org>
parents:
diff changeset
167 for f in $(PKG_ADD_FILES); do \
fa9fa6ab76f0 eliminate recursive make invocation in scripts directory tree
John W. Eaton <jwe@octave.org>
parents:
diff changeset
168 if [ -n "`cat $$f`" ]; then \
23495
8308417aff1c use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents: 23348
diff changeset
169 base=`echo $$f | $(SED) 's,^%reldir%/,,'`; \
20355
e365a34a1c5c Fix more installation discrepancies in scripts directory
Mike Miller <mtmiller@octave.org>
parents: 20343
diff changeset
170 $(MKDIR_P) $(DESTDIR)$(fcnfiledir)/`echo $$base | $(SED) 's,/[^/]*$$,,'`; \
e365a34a1c5c Fix more installation discrepancies in scripts directory
Mike Miller <mtmiller@octave.org>
parents: 20343
diff changeset
171 $(INSTALL_DATA) $$f $(DESTDIR)$(fcnfiledir)/$$base; \
20328
fa9fa6ab76f0 eliminate recursive make invocation in scripts directory tree
John W. Eaton <jwe@octave.org>
parents:
diff changeset
172 fi \
fa9fa6ab76f0 eliminate recursive make invocation in scripts directory tree
John W. Eaton <jwe@octave.org>
parents:
diff changeset
173 done
fa9fa6ab76f0 eliminate recursive make invocation in scripts directory tree
John W. Eaton <jwe@octave.org>
parents:
diff changeset
174 .PHONY: install-pkg-add
fa9fa6ab76f0 eliminate recursive make invocation in scripts directory tree
John W. Eaton <jwe@octave.org>
parents:
diff changeset
175
fa9fa6ab76f0 eliminate recursive make invocation in scripts directory tree
John W. Eaton <jwe@octave.org>
parents:
diff changeset
176 uninstall-pkg-add:
fa9fa6ab76f0 eliminate recursive make invocation in scripts directory tree
John W. Eaton <jwe@octave.org>
parents:
diff changeset
177 for f in $(PKG_ADD_FILES); do \
23495
8308417aff1c use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents: 23348
diff changeset
178 base=`echo $$f | $(SED) 's,^%reldir%/,,'`; \
20364
806a762111d9 Fix uninstallation of PKG_ADD files
Mike Miller <mtmiller@octave.org>
parents: 20361
diff changeset
179 rm -f $(DESTDIR)$(fcnfiledir)/$$base; \
20328
fa9fa6ab76f0 eliminate recursive make invocation in scripts directory tree
John W. Eaton <jwe@octave.org>
parents:
diff changeset
180 done
fa9fa6ab76f0 eliminate recursive make invocation in scripts directory tree
John W. Eaton <jwe@octave.org>
parents:
diff changeset
181 .PHONY: uninstall-pkg-add
fa9fa6ab76f0 eliminate recursive make invocation in scripts directory tree
John W. Eaton <jwe@octave.org>
parents:
diff changeset
182
fa9fa6ab76f0 eliminate recursive make invocation in scripts directory tree
John W. Eaton <jwe@octave.org>
parents:
diff changeset
183 if AMCOND_HAVE_JAVA
20340
22a2f6a7f6dc * scripts/module.mk (scripts-dist-hook): Always define.
John W. Eaton <jwe@octave.org>
parents: 20333
diff changeset
184 scripts-dist-hook:
20328
fa9fa6ab76f0 eliminate recursive make invocation in scripts directory tree
John W. Eaton <jwe@octave.org>
parents:
diff changeset
185 else
fa9fa6ab76f0 eliminate recursive make invocation in scripts directory tree
John W. Eaton <jwe@octave.org>
parents:
diff changeset
186 scripts-dist-hook:
fa9fa6ab76f0 eliminate recursive make invocation in scripts directory tree
John W. Eaton <jwe@octave.org>
parents:
diff changeset
187 @echo "Packaging distribution requires Java." ; exit 1;
fa9fa6ab76f0 eliminate recursive make invocation in scripts directory tree
John W. Eaton <jwe@octave.org>
parents:
diff changeset
188 endif
fa9fa6ab76f0 eliminate recursive make invocation in scripts directory tree
John W. Eaton <jwe@octave.org>
parents:
diff changeset
189
23495
8308417aff1c use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents: 23348
diff changeset
190 %canon_reldir%_EXTRA_DIST += \
20328
fa9fa6ab76f0 eliminate recursive make invocation in scripts directory tree
John W. Eaton <jwe@octave.org>
parents:
diff changeset
191 $(SCRIPTS_IMAGES) \
fa9fa6ab76f0 eliminate recursive make invocation in scripts directory tree
John W. Eaton <jwe@octave.org>
parents:
diff changeset
192 $(FCN_FILES) \
20361
bf92a14c0e76 don't include GEN_FCN_FILES in FCN_FILES list
John W. Eaton <jwe@octave.org>
parents: 20355
diff changeset
193 $(GEN_FCN_FILES_IN) \
23495
8308417aff1c use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents: 23348
diff changeset
194 %reldir%/DOCSTRINGS \
23709
3b68aeeabc40 rename some build scripts for consistency and move them to where they are used
John W. Eaton <jwe@octave.org>
parents: 23572
diff changeset
195 %reldir%/mk-doc.pl \
3b68aeeabc40 rename some build scripts for consistency and move them to where they are used
John W. Eaton <jwe@octave.org>
parents: 23572
diff changeset
196 %reldir%/mk-pkg-add.sh
20328
fa9fa6ab76f0 eliminate recursive make invocation in scripts directory tree
John W. Eaton <jwe@octave.org>
parents:
diff changeset
197
23495
8308417aff1c use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents: 23348
diff changeset
198 EXTRA_DIST += $(%canon_reldir%_EXTRA_DIST)
20366
9b44691a3520 provide per-directory clean targets
John W. Eaton <jwe@octave.org>
parents: 20364
diff changeset
199
23495
8308417aff1c use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents: 23348
diff changeset
200 %canon_reldir%_CLEANFILES += \
22024
659731a4563f build: delete generated files, keep distributed files on clean and distclean (bug #45646)
Mike Miller <mtmiller@octave.org>
parents: 22015
diff changeset
201 $(GEN_FCN_FILES) \
22015
cb25e0da9541 build: clean all PKG_ADD, *.oct, and *-tst files on 'make clean'
Mike Miller <mtmiller@octave.org>
parents: 21971
diff changeset
202 $(PKG_ADD_FILES)
cb25e0da9541 build: clean all PKG_ADD, *.oct, and *-tst files on 'make clean'
Mike Miller <mtmiller@octave.org>
parents: 21971
diff changeset
203
23495
8308417aff1c use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents: 23348
diff changeset
204 %canon_reldir%_DISTCLEANFILES += \
22024
659731a4563f build: delete generated files, keep distributed files on clean and distclean (bug #45646)
Mike Miller <mtmiller@octave.org>
parents: 22015
diff changeset
205 $(DIRSTAMP_FILES)
20328
fa9fa6ab76f0 eliminate recursive make invocation in scripts directory tree
John W. Eaton <jwe@octave.org>
parents:
diff changeset
206
23495
8308417aff1c use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents: 23348
diff changeset
207 %canon_reldir%_MAINTAINERCLEANFILES += \
8308417aff1c use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents: 23348
diff changeset
208 %reldir%/DOCSTRINGS
20409
4300fe896004 build: Don't remove built documentation for distclean target (bug #45646).
Rik <rik@octave.org>
parents: 20393
diff changeset
209
23495
8308417aff1c use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents: 23348
diff changeset
210 CLEANFILES += $(%canon_reldir%_CLEANFILES)
8308417aff1c use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents: 23348
diff changeset
211 DISTCLEANFILES += $(%canon_reldir%_DISTCLEANFILES)
8308417aff1c use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents: 23348
diff changeset
212 MAINTAINERCLEANFILES += $(%canon_reldir%_MAINTAINERCLEANFILES)
20366
9b44691a3520 provide per-directory clean targets
John W. Eaton <jwe@octave.org>
parents: 20364
diff changeset
213
9b44691a3520 provide per-directory clean targets
John W. Eaton <jwe@octave.org>
parents: 20364
diff changeset
214 scripts-clean:
23495
8308417aff1c use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents: 23348
diff changeset
215 rm -f $(%canon_reldir%_CLEANFILES)
20366
9b44691a3520 provide per-directory clean targets
John W. Eaton <jwe@octave.org>
parents: 20364
diff changeset
216
9b44691a3520 provide per-directory clean targets
John W. Eaton <jwe@octave.org>
parents: 20364
diff changeset
217 scripts-distclean: scripts-clean
23495
8308417aff1c use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents: 23348
diff changeset
218 rm -f $(%canon_reldir%_DISTCLEANFILES)
20366
9b44691a3520 provide per-directory clean targets
John W. Eaton <jwe@octave.org>
parents: 20364
diff changeset
219
9b44691a3520 provide per-directory clean targets
John W. Eaton <jwe@octave.org>
parents: 20364
diff changeset
220 scripts-maintainer-clean: scripts-distclean
23495
8308417aff1c use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents: 23348
diff changeset
221 rm -f $(%canon_reldir%_MAINTAINERCLEANFILES)