News for hackers. Stuff that matters.
Re:The Makefile I use with JavaScript projects by aidenn0 on Wednesday February 28, 2018 @12:13PM (#16484589)
This is why I like redo; it handles all of the dependency stuff for you, but your build scripts are written in pure sh
Re:The Makefile I use with JavaScript projects by theothershoe on Wednesday February 28, 2018 @01:04PM (#16485110)
I have been meaning to spend some time with redo!

https://cr.yp.to/redo.html

Re:The Makefile I use with JavaScript projects by dilap on Wednesday February 28, 2018 @12:16PM (#16484623)
always been curious about redo. which variant do you use, and what do you use it for?
Re:The Makefile I use with JavaScript projects by aidenn0 on Wednesday February 28, 2018 @01:57PM (#16485647)
I use apenwar's because I installed it a long time ago and haven't needed anything more; it does look like it may be abandoned though.

I use it for anything where I need job scheduling around creating output files; even my DVD ripping is managed with redo calling into ffmpeg.

Re:The Makefile I use with JavaScript projects by beagle3 on Wednesday February 28, 2018 @01:00PM (#16485076)
What's your solution for mutliple-output processes like yacc/bison (which creates both an .h and a .c file?)
Re:The Makefile I use with JavaScript projects by aidenn0 on Wednesday February 28, 2018 @02:07PM (#16485738)
I don't run into those too often.

When I do, there are two cases:

1) All dependencies are on only one output file (e.g. link stages that generate .map files, compile phases that generate separate .o and debug files). I just treat these as normal

2) I may need to depend on each of the files (I don't use yacc/bison, but it sounds like this would qualify). I select one file to be the main output and have the .do file for that ensure that the secondary outputs go to a mangled name; I then have the .do files for the secondary outputs rename the mangled file.

quick example for generating foo.c/foo.h

foo.c.do:

    generate-file --cout "$3" --hout "$2-mangled.h"
foo.h.do:

    redo-ifchange "$2.c"
    mv "$2-mangled.h" "$3"
Re:The Makefile I use with JavaScript projects by beagle3 on Thursday March 01, 2018 @06:48AM (#16491250)
If the h output changes but the c doesn’t, this rule will miss it.

I once solved it by making a tar file or all the outputs and extracting it to both .c and .h but that’s incredibly kludgy, still looking for a better solution

Re:The Makefile I use with JavaScript projects by aidenn0 on Thursday March 01, 2018 @01:58PM (#16494986)
As long as the timestamp changes on the C file, that's fine, right? At least with the version of redo I use timestamps are used by default, not file contents.