make-w32
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Converting Unix Make to Windows


From: John Graham-Cumming
Subject: Re: Converting Unix Make to Windows
Date: Thu, 09 Jun 2005 13:29:46 -0400

On Tue, 2005-06-07 at 11:34 -0400, Miller, Jack - Avionics wrote:
> I'd appreciate any info on converting make files running in a Sun-Unix
> environment to Windows (command window or gui).

Is the current system using GNU Make or Sun's make?

If you are simply converting from a Unix environment with GNU Make to
Windows with GNU Make then you'll probably want to get CYGWIN which
includes GNU Make and makes things easy.

My company builds on Linux/Windows/Solaris with the same Makefiles using
GNU Make natively on Linux and Solaris and CYGWIN on Windows.  I wrote
up something like our configuration for Dr Dobbs in January (an article
called Cross Platform Builds that you can read here:
http://www.electric-cloud.com/resources).

If the system is using Sun's make and your plan is to go to Windows and
use GNU Make then you may be able to get away with changing nothing
because GNU Make does a good job of emulating many Sun/SysV make
features. (There is a nice description of the differences in the GNU
Make manual here:
http://www.gnu.org/software/make/manual/html_chapter/make_13.html#SEC125)

Two big differences could bite you if you are going from Sun make to GNU
Make: "target groups" and "keep state":

1. Sun make supports rules in the form:

        a + b: c
                command

which means that _both_ a and b are built by command with prereq c.
There is no equivalent in GNU Make (the only multiple target rules
available in GNU Make are for pattern rules, e.g. %.a %.b: %.c).

2. If .KEEP_STATE: is specified in a Sun make Makefile then Sun make
tracks the commands that are used to build a target and will rebuild a
target if the commands change.  This is used often for different
compilation options.  GNU Make does not support this at all.

If should be fairly easy to grep your Makefiles for either of those
constructs.

John.
-- 
John Graham-Cumming

Home: http://www.jgc.org/
Work: http://www.electric-cloud.com/
POPFile: http://getpopfile.org/
GNU Make Standard Library: http://gmsl.sf.net/






reply via email to

[Prev in Thread] Current Thread [Next in Thread]