From owner-freebsd-questions@freebsd.org Wed Mar 21 18:14:23 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 D0F4DF59E1F for ; Wed, 21 Mar 2018 18:14:23 +0000 (UTC) (envelope-from rfg@tristatelogic.com) Received: from outgoing.tristatelogic.com (segfault.tristatelogic.com [69.62.255.118]) by mx1.freebsd.org (Postfix) with ESMTP id 651FD7E848 for ; Wed, 21 Mar 2018 18:14:22 +0000 (UTC) (envelope-from rfg@tristatelogic.com) Received: from segfault-nmh-helo.tristatelogic.com (localhost [127.0.0.1]) by segfault.tristatelogic.com (Postfix) with ESMTP id 061743AEF2 for ; Wed, 21 Mar 2018 11:14:22 -0700 (PDT) From: "Ronald F. Guilmette" To: freebsd-questions@freebsd.org Subject: Re: "Portable" conditionalization of Makefiles In-Reply-To: Date: Wed, 21 Mar 2018 11:14:21 -0700 Message-ID: <3610.1521656061@segfault.tristatelogic.com> 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 18:14:24 -0000 In message , Daniel Feenberg wrote: >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. Well, I guess that's one way of looking at it. I could also just distribute pre-built binaries only. But as a tinkerer myself, if I gave some of my code to other people then I would greatly prefer to do in in a way that would be supportive of their further tinkering with the code. Thus, I would only ever want to give out the C code, as it is, nicely separated out into several separate files, and all with a Makefile attached.