Code Monkey home page Code Monkey logo

Comments (5)

chrisdonlan avatar chrisdonlan commented on August 10, 2024

@madscientist is it ok if I look into this, or is it intended behavior?

from make.

madscientist avatar madscientist commented on August 10, 2024

This is how it's supposed to work, and has always worked since the dawn of time. When considering stuff like this it's always best to check the docs first; they are not always accurate but usually they are: https://www.gnu.org/software/make/manual/html_node/Options_002fRecursion.html

from make.

madscientist avatar madscientist commented on August 10, 2024

Just to be clear, it's wrong to include $(MAKEFLAGS) explicitly in any invocation of a sub-make. That's not how MAKEFLAGS is supposed to be used. From the POSIX standard for make we see:

Before the makefile(s) are read, all of the make utility command line options (except -f and -p) and make utility command line macro definitions (except any for the MAKEFLAGS macro), not already included in the MAKEFLAGS macro, shall be added to the MAKEFLAGS macro, quoted in an implementation-defined manner such that when MAKEFLAGS is read by another instance of the make command, the original macro's value is recovered. Other implementation-defined options and macros may also be added to the MAKEFLAGS macro. If this modifies the value of the MAKEFLAGS macro, or, if the MAKEFLAGS macro is modified at any subsequent time, the MAKEFLAGS environment variable shall be modified to match the new value of the MAKEFLAGS macro. The result of setting MAKEFLAGS in the Makefile is unspecified.

In short, when used to pass values to a recursive invocation of make the value of MAKEFLAGS is set by make itself to some format that is implementation-defined (not standardized) and passed through the environment to the sub-make. It's not intended to be used or interpreted by makefiles themselves. GNU make does specifically define some values which makes it possible for makefiles to query the contents of MAKEFLAGS reliably but that variable is still not intended to be used on the command line when invoking a sub-make. The value will be passed through the environment to the sub-make so this is not needed.

from make.

chrisdonlan avatar chrisdonlan commented on August 10, 2024

@madscientist then this might be an XY problem. posted a stack question here: relay make to remote box

from make.

chrisdonlan avatar chrisdonlan commented on August 10, 2024

@madscientist and thanks for the advice. Learning is a pell mell experience these days, has been a long time since I've looked at docs patiently, but make has earned that πŸ‘

from make.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.