[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Are makefiles intended to be portable across platforms?
From: |
John Graham-Cumming |
Subject: |
Re: Are makefiles intended to be portable across platforms? |
Date: |
Thu, 30 Jun 2005 17:13:14 -0400 |
On Fri, 2005-07-01 at 00:05 +0300, Angel Tsankov wrote:
> Am I taking a bad path if I try to write one makefile to manage (e.g., build
> & clean) a project on a couple of platforms?
> I'm asking this question, 'casue makefiles seem not to be very portable,
> right?
> For example, to define a clean target one might have to write:
>
> clean: ; if exist OutputFiles rmdir /S /Q OutputFiles
>
> or
>
> clean: ; if exist OutputFiles rmdir OutputFiles -R
>
> depending on the platform that make is run on.
The Make language definitely has some "Unix" roots (e.g. the use of
space as a list separator), but I've written some pretty successful
cross platform Makefiles, and so have many others.
You could read my article on Cross-Platform Builds in Dr Dobbs January
2005 (you'll find a free copy of the article here: http://www.electric-
cloud.com/resources/).
Make itself is cross-platform.
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/