Re: questionable feature in FreeBSD pmake

From: Dan Strick (strick_at_covad.net)
Date: 10/30/04

  • Next message: Patrick Dung: "Feature request (pam/nss ldap, nsswitch ldap integration)"
    Date: Fri, 29 Oct 2004 18:39:13 -0700 (PDT)
    To: freebsd-hackers@freebsd.org
    
    

    >
    > Why are you unable to do anything with the command-line? Any of these
    > will solve your problem.
    > Bourne:
    > MAKEOBJDIR=/no_obj_here make
    >
    > Bourne or CSH:
    > env MAKEOBJDIR=/no_obj_here make
    >
    > Here is a Makefile that does not use obj/. The special targets can be
    > placed into a file to be included into all your Makefiles. It only
    > suffers from a failed build where it will not rename obj to tmpobj.
    >
    > -----------------------
    > .BEGIN:
    > mv tmpobj obj || mkdir obj
    >
    > .INTERRUPT:
    > mv obj tmpobj
    >

    My goal was to write a generic makefile that would work on almost
    any mostly POSIX compliant OS. I wanted something I could just walk
    up to and say "make" without having to remember that the makefile
    is special and has to be invoked in a special way. If I could just
    add some trivial magic to the makefile that suppresses the special
    "obj" feature on systems that have it but has no effect on other
    systems, I would do that. It seems that there is no such magic.

    Thank you all for your suggestions. I wish to give a special award
    for extra creativity to Sean Farley for his makefile enhancements
    that work around the problem by temporarily renaming the "obj"
    subdirectory while the makefile is not active (i.e. when you would
    most care what the subdirectory was called).

    I think I will work around the problem by calling the directory "objs"
    instead of "obj".

    This does not mean that I forgive whoever it was that invented the
    feature I don't like. He should have checked with an adult first.
    (Ooh, it feels good to say that! :-)

    I repeat the observation that this feature could have been implemented
    in a way that would have made it unlikely to be invoked accidentally.
    It seems that the feature is now so widely spread throughout the BSD
    community that is way too late to get the blemish fixed now.
    I will have to settle for finding some comfort in the realization
    that I have far bigger problems than the inability to use the
    directory name "obj" in some circumstances.

    Dan Strick
    strick@covad.net
    _______________________________________________
    freebsd-hackers@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
    To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"


  • Next message: Patrick Dung: "Feature request (pam/nss ldap, nsswitch ldap integration)"

    Relevant Pages

    • Re: questionable feature in FreeBSD pmake
      ... DS>> variables or environment variables: ... this feature lies at the base of the FreeBSD base system build ... DS>on using a special environment variable or make command option or makefile ... DS>in which the make command is invoked and there is NO WAY to avoid it. ...
      (freebsd-hackers)
    • Re: Why is make building all targets
      ... object files placed in a directory called "obj" to be linked into the ... here's an example of my Makefile (this is ... .PHONY: all ... But if you 'make llfd' it won't be used; ...
      (comp.unix.programmer)
    • Re: Cant generate dependencies in VS 2005?
      ... that feature creates dependency files ... figure out all the dependencies and write it out as a makefile fragment. ... command line just as you would nmake. ...
      (microsoft.public.dotnet.languages.vc)
    • include file problem
      ... As it is I get this compile error: ... the directoy in the code by way of the makefile. ... OBJ = $/charyr.o\ ... rm myProgram obj/*.o ...
      (comp.lang.fortran)
    • Why is make building all targets
      ... object files placed in a directory called "obj" to be linked into the ... here's an example of my Makefile (this is ... llfd: $ ... So what about this makefile setup is it that makes it so that make ...
      (comp.unix.programmer)