Live data from Hacker News

Time for Makefiles to Make a Comeback

medium.com

71–80 of 116 posts

Re: Time for Makefiles to Make a Comeback

#71

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 s…

Search paths accessible to other tools would have been just as well served standardizing search paths. Or, sadly, following standardized search paths.

Instead, the new tools came and each one would buck any preceding trend and introduce a new way of doing things. Often poorly. All the while introducing yet another new way of executing the actual build.

Let me preempt with saying that Make is not perfect. I genuinely feel that many things could have been improved on. However, I also question how many lessons learned in Make were carried forward, versus how many mistakes were just reintroduced and hit again and again.

Re: Time for Makefiles to Make a Comeback

#72

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 de…

(disclaimer: I like make but not macros)

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

Yes! we seem to be stuck in a local maximum with make. I wrote my own make replacement, as have many before me, and learned the folly of my own ways.

Nowadays I use (and love) make despite its terrible handicaps, but I really wish there were something fundamentally similar but a) less C-focused and b) containing many fewer footguns.

Re: Time for Makefiles to Make a Comeback

#73
post #34

If you compare Makefiles to the JavaScript ecosystem it will do so favorably, but many things will. Make is a good build system but it is a shitty deployment system. Yes, you can do everything you want if you put enough effort in it as it is a complete scripting system, something many alternatives are not. It does not mean that it is a good idea to do so. Recently a client made me begrudgingly try Maven. 'Yet another…

Eh, different strokes. Every time I have to use Makefiles I yearn for the comparative flexibility and simplicity of the JS ecosystem.

Make files just seem good to users of the due to experience. They work, but let’s not pretend they’re easy to work with.

Re: Time for Makefiles to Make a Comeback

#74

Having put together a build system together for building a modular os using make: no, it's really not time to make a comeback. Make is simultaneously powerful enough to seem pretty good for use, but not powerful enough to do anything outside its very narrow problem domain without really ugly hacks.

Agree. God forbid you have to maintain cross-platform compatible makefiles either.

Re: Time for Makefiles to Make a Comeback

#75
post #65

TIL Make is not used widely anymore. I may live in a bubble, but my last use of it was… maybe 2 hours ago (to build someone else's project) and yesterday (to build one of my own projects).

It’s used for basically most C/C++ projects and somewhat outside of that.

It’s not been adopted (with good reason) in many newer language communities, so depending on your tooling and platform you may see it less.

Re: Time for Makefiles to Make a Comeback

#76
post #70

If you would see our Makefile which can do literally_everything_ with the project, you would not write this article. :) Makefiles don't scale, hard to learn because of awkward syntax.

That's the think. The concept of Makefiles are great. The syntax is pretty terrible.

GNUstep's Makefiles are actually really nice.

Re: Time for Makefiles to Make a Comeback

#77
post #38
post #34

If you compare Makefiles to the JavaScript ecosystem it will do so favorably, but many things will. Make is a good build system but it is a shitty deployment system. Yes, you can do everything you want if you put enough effort in it as it is a complete scripting system, something many alternatives are not. It does not mean that it is a good idea to do so. Recently a client made me begrudgingly try Maven. 'Yet another…

That last bit is really key. Nearly every modern build system is also a dependency management system, something that really isn't possible using Make. There have been tools introduced to address that particular need for C/C++, but they integrate poorly if at all with the build system, so it turns all your builds into (at least initially) three step processes of run dependency installer, run config tool to figure out…

> Nearly every modern build system is also a dependency management system, something that really isn't possible using Make

The BSD Ports tree provides exactly this functionality. All package dependencies provided via standard make variables and rules, enabling recursive resolution of all package dependencies.

Re: Time for Makefiles to Make a Comeback

#78

What do people think of 'tup'?

I tried out Tup, and thought it was really impressive and probably great for people who need to write C, but not suited for what I was trying to do.

The project I tried to use it on was a before/after comparison of the results of some development work to an energy model. So, a couple of my make targets cloned old and new versions of the repo.

Tup doesn't like you to create directories, and wants to track every file that comes into existence and check that it is either a) a declared output or b) deleted by the end of the job. It really didn't enjoy trying to process a whole Git clone operation.

Re: Time for Makefiles to Make a Comeback

#79
Recent experience of working with various task runners such as Phing and Robo (plus others), eventually my previous employer returned back to simple Makefiles and I in turn have done the same. For my needs of generating small website builds, Make is perfect.

Re: Time for Makefiles to Make a Comeback

#80
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 $^ > $@…

I'd recommend adding:

.PHONY: watch .PHONY: clean

In the appropriate places.

Post reply on HN