From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: make dist target for Windows Date: Wed, 31 Mar 2010 11:30:51 +0300 Message-ID: <83eij0zydg.fsf@gnu.org> References: <4BB2BB70.3090608@gmail.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1270025189 22887 80.91.229.12 (31 Mar 2010 08:46:29 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 31 Mar 2010 08:46:29 +0000 (UTC) Cc: emacs-devel@gnu.org To: Christoph Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Mar 31 10:46:24 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1NwtZ9-0003o0-54 for ged-emacs-devel@m.gmane.org; Wed, 31 Mar 2010 10:46:23 +0200 Original-Received: from localhost ([127.0.0.1]:38725 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NwtZ8-0007Ee-J7 for ged-emacs-devel@m.gmane.org; Wed, 31 Mar 2010 04:46:22 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NwtK8-0006cc-TB for emacs-devel@gnu.org; Wed, 31 Mar 2010 04:30:52 -0400 Original-Received: from [140.186.70.92] (port=45032 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NwtK4-0006Yt-9z for emacs-devel@gnu.org; Wed, 31 Mar 2010 04:30:52 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NwtK3-0002PV-67 for emacs-devel@gnu.org; Wed, 31 Mar 2010 04:30:48 -0400 Original-Received: from mtaout20.012.net.il ([80.179.55.166]:48039) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NwtK0-0002OV-DX for emacs-devel@gnu.org; Wed, 31 Mar 2010 04:30:44 -0400 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0L0500D000V3PM00@a-mtaout20.012.net.il> for emacs-devel@gnu.org; Wed, 31 Mar 2010 11:30:42 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([77.127.176.135]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0L0500A380Z5TEC0@a-mtaout20.012.net.il>; Wed, 31 Mar 2010 11:30:42 +0300 (IDT) In-reply-to: <4BB2BB70.3090608@gmail.com> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:122957 Archived-At: > Date: Tue, 30 Mar 2010 21:03:12 -0600 > From: Christoph > > Find attached a first version of a new make target for the Windows > platform: make dist > > This provides a one-click build and packaging for Emacs Windows binary > distribution (full and bin only). Thanks. > Any feedback appreciated. Below. > +echo. --distfiles path to files to be included when running make dist, e.g. libXpm.dll Please make this text shorter, so it fits on a single 80-column line. > +set distfilename=%~nx1 This is not a good idea. configure.bat needs to be able to run on older Windows 9X systems, where %~nx1 is not supported by the stock shell. (It is OK to use such advanced constructs in zipdist.bat, because we can assume that binary distros will not be made on older systems.) I actually don't quite understand why you need to use %~nx1: it looks like distfilename is only used to check for messages to the user, so you could easily use distfilepath itself. Is it just for beauty? > .PHONY: $(ALL) > > - > addpm: stamp_BLD $(BLD)/addpm.exe Please don't make gratuitous white-space changes, at least not as part of a patch with real changes. > + - zipdist.bat $(INSTALL_DIR) $(VERSION) Why do you ignore errors in this command? It is the single most important command in the `dist' target, so perhaps it should really error out. > +set ARG_PATH="%~f1" Suggest SETLOCAL before the first command that sets environment variables. Otherwise, you are polluting the user's environment (or need to unset them all before you exit, which is tedious and error-prone). > +set ARG_PATH=%ARG_PATH:\=;% This warrants a comment, I think. > +rem Check, if 7zip is installed and available on path > +:ZIP_CHECK > +7z a zipcheck zipdist.bat > +if %ERRORLEVEL% NEQ 0 goto :ZIP_ERROR > +rm zipcheck.7z This check is not bulletproof: the command could fail for a reason that has nothing to do with 7z being available. For example, zipdcheck.7z might already exist and be unwritable by the user. I suggest instead to run 7z without arguments, which should fail only if 7z cannot be invoked by the user. As a nice side-effect, you also get rid of the need to have rm.exe on PATH. > +rem Build distributions > +:ZIP_DIST > +set CUR_DIR=%CD% > +cd ..\.. > [...] > +:EXIT > +cd %CUR_DIR% Why not use pushd/popd instead? > +rem Build & verify full distribution Beware of shell-special characters in REM comments: no one said that the shell ignores them. Older Windows shells didn't. Just use "and" here, to be safe. Finally, one more request: I think it would be nice to have a much smaller *.exe files in the binary distribution, by stripping the debug info from them. (We currently use DWARF2 debug info, which is quite voluminous.) For all the executables but emacs.exe, this is simple: just run `strip' on them. For emacs.exe, you will need to link temacs.exe with the -s switch to GCC, and then re-dump Emacs. This is due to some subtle bug, which no one succeeded to fix yet, that causes emacs.exe to become an invalid executable file when stripped.