Date: May 23rd, 2006
Cate: Geekism
Tags:

When is a comment not a comment?

A brief exercise using GNU Make:


Makefile subMake.sh Submakefile
submake :
  ./subMake.sh
#!/bin/sh
make -f Submakefile
STUFF = a b c d e

all : $(STUFF)

$(STUFF) :
  @echo making $@
  @sleep 1

Run ‘make’. You’ll see a, b, c, d, and e get made serially, one per second. Want to parallelize? You’d think ‘make -j5′ would do it, right? You’d be wrong. The Submakefile complains that there is no jobserver available, and still makes them serially. The reason is that the toplevel Makefile doesn’t “think” that subMake.sh is a sub-make, and doesn’t pass along the necessary magic environment variables and file descriptors for the jobserver stuff to work. But, by merely adding a COMMENT:


Makefile
submake :
  ./subMake.sh # $(MAKE)

IT WORKS!

8 Comments

  1. October 12th, 2008
    REPLY))

  2. hel;o! I’m sorry, but I can’t find some information about computers. What can you advise to me? I realy need it, help me please!
    vpxl generic price Thank you!

    1F

  3. October 15th, 2008
    REPLY))

  4. Hello! Can me tell someone I trying to find an information about domastic animales. what advise can you give me? if you have some information about this, I will be glad to read it :)
    ciallis order generic Hope you will help me

    2F

  5. October 29th, 2008
    REPLY))

  6. Is that a new way? Nuzzle my somber tiger Fresh joke! When do you need to oil a mouse? When it squeaks.

    3F

  7. November 27th, 2008
    REPLY))

  8. I’ve just been sitting around waiting for something to happen.,

    4F

  9. November 27th, 2008
    REPLY))

  10. At you the excellent site, a lot of useful info and good design, thank.,

    5F

  11. July 28th, 2009
    REPLY))

  12. Давно не видели однокласниц и одноклассников?
    А вот в таком ракурсе?

    6F

  13. October 22nd, 2009
    REPLY))

  14. How long will the meeting take? ,

    7F

  15. October 23rd, 2009
    REPLY))

  16. Morgan Freeman, to do the wrong thing. ,

    8F

Leave a Reply

 Name

 Mail

 Home

[Name and Mail is required. Mail won't be published.]


п»ї