From owner-freebsd-questions@FreeBSD.ORG Sun Oct 31 12:19:35 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AA2491065670 for ; Sun, 31 Oct 2010 12:19:35 +0000 (UTC) (envelope-from cbergstrom@pathscale.com) Received: from mail-gx0-f182.google.com (mail-gx0-f182.google.com [209.85.161.182]) by mx1.freebsd.org (Postfix) with ESMTP id 6DEDA8FC12 for ; Sun, 31 Oct 2010 12:19:35 +0000 (UTC) Received: by gxk9 with SMTP id 9so2919411gxk.13 for ; Sun, 31 Oct 2010 05:19:34 -0700 (PDT) Received: by 10.150.177.19 with SMTP id z19mr4199704ybe.275.1288525784419; Sun, 31 Oct 2010 04:49:44 -0700 (PDT) Received: from [10.0.1.16] (59-124-0-127.HINET-IP.hinet.net [59.124.0.127]) by mx.google.com with ESMTPS id 50sm3948882yhl.41.2010.10.31.04.49.41 (version=SSLv3 cipher=RC4-MD5); Sun, 31 Oct 2010 04:49:43 -0700 (PDT) Message-ID: <4CCD5880.3000102@pathscale.com> Date: Sun, 31 Oct 2010 18:52:32 +0700 From: =?UTF-8?B?IkMuIEJlcmdzdHLDtm0i?= User-Agent: Thunderbird 2.0.0.22 (X11/20090909) MIME-Version: 1.0 To: David DEMELIER References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org Subject: Re: Portable Makefile(s) X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Oct 2010 12:19:35 -0000 David DEMELIER wrote: > Hello, > > I'm working on many projects, and writing makefile is really painful. > I love the BSD Makefile syntax obviously, but I also love that people > using Linux could run make to build my projects too. And using BSD > makefile syntax disallow this. > > Reducing the makefile to the minimal makes them portable, but then you > canno't use loops, conditionnals, and this is getting my nerves. > > What could I do to write Makefile compatible on every operating > systems ? I'm thinking about Cmake but I hate the syntax, also for > dmake... > We had this same choice at our company and ended up going wiht cmake for everything. In the end you'll save time and get portability across all platforms and build environments. Don't really think of cmake as a makefile replacement, but a replacement for auto* tools and makefiles together. (cmake generates platform native makefiles) If you do go with cmake don't try to support older versions though. Anything 2.8.1+ is really quite solid from my experience.. /* no I don't work for kitware */ good luck ./C