Re: questionable feature in FreeBSD pmake

From: Harti Brandt (harti_at_freebsd.org)
Date: 10/29/04

  • Next message: Harti Brandt: "Re: questionable feature in FreeBSD pmake"
    Date: Fri, 29 Oct 2004 08:50:29 +0200 (CEST)
    To: Dan Strick <strick@covad.net>
    
    

    On Thu, 28 Oct 2004, Dan Strick wrote:

    DS>On Thu, 28 Oct 2004 03:23:02 -0700, I wrote:
    DS>>
    DS>> I just spent a *very* frustrating hour trying to figure out why the
    DS>> FreeBSD make program was invoking all commands to make things in a
    DS>> subdirectory named "obj". I eventually discovered this gem in the
    DS>> make man page:
    DS>>
    DS>> In addition, make sets or knows about the following internal
    DS>> variables or environment variables:
    DS>>
    DS>> ...
    DS>>
    DS>> .OBJDIR A path to the directory where the targets are built. At
    DS>> startup, make searches for an alternate directory to place
    DS>> target files. It will attempt to change into this special
    DS>> directory and will search this directory for
    DS>> found in the current directory. The following directories
    DS>> are tried in order:
    DS>>
    DS>> 1. ${MAKEOBJDIRPREFIX}/`pwd`
    DS>> 2. ${MAKEOBJDIR}
    DS>> 3. obj.${MACHINE}
    DS>> 4. obj
    DS>> 5. /usr/obj/`pwd`
    DS>> ...
    DS>>
    DS>
    DS>A little while later Peter Pentchev responded:
    DS>>
    DS>> Actually, this feature lies at the base of the FreeBSD base system build
    DS>> infrastructure, and it is pretty much The Feature that allows us to
    DS>> build from read-only and/or NFS-mounted sources shared among wide swarms
    DS>> of machines :)
    DS>>
    DS>and
    DS>>
    DS>> Oh, and let's not forget cross-platform builds, too.
    DS>>
    DS>
    DS>It is clear that a great deal of current FreeBSD OS makefile practice
    DS>depends on the feature. The tragedy is that it was never necessary to
    DS>make the feature unavoidable. Its invocation should have been dependent
    DS>on using a special environment variable or make command option or makefile
    DS>command or makefile variable. Unfortunately, it seems that its invocation
    DS>depends only on the presence of a subdirectory named "obj" in the directory
    DS>in which the make command is invoked and there is NO WAY to avoid it.
    DS>There seems to be absolutely nothing that I can put in my makefile to
    DS>turn the feature off or to undo its effect.

    I think this should be made conditional on the .POSIX target in the
    makefile. This way we don't loose this feature for system build but make
    our make more useable for outside packages. I have not yet looked into
    this.

    harti

    DS>
    DS>It seems that I have no alternative but to rename my "obj" directory.
    DS>Can someone suggest an alternative? Note that it is not possible for me
    DS>to set an environment variable (i.e. MAKEOBJDIR) before running make or
    DS>to add an option to the make command line. Any fix must be contained
    DS>entirely within the makefile. Setting .OBJDIR or MAKEOBJDIR within the
    DS>makefile does not work. Placing a "cd .." or "cd $(.CURDIR)" in front of
    DS>every set of makefile shell commands is unthinkable.
    DS>
    DS>Dan Strick
    DS>strick@covad.net
    DS>
    DS>(now *immensely* frustrated)
    DS>_______________________________________________
    DS>freebsd-hackers@freebsd.org mailing list
    DS>http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
    DS>To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"
    DS>
    DS>
    DS>
    _______________________________________________
    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: Harti Brandt: "Re: questionable feature in FreeBSD pmake"

    Relevant Pages

    • 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)
    • Re: questionable feature in FreeBSD pmake
      ... > variables or environment variables: ... this feature lies at the base of the FreeBSD base system build ... It is clear that a great deal of current FreeBSD OS makefile practice ... command or makefile variable. ...
      (freebsd-hackers)
    • 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: why these statements in a general latex makefile
      ... >>(BTW, just out of curiosity, do you even realize what the touch command ... The same way as you took it as an insult, ... > In the context of the Makefile: grep fills .btmp.new with references to ...
      (comp.text.tex)
    • Newbie needs help: Makefile Dependencies
      ... TARGET: DEPENDENCIES ... "COMMAND" for the case of the makefile for the program that I am ...
      (comp.unix.programmer)