Skip to content

Commit 527535a

Browse files
committed
build: Don't create *.__DIR__ directories when building
Discussion: https://octave.discourse.group/t/7114/ Some 800+ directories named *.__DIR__ were being created and left dring the build process. These directories cause a 15-second slowdown of 'make check' which scans them for any test code to run (10% of 'make check' time). Testing shows that the directories are not required for the build process itself. This changeset therefore removes the code in the build system that was causing those directories to be created. * etc/module.mk, libgui/module.mk, libinterp/corefcn/module.mk, libinterp/dldfcn/config-module.awk, libinterp/module.mk, libinterp/operators/module.mk, libinterp/parse-tree/module.mk, liboctave/external/module.mk, liboctave/external/ranlib/module.mk, liboctave/numeric/module.mk, liboctave/operators/module.mk: Delete directory-creation code as described above.
1 parent f4156f6 commit 527535a

File tree

11 files changed

+0
-20
lines changed

11 files changed

+0
-20
lines changed

etc/module.mk

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ all-icons: %reldir%/icons/org.octave.Octave.desktop $(BUILT_ICONS)
102102

103103
%reldir%/icons/org.octave.Octave.desktop: %reldir%/icons/org.octave.Octave.desktop.in | %reldir%/icons/$(octave_dirstamp)
104104
$(AM_V_GEN)rm -f $@-t $@ && \
105-
([ -z $@-t.__DIR__ ] || mkdir -p $@-t.__DIR__) && \
106105
$(SED) < $< > $@-t \
107106
-e "s|%OCTAVE_PREFIX%|${prefix}|" && \
108107
mv $@-t $@
@@ -114,7 +113,6 @@ $(BUILT_PNG_ICONS): %reldir%/icons/octave-logo.svg | %reldir%/icons/$(octave_dir
114113

115114
%reldir%/icons/octave-logo.ico: $(WINDOWS_PNG_ICONS) | %reldir%/icons/$(octave_dirstamp)
116115
$(AM_V_GEN)rm -f $@-t $@ && \
117-
([ -z $@-t.__DIR__ ] || mkdir -p $@-t.__DIR__) && \
118116
$(ICOTOOL) --create --raw $(WINDOWS_PNG_ICONS) > $@-t && \
119117
mv $@-t $@
120118

libgui/module.mk

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ DIRSTAMP_FILES += \
8686

8787
define moc-command
8888
rm -f $@-t $@ && \
89-
([ -z $@-t.__DIR__ ] || mkdir -p $@-t.__DIR__) && \
9089
( echo "#if defined (HAVE_CONFIG_H)"; \
9190
echo '# include "config.h"'; \
9291
echo "#endif"; \
@@ -101,7 +100,6 @@ endef
101100

102101
define rcc-command
103102
rm -f $@-t $@ && \
104-
([ -z $@-t.__DIR__ ] || mkdir -p $@-t.__DIR__) && \
105103
( echo "#if defined (HAVE_CONFIG_H)"; \
106104
echo '# include "config.h"'; \
107105
echo "#endif"; \

libinterp/corefcn/module.mk

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ OPT_HANDLERS = \
99

1010
$(OPT_HANDLERS): %reldir%/%.cc : liboctave/numeric/%.in | %reldir%/$(octave_dirstamp)
1111
$(AM_V_GEN)rm -f $@-t $@ && \
12-
([ -z $@-t.__DIR__ ] || mkdir -p $@-t.__DIR__) && \
1312
$(PERL) $(srcdir)/build-aux/mk-opts.pl --opt-handler-fcns $< > $@-t && \
1413
mv $@-t $@
1514

@@ -297,19 +296,16 @@ COREFCN_SRC = \
297296

298297
%reldir%/graphics.h: %reldir%/graphics.in.h %reldir%/genprops.awk | %reldir%/$(octave_dirstamp)
299298
$(AM_V_GEN)rm -f $@-t && \
300-
([ -z $@-t.__DIR__ ] || mkdir -p $@-t.__DIR__) && \
301299
$(AWK) -f $(srcdir)/%reldir%/genprops.awk $< > $@-t && \
302300
mv $@-t $@
303301

304302
%reldir%/graphics-props.cc: %reldir%/graphics.in.h %reldir%/genprops.awk | %reldir%/$(octave_dirstamp)
305303
$(AM_V_GEN)rm -f $@-t && \
306-
([ -z $@-t.__DIR__ ] || mkdir -p $@-t.__DIR__) && \
307304
$(AWK) -v emit_graphics_props=1 -f $(srcdir)/%reldir%/genprops.awk $< > $@-t && \
308305
mv $@-t $@
309306

310307
%reldir%/oct-errno.cc: %reldir%/oct-errno.in.cc %reldir%/mk-errno-list.sh | %reldir%/$(octave_dirstamp)
311308
$(AM_V_GEN)rm -f $@-t && \
312-
([ -z $@-t.__DIR__ ] || mkdir -p $@-t.__DIR__) && \
313309
if test -n "$(PERL)"; then \
314310
$(SHELL) $(srcdir)/%reldir%/mk-errno-list.sh --perl "$(PERL)" < $< > $@-t; \
315311
elif test -n "$(PYTHON)"; then \
@@ -324,13 +320,11 @@ COREFCN_SRC = \
324320

325321
%reldir%/oct-tex-lexer.ll: %reldir%/oct-tex-lexer.in.ll %reldir%/oct-tex-symbols.in | %reldir%/$(octave_dirstamp)
326322
$(AM_V_GEN)rm -f $@-t && \
327-
([ -z $@-t.__DIR__ ] || mkdir -p $@-t.__DIR__) && \
328323
$(AWK) 'BEGIN { print "/* DO NOT EDIT. AUTOMATICALLY GENERATED FROM oct-tex-lexer.in.ll and oct-tex-symbols.in. */"; } /^@SYMBOL_RULES@$$/ { count = 0; while (getline < "$(srcdir)/%reldir%/oct-tex-symbols.in") { if ($$0 !~ /^#.*/ && NF == 3) { printf("\"\\\\%s\" { yylval->sym = %d; return SYM; }\n", $$1, count); count++; } } getline } ! /^@SYMBOL_RULES@$$/ { print }' $< > $@-t && \
329324
mv $@-t $@
330325

331326
%reldir%/oct-tex-symbols.cc: %reldir%/oct-tex-symbols.in | %reldir%/$(octave_dirstamp)
332327
$(AM_V_GEN)rm -f $@-t && \
333-
([ -z $@-t.__DIR__ ] || mkdir -p $@-t.__DIR__) && \
334328
$(AWK) 'BEGIN { print "// DO NOT EDIT. AUTOMATICALLY GENERATED FROM oct-tex-symbols.in."; print "static uint32_t symbol_codes[][2] = {"; count = 0; } END { print "};"; printf("static int num_symbol_codes = %d;\n", count); } !/^#/ && (NF == 3) { printf(" { %s, %s },\n", $$2, $$3); count++; }' $< > $@-t && \
335329
mv $@-t $@
336330

libinterp/dldfcn/config-module.awk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ BEGIN {
9696
print "";
9797
print "%reldir%/PKG_ADD: $(DLDFCN_DEFUN_FILES) $(srcdir)/build-aux/mk-pkg-add.sh | %reldir%/$(octave_dirstamp)";
9898
print " $(AM_V_GEN)rm -f $@-t && \\"
99-
print " ([ -z $@-t.__DIR__ ] || mkdir -p $@-t.__DIR__) && \\"
10099
print " $(SHELL) $(srcdir)/build-aux/mk-pkg-add.sh \"$(srcdir)\" $(DLDFCN_DEFUN_FILES) > $@-t && \\";
101100
print " mv $@-t $@";
102101
print "";

libinterp/module.mk

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,6 @@ nobase_libinterptests_DATA = $(LIBINTERP_TST_FILES)
207207

208208
%reldir%/build-env-features.cc: config.h %reldir%/mk-build-env-features.sh | %reldir%/$(octave_dirstamp)
209209
$(AM_V_GEN)rm -f $@-t && \
210-
([ -z $@-t.__DIR__ ] || mkdir -p $@-t.__DIR__) && \
211210
$(SHELL) $(srcdir)/%reldir%/mk-build-env-features.sh $< > $@-t && \
212211
mv $@-t $@
213212

@@ -218,13 +217,11 @@ mkbuiltins_dld_opt =
218217

219218
%reldir%/builtins.cc: $(LIBINTERP_DEFUN_FILES) %reldir%/mk-builtins.pl | %reldir%/$(octave_dirstamp)
220219
$(AM_V_GEN)rm -f $@-t && \
221-
([ -z $@-t.__DIR__ ] || mkdir -p $@-t.__DIR__) && \
222220
$(PERL) $(srcdir)/%reldir%/mk-builtins.pl --source $(mkbuiltins_dld_opt) "$(srcdir)" -- $(LIBINTERP_DEFUN_FILES) > $@-t && \
223221
mv $@-t $@
224222

225223
%reldir%/builtin-defun-decls.h: $(LIBINTERP_DEFUN_FILES) %reldir%/mk-builtins.pl | %reldir%/$(octave_dirstamp)
226224
$(AM_V_GEN)rm -f $@-t && \
227-
([ -z $@-t.__DIR__ ] || mkdir -p $@-t.__DIR__) && \
228225
$(PERL) $(srcdir)/%reldir%/mk-builtins.pl --header $(mkbuiltins_dld_opt) "$(srcdir)" -- $(LIBINTERP_DEFUN_FILES) > $@-t && \
229226
$(simple_move_if_change_rule)
230227

libinterp/operators/module.mk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,5 @@ libinterp_EXTRA_DIST += \
141141
## Special rules for sources which must be built before rest of compilation.
142142
%reldir%/ops.cc: $(LIBINTERP_OPERATORS_SRC) %reldir%/mk-ops.sh
143143
$(AM_V_GEN)rm -f $@-t $@ && \
144-
([ -z $@-t.__DIR__ ] || mkdir -p $@-t.__DIR__) && \
145144
$(SHELL) $(srcdir)/%reldir%/mk-ops.sh $(LIBINTERP_OPERATORS_SRC) > $@-t && \
146145
mv $@-t $@

libinterp/parse-tree/module.mk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ PARSE_TREE_SRC = \
9999
## oct-gperf.h file.
100100
%reldir%/oct-gperf.h: %reldir%/octave.gperf
101101
$(AM_V_GEN)rm -f $@-t $@t1 $@ && \
102-
([ -z $@-t.__DIR__ ] || mkdir -p $@-t.__DIR__) && \
103102
$(GPERF) -t -C -D -G -L C++ -Z octave_kw_hash $< > $@-t1 && \
104103
$(SED) -e 's,lookup\[,gperf_lookup[,' -e 's,register ,,g' < $@-t1 > $@-t && \
105104
mv $@-t $@ && \

liboctave/external/module.mk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ include %reldir%/slatec-fn/module.mk
2323

2424
%reldir%/external.def: $(%canon_reldir%_libexternal_la_SOURCES) %reldir%/mk-f77-def.sh
2525
$(AM_V_GEN)rm -f $@-t $@ && \
26-
([ -z $@-t.__DIR__ ] || mkdir -p $@-t.__DIR__) && \
2726
$(SHELL) %reldir%/mk-f77-def.sh $(srcdir) $(%canon_reldir%_libexternal_la_SOURCES) > $@-t && \
2827
mv $@-t $@
2928

liboctave/external/ranlib/module.mk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ noinst_LTLIBRARIES += %reldir%/libranlib.la
4545
## ranlib directory may not exist in VPATH build; create it if necessary.
4646
%reldir%/ranlib.def: $(RANLIB_SRC) %reldir%/../mk-f77-def.sh | %reldir%/$(octave_dirstamp)
4747
$(AM_V_GEN)rm -f $@-t $@ && \
48-
([ -z $@-t.__DIR__ ] || mkdir -p $@-t.__DIR__) && \
4948
$(SHELL) %reldir%/../mk-f77-def.sh $(srcdir) $(RANLIB_SRC) > $@-t && \
5049
mv $@-t $@
5150

liboctave/numeric/module.mk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ LIBOCTAVE_TEMPLATE_SRC += \
113113
## Special rules for sources which must be built before rest of compilation.
114114
$(LIBOCTAVE_OPT_INC) : %.h : %.in
115115
$(AM_V_GEN)rm -f $@-t $@ && \
116-
([ -z $@-t.__DIR__ ] || mkdir -p $@-t.__DIR__) && \
117116
$(PERL) $(srcdir)/build-aux/mk-opts.pl --opt-class-header $< > $@-t && \
118117
mv $@-t $@
119118

0 commit comments

Comments
 (0)