Skip to content

Commit a1265e1

Browse files
committed
build: Create directories before redirecting output of generator scripts.
* etc/module.mk, libgui/module.mk, libinterp/module.mk, libinterp/corefcn/module.mk, libinterp/dldfcn/config-module.awk, 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: When configuring with "--disable-dependency-tracking", only a few directories are created in the build tree by the configure script. In that case (especially for parallel builds), the directories to which the output of some generator scripts are redirected might not yet exist. Manually create those directories before running these generator scripts. See: #30 and https://github.com/microsoft/vcpkg/blob/903956eff7cb94774a9e805ff573c000afc43e3e/ports/octave/run-mk-ops.diff
1 parent 29574ba commit a1265e1

File tree

11 files changed

+20
-0
lines changed

11 files changed

+20
-0
lines changed

etc/module.mk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ 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__) && \
105106
$(SED) < $< > $@-t \
106107
-e "s|%OCTAVE_PREFIX%|${prefix}|" && \
107108
mv $@-t $@
@@ -113,6 +114,7 @@ $(BUILT_PNG_ICONS): %reldir%/icons/octave-logo.svg | %reldir%/icons/$(octave_dir
113114

114115
%reldir%/icons/octave-logo.ico: $(WINDOWS_PNG_ICONS) | %reldir%/icons/$(octave_dirstamp)
115116
$(AM_V_GEN)rm -f $@-t $@ && \
117+
([ -z $@-t.__DIR__ ] || mkdir -p $@-t.__DIR__) && \
116118
$(ICOTOOL) --create --raw $(WINDOWS_PNG_ICONS) > $@-t && \
117119
mv $@-t $@
118120

libgui/module.mk

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

8686
define moc-command
8787
rm -f $@-t $@ && \
88+
([ -z $@-t.__DIR__ ] || mkdir -p $@-t.__DIR__) && \
8889
( echo "#if defined (HAVE_CONFIG_H)"; \
8990
echo '# include "config.h"'; \
9091
echo "#endif"; \
@@ -99,6 +100,7 @@ endef
99100

100101
define rcc-command
101102
rm -f $@-t $@ && \
103+
([ -z $@-t.__DIR__ ] || mkdir -p $@-t.__DIR__) && \
102104
( echo "#if defined (HAVE_CONFIG_H)"; \
103105
echo '# include "config.h"'; \
104106
echo "#endif"; \

libinterp/corefcn/module.mk

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ 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__) && \
1213
$(PERL) $(srcdir)/build-aux/mk-opts.pl --opt-handler-fcns $< > $@-t && \
1314
mv $@-t $@
1415

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

297298
%reldir%/graphics.h: %reldir%/graphics.in.h %reldir%/genprops.awk | %reldir%/$(octave_dirstamp)
298299
$(AM_V_GEN)rm -f $@-t && \
300+
([ -z $@-t.__DIR__ ] || mkdir -p $@-t.__DIR__) && \
299301
$(AWK) -f $(srcdir)/%reldir%/genprops.awk $< > $@-t && \
300302
mv $@-t $@
301303

302304
%reldir%/graphics-props.cc: %reldir%/graphics.in.h %reldir%/genprops.awk | %reldir%/$(octave_dirstamp)
303305
$(AM_V_GEN)rm -f $@-t && \
306+
([ -z $@-t.__DIR__ ] || mkdir -p $@-t.__DIR__) && \
304307
$(AWK) -v emit_graphics_props=1 -f $(srcdir)/%reldir%/genprops.awk $< > $@-t && \
305308
mv $@-t $@
306309

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

321325
%reldir%/oct-tex-lexer.ll: %reldir%/oct-tex-lexer.in.ll %reldir%/oct-tex-symbols.in | %reldir%/$(octave_dirstamp)
322326
$(AM_V_GEN)rm -f $@-t && \
327+
([ -z $@-t.__DIR__ ] || mkdir -p $@-t.__DIR__) && \
323328
$(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 && \
324329
mv $@-t $@
325330

326331
%reldir%/oct-tex-symbols.cc: %reldir%/oct-tex-symbols.in | %reldir%/$(octave_dirstamp)
327332
$(AM_V_GEN)rm -f $@-t && \
333+
([ -z $@-t.__DIR__ ] || mkdir -p $@-t.__DIR__) && \
328334
$(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 && \
329335
mv $@-t $@
330336

libinterp/dldfcn/config-module.awk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ 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__) && \\"
99100
print " $(SHELL) $(srcdir)/build-aux/mk-pkg-add.sh \"$(srcdir)\" $(DLDFCN_DEFUN_FILES) > $@-t && \\";
100101
print " mv $@-t $@";
101102
print "";

libinterp/module.mk

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ 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__) && \
210211
$(SHELL) $(srcdir)/%reldir%/mk-build-env-features.sh $< > $@-t && \
211212
mv $@-t $@
212213

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

218219
%reldir%/builtins.cc: $(LIBINTERP_DEFUN_FILES) %reldir%/mk-builtins.pl | %reldir%/$(octave_dirstamp)
219220
$(AM_V_GEN)rm -f $@-t && \
221+
([ -z $@-t.__DIR__ ] || mkdir -p $@-t.__DIR__) && \
220222
$(PERL) $(srcdir)/%reldir%/mk-builtins.pl --source $(mkbuiltins_dld_opt) "$(srcdir)" -- $(LIBINTERP_DEFUN_FILES) > $@-t && \
221223
mv $@-t $@
222224

223225
%reldir%/builtin-defun-decls.h: $(LIBINTERP_DEFUN_FILES) %reldir%/mk-builtins.pl | %reldir%/$(octave_dirstamp)
224226
$(AM_V_GEN)rm -f $@-t && \
227+
([ -z $@-t.__DIR__ ] || mkdir -p $@-t.__DIR__) && \
225228
$(PERL) $(srcdir)/%reldir%/mk-builtins.pl --header $(mkbuiltins_dld_opt) "$(srcdir)" -- $(LIBINTERP_DEFUN_FILES) > $@-t && \
226229
$(simple_move_if_change_rule)
227230

libinterp/operators/module.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,5 +141,6 @@ 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__) && \
144145
$(SHELL) $(srcdir)/%reldir%/mk-ops.sh $(LIBINTERP_OPERATORS_SRC) > $@-t && \
145146
mv $@-t $@

libinterp/parse-tree/module.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ 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__) && \
102103
$(GPERF) -t -C -D -G -L C++ -Z octave_kw_hash $< > $@-t1 && \
103104
$(SED) -e 's,lookup\[,gperf_lookup[,' -e 's,register ,,g' < $@-t1 > $@-t && \
104105
mv $@-t $@ && \

liboctave/external/module.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ 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__) && \
2627
$(SHELL) %reldir%/mk-f77-def.sh $(srcdir) $(%canon_reldir%_libexternal_la_SOURCES) > $@-t && \
2728
mv $@-t $@
2829

liboctave/external/ranlib/module.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ 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__) && \
4849
$(SHELL) %reldir%/../mk-f77-def.sh $(srcdir) $(RANLIB_SRC) > $@-t && \
4950
mv $@-t $@
5051

liboctave/numeric/module.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ 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__) && \
116117
$(PERL) $(srcdir)/build-aux/mk-opts.pl --opt-class-header $< > $@-t && \
117118
mv $@-t $@
118119

0 commit comments

Comments
 (0)