Live data from Hacker News

Time for Makefiles to Make a Comeback

medium.com

61–70 of 116 posts

Re: Time for Makefiles to Make a Comeback

#61
I wish there was something as standard, ubiquitous, fast&light, dependency-less, and adopted by the whole Unix ecosystem and beyond like make is now, yet better (= less archaic, more "write once works everywhere", uniform single way of depending on other projects, focused on the actual code/bins/libs and their dependencies instead of specific packaging for specific distros, ...).

Not some "hype of the day" build system of course as that by definition makes it a short lived maintenance burden rather than universal.

While make is universal, with makefiles now it's so bad, that even if you write pure C90 code with zero dependencies (which should work everywhere), users will still find reasons why you should add all kinds of platform dependent stuff or things for a particular distro to your makefile...

Re: Time for Makefiles to Make a Comeback

#62
I have a theory that the people who love make are the same people who love macros and the people who hate make don't love them.

I wrote a book on make and I fully recognize that there are people who look at what I've written there and think I'm completely mad: https://www.nostarch.com/gnumake

Make's greatest irony is that it's a system for building files based on dependencies but has no way of actually discovering dependencies. I wrote about this for Dr Dobbs a while back: http://www.drdobbs.com/architecture-and-design/dependency-ma...

And make has deficiencies that are a nightmare to work around and get right (e.g. spaces in filenames, recursion, ...)

If anyone else out there is a make hacker like myself they might enjoy the GNU Make Standard Library project: http://gmsl.sourceforge.net/

Re: Time for Makefiles to Make a Comeback

#63

What do people think of 'tup'?

It's my favorite build system. A big advantage is automatic dependency tracking. It picks up unspecified inputs and automatically rebuilds anything further down the dependency tree. It also knows how to clean up files that it no longer generates since it understands you removing and adding build steps.

I can do huge refactors and it cleans up files without any additional work from me. The filesystem watch automatically builds things so I never have to run it directly. I use it on my production server when deploying since it's 100% accurate at incrementally moving between different project states.

There are definitely some disadvantages, you have to work around its syntax and limitations. For complicated build functions I've written the config in Lua and it works fine.

Re: Time for Makefiles to Make a Comeback

#64
post #15
post #3

I used to be big fan of using Makefile for web development, but have since changed my mind, because make is not very good fit for watch-mode incremental building.

Interestingly enough, I tried using Makefiles for a web project yesterday, and it was a success. SOURCES = index.pug layout.pug style.styl main.coffee privacy.md OBJECTS = index.html style.css main.js privacy.html all: $(OBJECTS) watch: http-server & while true; do \ $(MAKE); \ inotifywait -qq $(SOURCES); \ done %.html: %.pug pug -P $^ %.css: %.styl stylus $^ %.js: %.coffee coffee -c $^ %.html: %.md markdown $^ > $@…

Sure, that's the traditional way of doing things, and I like its simplicity and the fact that the 40 years old core concept is still so useful.

But most of us want to require() modules also in the browser, so you'll anyway need browserify or other bundler, which already have cross-platform watch mode & plugin ecosystem, and are expected to be run continously, and suddenly the Makefile feels rather redundant, especially with npm scripting.

Re: Time for Makefiles to Make a Comeback

#66
post #3

I used to be big fan of using Makefile for web development, but have since changed my mind, because make is not very good fit for watch-mode incremental building.

The data model of makefiles is perfect for watching and rebuilding. All you need to add is something that monitors the source files for any changes and runs 'make'.

You lose incremental builds of modern bundlers/transpilers, which makes your build time too slow for bigger projects. People nowadays expect to see changes almost in realtime using hot module replacement etc.

Re: Time for Makefiles to Make a Comeback

#67
Discover make, realize what a bunch of dumb hipsters everyone is who created build systems after it, try to use it, see how deficient it is for the problems you're trying to solve, realize why those dumb hipsters made all the stuff they made, repeat. If Chesterton's Gate were a build system.

Re: Time for Makefiles to Make a Comeback

#68

I've been using make files constantly since '76 when I first started programming in (US) 5th grade. It has been one of my career amusements watching the build systems come and go. I gave up talking about Make years ago. There is a huge population of us that smile and get things done, while others screw around with new, complicated, never-learned-the-past tools. I use one of the earliest Make versions that barely does…

> I've seen this version of Make used to build a feature animated film. Witnessing the versatility of that feature film's multitude of software and renders and composites all built through Make taught me Make is the only tool needed for any building of anything.

Awesome, tell us more! Which film was this? Or if you can't say, what year was it made? I have to imagine The Makefile Architecture is still pretty popular in VFX pipelines.

I run a SaaS that's made end credits for hundreds of feature films (including "Moonlight"). Our render pipeline uses The Makefile Architecture.

Re: Time for Makefiles to Make a Comeback

#69

I've been using make files constantly since '76 when I first started programming in (US) 5th grade. It has been one of my career amusements watching the build systems come and go. I gave up talking about Make years ago. There is a huge population of us that smile and get things done, while others screw around with new, complicated, never-learned-the-past tools. I use one of the earliest Make versions that barely does…

> There is a huge population of us that smile and get things done, while others screw around with new, complicated, never-learned-the-past tools.

They get the things done they've been doing all along. But build metadata is very important and very hard to extract from Makefiles, especially as builds increase in complexity.

You need things like search paths accessible to get IDEs, static analyzers, software packaging systems, and other third party tools working with your code base.

So make works great if the only things you're interested in doing are the top-level make commands you define, but it doesn't do you any favors when it comes to other things.

Post reply on HN