Mercurial > hg > xemacs-beta
changeset 796:7a6013500383
[xemacs-hg @ 2002-03-29 11:12:44 by jhar]
Hopefully finally solve win32 dependency quoting fiasco
author | jhar |
---|---|
date | Fri, 29 Mar 2002 11:12:44 +0000 |
parents | 68d4a70c1558 |
children | 776fcda0ee36 |
files | nt/make-nt-depend |
diffstat | 1 files changed, 68 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nt/make-nt-depend Fri Mar 29 11:12:44 2002 +0000 @@ -0,0 +1,68 @@ +: #-*- Perl -*- + +# Generate dependency info in a form acceptable to nmake +# +# Copyright (C) 2000, 2002 Jonathan Harris. +# +# This file is part of XEmacs. +# +# XEmacs is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation; either version 2, or (at your option) any +# later version. +# +# XEmacs is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. +# +# You should have received a copy of the GNU General Public License +# along with XEmacs; see the file COPYING. If not, write to +# the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +# Boston, MA 02111-1307, USA. +# +# Author: Jonathan Harris <jonathan@xemacs.org> +# +# Synched up with: Not in FSF. + +use Getopt::Long; + +my $optsok = GetOptions ('src=s' => \$src, + 'config=s' => \$config, + 'obj=s' => \$obj); + +die "Generates nmake dependencies for the XEmacs src directory. + +Usage: $0 --src SRCDIR --config CONFIGDIR --obj OBJDIR + + SRCDIR Location of XEmacs sources + CONFIGDIR Location of config.inc + OBJDIR Location for compiler-generated object files + +Expects output from src/make-src-depend on stdin. +The dependencies are written to stdout. +" if (@ARGV || !$optsok + || !defined ($src) || !defined ($config) || !defined ($obj)); + +while (<>) + { + # rewrite references to generating script + s/make-src-depend/make-nt-depend/; + + # rewrite '#if defined(...)' into nmake syntax + s/^#if defined(.+)/!if defined$1/; + + # rewrite '#else' and '#endif' into nmake syntax + s/^#e/!e/; + + # add src path to source filenames + # allow for source filename being used in variable assignment + s/([\s=])([\w\d\.\-]+\.[ch])/$1$src\\$2/g; + + # add obj path to object filenames + # rewrite .o to .obj + # add dependency on config.inc to all objects (this might be too broad) + s/^(.+)\.o:(.+)/$obj\\$1.obj:$2 $config\\config.inc/; + + print; + }