DEV Community

Discussion on: How To Make A Makefile

Collapse
 
arnebab profile image
Arne Babenhauserheide • Edited

Thank you for the great article!

I love seeing people rediscover tools which work really well.

If you want to step up some more, you can go to full autotools: It adds release-creation, library detectiion and clean multiplatform resource installation to Makefiles: draketo.de/light/english/free-soft...

I’m working (slowly) on building a tool to make setup of autotools as convenient as modern language environments: bitbucket.org/ArneBab/conf/

Part of that is a Makefile with nice help-output: bitbucket.org/ArneBab/conf/src/314...

Collapse
 
jmcp profile image
James McPherson

aaaargggghghhhh please Cthulhu no!

autotools' library and feature detection is definitely not clean, it's difficult to maintain and hack around the writer's assumptions, and there are much better systems around like CMake and pkg-config. [For the record, I hate CMake, but it's easier to beat a project into shape with it than autotools.]

Where does my bias come from? I've got nearly 30 years experience at this cross-platform feature detection caper if you count automake and before that xmkmf with Imakefiles. Every time I have to hack on an aclocal+friends feature check I come across comments like this: (intltool 0.50.2)

# This macro actually does too much.  Some checks are only needed if
# your package does certain things.  But this isn't really a big deal.


# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-


# If the user did not use the arguments to specify the items to instantiate,
# then the envvar interface is used.  Set only those that are not.
# We use the long form for the default assignment because of an extremely
# bizarre bug on SunOS 4.1.3.
if $ac_need_defaults; then
  test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
fi

SunOS 4.1.3 - an OS that even in 2014 (when that version of intltool was released) had been obsoleted many years prior. Nobody, however, had bothered to remove that comment or check.

To me, autotools are the promotion of bitrot - and a maintenance nightmare.

Use something better.

/me takes curmudgeon hat off for a bit.

Collapse
 
deciduously profile image
Ben Lovy

Ah, nice! Thanks for the links, Autotools is next on my list!

Collapse
 
arnebab profile image
Arne Babenhauserheide • Edited

If you want something which goes even further, here’s a setup to build a complete book from emacs org-mode via LaTeX using autotools, with references from bibtex, and with index and glossary:

You can even edit with the build environment via ./edit.sh

Get the full repository via hg clone bitbucket.org/ArneBab/1w6/