"Portable" conditionalization of Makefiles

Daniel Feenberg feenberg at nber.org
Wed Mar 21 13:21:37 UTC 2018

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

More information about the freebsd-questions mailing list