4 ms·
Anyone here uses makefiles for anything other than compilation and build? One can use it to add some level of concurrency to shell scripts.
by gsaga 9y ago
Anyone here uses makefiles for anything other than compilation and build? One can use it to add some level of concurrency to shell scripts.
- Posibyte 9y agoI 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.
- isaachier 9y agoOnly 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.
- mturmon 9y agoYou 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.
- hooya 9y agoI 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 $@
- pjmlp 9y agoA few decades ago, while at the university, I used it for automating generation from LaTeX documents.
- Mister_Snuggles 9y agoI'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.
- KyleGalvin 9y agoAt 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.
- scbrg 9y agoAnything 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 https://9fans.github.io/plan9port/man/man1/mk.html), but it's close enough)
- meribold 9y agoI use it to install my dotfiles (https://github.com/meribold/dotfiles/blob/master/makefile https://github.com/meribold/dotfiles/blob/master/makefile).