Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCHv2: Allow parallel make
Try this, though I can't test if it has the desired effect here. While I
was in here, I converted all of the 'false' rules to invoke make
instead. Of course this may result in some duplicated work, which is why
the other rules are also updated to do atomic writes, at least the ones
I managed to find / notice. If anyone ever figures out a way to build
zsh without this multi-Makefile dance, that'd be nice too.
---
Src/Makefile.in | 10 +++++-----
Src/mkmakemod.sh | 27 ++++++++++++++-------------
2 files changed, 19 insertions(+), 18 deletions(-)
diff --git a/Src/Makefile.in b/Src/Makefile.in
index 7fc0b364d4..99bafc065f 100644
--- a/Src/Makefile.in
+++ b/Src/Makefile.in
@@ -44,8 +44,8 @@ dir_src = .
# ========= DEPENDENCIES FOR BUILDING ==========
-LINK = $(CC) $(LDFLAGS) $(EXELDFLAGS) $(EXTRA_LDFLAGS) -o $@
-DLLINK = $(DLLD) $(LDFLAGS) $(LIBLDFLAGS) $(DLLDFLAGS) -o $@
+LINK = $(CC) $(LDFLAGS) $(EXELDFLAGS) $(EXTRA_LDFLAGS)
+DLLINK = $(DLLD) $(LDFLAGS) $(LIBLDFLAGS) $(DLLDFLAGS)
all: bin modules
.PHONY: all
@@ -82,11 +82,11 @@ EXTRAZSHOBJS = @EXTRAZSHOBJS@
zsh$(EXEEXT): $(@L@IBZSH) $(@L@STMP) $(MAIN_OBJS) zsh.export $(EXTRAZSHOBJS)
rm -f $@
- $(@L@DRUNPATH) $(LINK) $(MAIN_OBJS) $(EXTRAZSHOBJS) $(@L@LIST) $(ZSH_@E@XPORT) $(@L@IBZSH) $(LIBS)
+ $(@L@DRUNPATH) $(LINK) -o $@ $(MAIN_OBJS) $(EXTRAZSHOBJS) $(@L@LIST) $(ZSH_@E@XPORT) $(@L@IBZSH) $(LIBS)
$(LIBZSH): $(LIBOBJS) $(NSTMP)
- rm -f $@
- $(DLLINK) $(LIBOBJS) $(NLIST) $(LIBS)
+ $(DLLINK) -o $@.tmp.$$$$ $(LIBOBJS) $(NLIST) $(LIBS); \
+ mv -f $@.tmp.$$$$ $@
zsh.res.o: $(sdir)/zsh.rc $(sdir)/zsh.ico
windres -O coff --include-dir $(sdir) -i $(sdir)/zsh.rc -o zsh.res.o
diff --git a/Src/mkmakemod.sh b/Src/mkmakemod.sh
index 1692b58ee7..ebe0a7142b 100644
--- a/Src/mkmakemod.sh
+++ b/Src/mkmakemod.sh
@@ -305,7 +305,8 @@ if $first_stage; then
echo "\$(SYMS_${mddname}): \$(PROTODEPS)"
echo
echo "${mddname}.export: \$(SYMS_${mddname})"
- echo " @( echo '#!'; cat \$(SYMS_${mddname}) | sed -n '/^X/{s/^X//;p;}' | sort -u ) > \$@"
+ echo " @( echo '#!'; cat \$(SYMS_${mddname}) | sed -n '/^X/{s/^X//;p;}' | sort -u ) > \$@.tmp.\$\$\$\$; \\"
+ echo " mv -f \$@.tmp.\$\$\$\$ \$@"
echo
echo "modobjs.${mddname}: \$(MODOBJS_${mddname})"
echo " @echo '' \$(MODOBJS_${mddname}) $modobjs_sed> \$(dir_src)/stamp-modobjs.tmp-${q_mddname}"
@@ -426,31 +427,31 @@ if $first_stage; then
echo " @cd @%@ && \$(MAKE) \$(MAKEDEFS) @%@$mdh"
echo
done | sed 's,^\(.*\)@%@\(.*\)@%@\(.*\)/\([^/]*\)$,\1\3\2\4,'
- if test -n "$other_mdhs"; then
- echo "${other_mdhs}:" | sed 's,^ ,,'
- echo " false # should only happen with make -n"
+ for mdh in $other_mdhs; do
+ echo "$mdh: FORCE"
+ echo " @cd @%@ && \$(MAKE) \$(MAKEDEFS) @%@$mdh"
echo
- fi
+ done | sed 's,^\(.*\)@%@\(.*\)@%@\(.*\)/\([^/]*\)$,\1\3\2\4,'
for export in $remote_exports; do
echo "$export: FORCE"
echo " @cd @%@ && \$(MAKE) \$(MAKEDEFS) @%@$export"
echo
done | sed 's,^\(.*\)@%@\(.*\)@%@\(.*\)/\([^/]*\)$,\1\3\2\4,'
- if test -n "$other_exports"; then
- echo "${other_exports}:" | sed 's,^ ,,'
- echo " false # should only happen with make -n"
+ for export in $other_exports; do
+ echo "$export: FORCE"
+ echo " @cd @%@ && \$(MAKE) \$(MAKEDEFS) @%@$export"
echo
- fi
+ done | sed 's,^\(.*\)@%@\(.*\)@%@\(.*\)/\([^/]*\)$,\1\3\2\4,'
for mdll in $remote_modules; do
echo "$mdll: FORCE"
echo " @cd @%@ && \$(MAKE) \$(MAKEDEFS) @%@$mdll"
echo
done | sed 's,^\(.*\)@%@\(.*\)@%@\(.*\)/\([^/]*\)$,\1\3\2\4,'
- if test -n "$other_modules"; then
- echo "${other_modules}:" | sed 's,^ ,,'
- echo " false # should only happen with make -n"
+ for mdll in $other_modules; do
+ echo "$mdll: FORCE"
+ echo " @cd @%@ && \$(MAKE) \$(MAKEDEFS) @%@$mdll"
echo
- fi
+ done | sed 's,^\(.*\)@%@\(.*\)@%@\(.*\)/\([^/]*\)$,\1\3\2\4,'
fi
echo "##### End of ${the_makefile}.in"
--
2.38.1
Messages sorted by:
Reverse Date,
Date,
Thread,
Author