On Mon, May 29, 2017 at 10:56:57PM +0200, Josuah Demangeon wrote: > I am not disappointed when I see a simple ./configure script that generate a > clean config.mk. Would something like this be acceptable to for a suckless > project ? > > case "$(uname -a)" in > *Linux* ) > XXXINC=/... > ;; > *OpenBSD* ) > XXXINC=/... > ;; > *FreeBSD* ) > XXXINC=/... > ;; > esac > > tee config.mk << EOF > XXXINC = $XXXINC > EOF > > I just read this post about portability: > http://nullprogram.com/blog/2017/03/30/ > "How to Write Portable C Without Complicating Your Build"
The GNU autotools (and its friends) showed us that factorization can lead to "over too much" and insane (once seen in the corporate world, now hurting open source hard). Sometimes the right trade off/balance, it's to go the orthonality way. _For instance_, totally assume some duplicate and redondant code that between platform specific makefiles. You could factorize at a lesser level with some common bits with the include GNU makefile extension :( In my case, I go basic shell, no dependency tracking on "work-in-progress" code or small code (namely I don't bother with makefiles). On medium sized project, I prefer "commenting out" in a brutal and idiot shell script, for the time being. -- Sylvain