Patch 8.1.1942

21 views
Skip to first unread message

Bram Moolenaar

unread,
Aug 30, 2019, 8:00:14 AM8/30/19
to vim...@googlegroups.com

Patch 8.1.1942
Problem: Shadow directory gets outdated when files are added.
Solution: Add the "shadowupdate" target and add a few comments.
Files: src/Makefile


*** ../vim-8.1.1941/src/Makefile 2019-08-27 22:48:12.737480696 +0200
--- src/Makefile 2019-08-30 13:57:52.671038119 +0200
***************
*** 2828,2839 ****
fi

# Make a shadow directory for compilation on another system or with different
! # features.
SHADOWDIR = shadow

shadow: runtime pixmaps
$(MKDIR_P) $(SHADOWDIR)
! cd $(SHADOWDIR); ln -s ../*.[chm] ../*.in ../*.sh ../*.xs ../*.xbm ../gui_gtk_res.xml ../toolcheck ../proto ../libvterm ../vimtutor ../gvimtutor ../install-sh ../Make_all.mak .
mkdir $(SHADOWDIR)/auto
cd $(SHADOWDIR)/auto; ln -s ../../auto/configure .
$(MKDIR_P) $(SHADOWDIR)/po
--- 2828,2858 ----
fi

# Make a shadow directory for compilation on another system or with different
! # features:
! # % make shadow
! # % cd shadow
! # edit configuration in src/shadow/Makefile
! # % make
! #
! # Alternatively use a link for the Makefile and run configure with flags in
! # another way. When new source files are added use "shadowupdate":
! # % cd shadow
! # % rm Makefile
! # % ln -s ../Makefile .
! # % ./configure {options}
! # % make
! # And later:
! # % git pull
! # % make distclean shadowupdate
! # % ./configure {options}
! # % make
SHADOWDIR = shadow

+ LINKEDFILES = ../*.[chm] ../*.in ../*.sh ../*.xs ../*.xbm ../gui_gtk_res.xml ../toolcheck ../proto ../libvterm ../vimtutor ../gvimtutor ../install-sh ../Make_all.mak
+
shadow: runtime pixmaps
$(MKDIR_P) $(SHADOWDIR)
! cd $(SHADOWDIR); ln -s $(LINKEDFILES) .
mkdir $(SHADOWDIR)/auto
cd $(SHADOWDIR)/auto; ln -s ../../auto/configure .
$(MKDIR_P) $(SHADOWDIR)/po
***************
*** 2867,2872 ****
--- 2886,2897 ----
../../testdir/test83-tags? \
../../testdir/*.ok .

+ # After updating Vim new files may have been created, use this to refresh the
+ # symbolic links in the shadow directory. This isn't guaranteed to catch all
+ # changes, running "make shadow" again might sometimes be needed.
+ shadowupdate:
+ ln -sf $(LINKEDFILES) .
+
# Link needed for doing "make install" in a shadow directory.
runtime:
-ln -s ../runtime .
*** ../vim-8.1.1941/src/version.c 2019-08-30 13:12:21.799590494 +0200
--- src/version.c 2019-08-30 13:59:03.670472063 +0200
***************
*** 763,764 ****
--- 763,766 ----
{ /* Add new patch number below this line */
+ /**/
+ 1942,
/**/

--
hundred-and-one symptoms of being an internet addict:
137. You decide to stay in college for an additional year or two,
just so you can have the free Internet access.

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

Tony Mechelynck

unread,
Aug 30, 2019, 2:20:49 PM8/30/19
to vim_dev
On Fri, Aug 30, 2019 at 2:00 PM Bram Moolenaar <Br...@moolenaar.net> wrote:
>
>
> Patch 8.1.1942
> Problem: Shadow directory gets outdated when files are added.
> Solution: Add the "shadowupdate" target and add a few comments.
> Files: src/Makefile
>
>
> *** ../vim-8.1.1941/src/Makefile 2019-08-27 22:48:12.737480696 +0200
> --- src/Makefile 2019-08-30 13:57:52.671038119 +0200lorsque
> ***************
> *** 2828,2839 ****
> fi
>
> # Make a shadow directory for compilation on another system or with different
> ! # features.
> SHADOWDIR = shadow
>
> shadow: runtime pixmapslorsque
> $(MKDIR_P) $(SHADOWDIR)
> ! cd $(SHADOWDIR); ln -s ../*.[chm] ../*.in ../*.sh ../*.xs ../*.xbm ../gui_gtk_res.xml ../toolcheck ../proto ../libvterm ../vimtutor ../gvimtutor ../install-sh ../Make_all.mak .
> mkdir $(SHADOWDIR)/auto
> cd $(SHADOWDIR)/auto; ln -s ../../auto/configure .
> $(MKDIR_P) $(SHADOWDIR)/po
> --- 2828,2858 ----
> fi
>
> # Make a shadow directory for compilation on another system or with different
> ! # features:
> ! # % make shadow
> ! # % cd shadow
> ! # edit configuration in src/shadow/Makefile
> ! # % make
> ! #
> ! # Alternatively use a link for the Makefile and run configure with flags in
> ! # another way. When new source files are added use "shadowupdate":
> ! # % cd shadow
> ! # % rm Makefile
> ! # % ln -s ../Makefile .
> ! # % ./configure {options}
> ! # % make
> ! # And later:
> ! # % git pull
> ! # % make distclean shadowupdate

The problem with "make distclean" is that it removes all existing
objects, making an incremental compile impossible. This is equivalent
to (assuming config arguments are correctly set in the environment)

cd ..
rm -R shadow
make shadow
cd shadow
make

which was already possible before; but it is really overdoing it when

ln ../somesource.c
make

would have been enough. My aim was to include that ln step into the
incremental make. Only GNU make accepts wildcards in the target name,
you say? Well, IIUC that covers most users. All Linux users AFAIK, and
anyone else who uses gmake. I'll try.
> --
> --
> You received this message from the "vim_dev" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php
>
> ---
> You received this message because you are subscribed to the Google Groups "vim_dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+u...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/201908301200.x7UC06CN015601%40masaka.moolenaar.net.

Bram Moolenaar

unread,
Aug 30, 2019, 3:06:55 PM8/30/19
to vim...@googlegroups.com, Tony Mechelynck
Yes, but usually it's not much slower than building, unless you sync
very often. E.g. when structs.h or vim.h gets changed then everything
needs to be compiled anyway. Only running configure is extra.

The problem with NOT running distclean, is that you do not pick up
configuration changes, which may lead to an unpredictable result.
You can leave it out, but you are taking a risk then.

> This is equivalent
> to (assuming config arguments are correctly set in the environment)
>
> cd ..
> rm -R shadow
> make shadow
> cd shadow
> make
>
> which was already possible before; but it is really overdoing it when
>
> ln ../somesource.c
> make
>
> would have been enough. My aim was to include that ln step into the
> incremental make. Only GNU make accepts wildcards in the target name,
> you say? Well, IIUC that covers most users. All Linux users AFAIK, and
> anyone else who uses gmake. I'll try.

Deleting the shadow directory also deletes any changes you made there,
to the code or to the configuration. When using git it's not too
difficult to merge your changes with a new version, and might be the
main reason to use a shadow directory. It can also be done with
branches, but these can be hard to deal with.

--
Fingers not found - Pound head on keyboard to continue.
Reply all
Reply to author
Forward
0 new messages