From owner-freebsd-questions@freebsd.org Wed Mar 21 13:21:37 2018 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A65F9F67B2A for ; Wed, 21 Mar 2018 13:21:37 +0000 (UTC) (envelope-from feenberg@nber.org) Received: from mail2.nber.org (mail2.nber.org [198.71.6.79]) by mx1.freebsd.org (Postfix) with ESMTP id 1BC576F191 for ; Wed, 21 Mar 2018 13:21:36 +0000 (UTC) (envelope-from feenberg@nber.org) Received: from sas1.nber.org (sas1.nber.org [198.71.6.89]) by mail2.nber.org (8.15.2/8.15.2) with ESMTPS id w2LCsmew022435 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 21 Mar 2018 08:54:48 -0400 (EDT) (envelope-from feenberg@nber.org) Date: Wed, 21 Mar 2018 08:54:48 -0400 (EDT) From: Daniel Feenberg To: "Ronald F. Guilmette" cc: freebsd-questions@freebsd.org Subject: Re: "Portable" conditionalization of Makefiles In-Reply-To: <99925.1521593119@segfault.tristatelogic.com> Message-ID: References: <99925.1521593119@segfault.tristatelogic.com> User-Agent: Alpine 2.21 (LRH 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed X-KLMS-Rule-ID: 1 X-KLMS-Message-Action: clean X-KLMS-AntiSpam-Status: not scanned, disabled by settings X-KLMS-AntiSpam-Interceptor-Info: not scanned X-KLMS-AntiPhishing: Clean, 2018/03/20 20:22:10 X-KLMS-AntiVirus: Kaspersky Security 8.0 for Linux Mail Server, version 8.0.1.721, bases: 2018/03/21 05:20:00 #11326673 X-KLMS-AntiVirus-Status: Clean, skipped X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Mar 2018 13:21:37 -0000 On Tue, 20 Mar 2018, Ronald F. Guilmette wrote: > > > I have a pile of (mostly) C code that I wrote myself over the past > several years. I developed it on FreeBSD but have always thought > that it would be Nice if it compiled and ran also on Linux. > > I just spent about a day editing the various files to make it all > compile and link OK on Linux. So that part is all done now. But > here's the one remaining problem: > > There's a chance that I may distribute this stuff someday. When and > if I do, I'd like to be able to tell people to "just run make" in the > top-level directory, regardless of whether they are on Linux or *BSD. > (I -could- just tell people to use gmake if they are on *BSD, but I'd > rather not.) > Why not concatenate all the C code (including the library) into a single large file and let people just compile it on whatever system they have? Make is for developers, so that they can avoid compiling everything when they change a small routine. But your users are not developers, and don't recompile every day, so they don't benefit from make, it only introduces an incompatibility. daniel feenberg