News for hackers. Stuff that matters.
Re:How We Use Make by seanwilson on Friday April 03, 2015 @08:09PM (#9319324)
I avoid Make at all costs now if I can.

Makefiles are far too difficult to read and write compared to alternatives in my opinion when you're automating anything beyond a few simple tasks. You'll inevitably have tasks that require several lines of code, complex logic, different settings for production, staging and development environments, common code that has to be shared between build steps etc. I find it difficult to make shell scripts robust and maintainable.

I'd much rather use JavaScript's Gulp (especially if my project was using Node like in the post) or Python's Fabric if possible.

Re:How We Use Make by noir_lord on Friday April 03, 2015 @08:40PM (#9319405)
Fabric is the tool I use since it handles all the routine stuff but if you need it you have all the power of python and its excellent pip tools.
Re:How We Use Make by davexunit on Friday April 03, 2015 @08:45PM (#9319425)
You know that you could keep the make tasks simple and have them invoke external scripts that are written in the language of your choosing, right? Building a mound of spaghetti shell code in a single file isn't the only way to construct a Makefile.
Re:How We Use Make by seanwilson on Friday April 03, 2015 @08:51PM (#9319433)
Sure, but once you want to start sharing code between your external scripts and the Makefile, it makes a lot more sense to me to write it all in a single more maintainable language.
Re:How We Use Make by leni536 on Saturday April 04, 2015 @11:36AM (#9321096)
It starts to look ugly when your script's purpose is for writing make rules. Like dependency generation with gcc.
Re:How We Use Make by empthought on Friday April 03, 2015 @10:02PM (#9319606)
> [My] Makefiles are far too difficult to read and write compared to alternatives in my opinion

Corrected for accuracy.

> when you're automating anything beyond a few simple tasks.

This is why, historically, so few projects of any scale or complexity have used Make.

Re:How We Use Make by seanwilson on Friday April 03, 2015 @10:07PM (#9319612)
Well I did say "in my opinion". I didn't find this code from the post readable for example (and this comment is directed at Make and not the script writer):

BIN := ./node_modules/.bin

UGLIFY ?= $(BIN)/uglify-js

UGLIFY_FLAGS ?= --screw-ie8

build/%.min.js: build/%.js

  @$(UGLIFY) $(UGLIFY_FLAGS) $< > $@
I find all Makefiles end up containing code like this where it makes sense when you write it but when returning to it a few weeks later you don't understand what it does anymore.
Re:How We Use Make by empthought on Friday April 03, 2015 @10:18PM (#9319642)
No code is readable if you don't bother to understand the language. That code right there is pretty bog-standard and frankly much easier to read than the Grunt equivalent.
Re:How We Use Make by golergka on Saturday April 04, 2015 @04:13AM (#9320340)
Honest question: what was hard to understand in this code?