Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

        $ cat Makefile
        test:
        	+env | grep MAKEFLAGS
        $ make -j4 test
        env | grep MAKEFLAGS
        MAKEFLAGS= -j --jobserver-fds=3,4
If you want to act like a sub-make, then parse MAKEFLAGS from your environment, and if you see -j and --jobserver-fds=R,W , then parse R and W as file descriptor numbers, block waiting for a byte from R before starting an additional parallel job, and write a byte to W when done with a parallel job.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: