Re: questionable feature in FreeBSD pmake

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

  • Next message: M. Warner Losh: "Re: questionable feature in FreeBSD pmake"
    Date: Thu, 28 Oct 2004 05:01:31 -0700 (PDT)
    To: freebsd-hackers@freebsd.org
    
    

    On Thu, 28 Oct 2004 03:23:02 -0700, I wrote:
    >
    > I just spent a *very* frustrating hour trying to figure out why the
    > FreeBSD make program was invoking all commands to make things in a
    > subdirectory named "obj". I eventually discovered this gem in the
    > make man page:
    >
    > In addition, make sets or knows about the following internal
    > variables or environment variables:
    >
    > ...
    >
    > .OBJDIR A path to the directory where the targets are built. At
    > startup, make searches for an alternate directory to place
    > target files. It will attempt to change into this special
    > directory and will search this directory for
    > found in the current directory. The following directories
    > are tried in order:
    >
    > 1. ${MAKEOBJDIRPREFIX}/`pwd`
    > 2. ${MAKEOBJDIR}
    > 3. obj.${MACHINE}
    > 4. obj
    > 5. /usr/obj/`pwd`
    > ...
    >

    A little while later Peter Pentchev responded:
    >
    > Actually, this feature lies at the base of the FreeBSD base system build
    > infrastructure, and it is pretty much The Feature that allows us to
    > build from read-only and/or NFS-mounted sources shared among wide swarms
    > of machines :)
    >
    and
    >
    > Oh, and let's not forget cross-platform builds, too.
    >

    It is clear that a great deal of current FreeBSD OS makefile practice
    depends on the feature. The tragedy is that it was never necessary to
    make the feature unavoidable. Its invocation should have been dependent
    on using a special environment variable or make command option or makefile
    command or makefile variable. Unfortunately, it seems that its invocation
    depends only on the presence of a subdirectory named "obj" in the directory
    in which the make command is invoked and there is NO WAY to avoid it.
    There seems to be absolutely nothing that I can put in my makefile to
    turn the feature off or to undo its effect.

    It seems that I have no alternative but to rename my "obj" directory.
    Can someone suggest an alternative? Note that it is not possible for me
    to set an environment variable (i.e. MAKEOBJDIR) before running make or
    to add an option to the make command line. Any fix must be contained
    entirely within the makefile. Setting .OBJDIR or MAKEOBJDIR within the
    makefile does not work. Placing a "cd .." or "cd $(.CURDIR)" in front of
    every set of makefile shell commands is unthinkable.

    Dan Strick
    strick@covad.net

    (now *immensely* frustrated)
    _______________________________________________
    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: M. Warner Losh: "Re: questionable feature in FreeBSD pmake"

    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: 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)
    • How to get make to work under Cygwin bash shell
      ... I have an older version of Cygwin under which "make" works fine. ... "make" at the command prompt, ... I have a Makefile in the local directory and ran a ./configure script ... When I look at my environment variables, ...
      (comp.lang.c)
    • Re: A more structured approach
      ... I still find Gas fairly cryptic, but I haven't spent much time with it. ... If we started with no command line parameters, this would point at an environment variable, If we started with one or more command line parameters, this might point to one of them, or to the zero that separates command line args from environment variables. ... I suspect what you tried that *didn't* work was a memory to memory compare "cmpb, ...
      (alt.lang.asm)
    • Re: Failed running .bat file from WinXP Explorer
      ... If you use>> anything to the right will be echoed in the command prompt. ... typed in a Command or Run window. ... What does PATHEXT show? ... System environment variables are in the following Registry key: ...
      (microsoft.public.windowsxp.general)