News for hackers. Stuff that matters.
Re:The Makefile I use with JavaScript projects by gsaga on Wednesday February 28, 2018 @11:53AM (#16484357)
Anyone here uses makefiles for anything other than compilation and build? One can use it to add some level of concurrency to shell scripts.
Re:The Makefile I use with JavaScript projects by hooya on Wednesday February 28, 2018 @12:34PM (#16484814)
I use it for almost everything. Take ETL type tasks. It's almost impossible to remember where I downloaded certain data files six months after initially creating a project. I put that into the Makefile. Everything I do on the command line, I put into a Makefile. That way, 6 months later when I need to download new data, do some transformation on that data and load it into the database, 'make' re-traces my steps from 6 months ago. Broadly, my ETL makefiles look like this:

all: data.loaded data2.loaded

data.csv: wget 'some url'

%.sql: %.csv sed/awk/custom-python-script $< > $@

%.loaded: %.sql psql < $< && touch $@

Re:The Makefile I use with JavaScript projects by scbrg on Wednesday February 28, 2018 @04:44PM (#16487325)
Anything that gets automated, and can also be shortcutted depending on how much of it has been cached already. That really is the beauty of Make to me - it's very easy to express what parts of a job need and need not be done, because the last run produced a state that was good enough to use again.

I once built a World of Warcraft addon downloader & manager (including patching) with Make. My friends thought I was insane. Personally, I wondered how else you'd do it :-)

(actually, looking back at it, I apparently built it on plan9's mk (https://9fans.github.io/plan9port/man/man1/mk.html), but it's close enough)

Re:The Makefile I use with JavaScript projects by KyleGalvin on Wednesday February 28, 2018 @12:56PM (#16485038)
At one point I had a makefile to build large latex documents. The use case was still essentially compilation, but it got me thinking outside the box with make which was neat.
Re:The Makefile I use with JavaScript projects by mturmon on Wednesday February 28, 2018 @12:23PM (#16484700)
You can look at data reduction tasks as dependency networks. Generate/retrieve data, reduce data, plot data. If the intermediate artifacts are files, you can use make to run the data pipeline.

If part of the data changes, or new data arrives, you just run make again, and the whole pipeline re-does whatever is new. Very slick.

It has free concurrency (make -j N). I've used this effectively several times for medium-scale (~GBs) science data processing.

Re:The Makefile I use with JavaScript projects by Mister_Snuggles on Wednesday February 28, 2018 @12:43PM (#16484907)
I've built a batch job scheduling system out of 'make' and a handful of supporting tools.

It works surprisingly well, but it is definitely not the right tool for the job. After a number of years of adding/removing/changing jobs, maintaining it is turning into a nightmare.

Re:The Makefile I use with JavaScript projects by Posibyte on Wednesday February 28, 2018 @11:57AM (#16484409)
I use it for programming microcontrollers, FPGAs, and doing additional signal testing on those devices. I also use it to control some processes that keep some hobby IoT devices in sync. It's just a really handy way to do parallel jobs like that.
Re:The Makefile I use with JavaScript projects by meribold on Wednesday February 28, 2018 @06:35PM (#16488298)
Re:The Makefile I use with JavaScript projects by isaachier on Wednesday February 28, 2018 @12:02PM (#16484473)
Only really makes sense when you need to generate targets from a series of inputs. The targets don't have to be files, but it helps if they are to preserve the timestamp.
Re:The Makefile I use with JavaScript projects by pjmlp on Wednesday February 28, 2018 @01:20PM (#16485271)
A few decades ago, while at the university, I used it for automating generation from LaTeX documents.