Coffeehouse Thread

22 posts

OK I must be stoopid - How to search for this...?

Back to Forum: Coffeehouse
  • User profile image
    BitFlipper

    Really, sometimes both Google and Bing ticks me off since they refuse to search for the term I enter, even when it is inside quotes. Bing states: " "" [quotes] Finds the exact words in a phrase". No, not really. Maybe someone can help me out with some Search Engine 101 advice...

    I'm in the process of making a parser that can parse through a MAKE build log (using MAKE's dry-run option). Some output from MAKE looks like this:

    # ? := C:/some_path/somefile.cpp ... //and a whole lot of seemingly somefile.cpp dependencies...

    OK, I'm trying to find out what the significance of "# ? :=" is. So I enter:

    "# ? :=" make build

    Both Bing and Google refuse to return anything useful. Bing states it found 119,000,000 results. As far as I can tell (looking at the most "relevant" results), not a single one has the term I put into quotes, so that should be zero results.

    This is not the only search term I've had problems with. I've had much simpler search terms where the search engines refuse to search for the quoted term.

    Any ideas?

  • User profile image
    ScanIAm

    Write a better search parser/engine and do to google what google did to alta-vista.

  • User profile image
    BitFlipper

    , ScanIAm wrote

    Write a better search parser/engine and do to google what google did to alta-vista.

    That is an excellent idea!! I'll get to it tonight or tomorrow and let you know how it goes...

  • User profile image
    magicalclick

    I think the term it self is horrible. Make build itself it terrible. If it is unique like MakeBuild, it is would be a lot easier.

    Leaving WM on 5/2018 if no apps, no dedicated billboards where I drive, no Store name.
    Last modified
  • User profile image
    kettch

    @magicalclick: The problem isn't with "make build". Just putting those two words into Bing results in GNU Make and the Wikipedia entry for the same.

    The problem is trying to search for specific combinations of special characters. I've run into that before. Whenever I want to look up something about language operators, I always have to manually browse to what I want.

    @BitFlipper: Something like this?

    var results = from site in Internet.WebSites
                       where site.Content.Contains("search term")
                       select site;

    Seriously, what's so hard about this search thing anyway? Tongue Out

  • User profile image
    BitFlipper

    , magicalclick wrote

    I think the term it self is horrible. Make build itself it terrible. If it is unique like MakeBuild, it is would be a lot easier.

    Well that is the problem with anything you want to search for having a generic name. Adding "make" and "build" was a quick attempt at filtering out most results not having anything to do with actually using make. But that is really besides the point. The fact that I entered a combination of characters within quotes should *only* have returned results that actually contain that sequence of characters. Returning 119,000,000 results with none of them matching is obviously incorrect behavior.

  • User profile image
    Bass

    What make are you using? (eg: make --version)

  • User profile image
    Bass

    Btw. At least in GNU make (and many many other Unix-y things), a line starting with # is typically a comment. ":=" is a type of variable assignment, "?" is a special variable whos contents are controlled by make, I feel it would be unusual (although not technically illegal) to assign things to it.

  • User profile image
    DCMonkey

    Google (and presumably Bing) ignore punctuation except in certain circumstances. 

    As for your example, it appears to be a commented out, simply expanded variable assignment to the automatic variable $?

  • User profile image
    BitFlipper

    @Bass: For Windows it is make 3.79.1 and for Linux it is make 3.81. I need to do this for both Windows and Linux.

    I don't think in this case it is a comment. It seems to be an auto-generated list of all files that are involved in building a particular source file, and some of these are longer that 350,000 characters.

    I basically need to know if this is truly a list of all dependencies that were detected for a particular source file, and therefore can I parse them for what I need to do.

  • User profile image
    Bass

    Is it GNU make or some other make (eg: Microsoft has their own implementation). They are not really compatible.

    I'm pretty sure any line that starts with a pound is a comment and thus ignored but I need far more context on what is going on (it's not uncommon for a Makefile itself to be a build artifact - eg. via GNU Autotools).

  • User profile image
    evildictait​or

    It was only recently (i.e. a couple of years back) that Google noticed that search terms for "C#" probably aren't the same as "C" or "C++", even if those terms all look the same when you ignore the punctuation.

  • User profile image
    BitFlipper

    , Bass wrote

    Is it GNU make or some other make (eg: Microsoft has their own implementation). They are not really compatible.

    I'm pretty sure any line that starts with a pound is a comment and thus ignored but I need far more context on what is going on (it's not uncommon for a Makefile itself to be a build artifact - eg. via GNU Autotools).

    Full output from make -version:
    Windows: GNU Make version 3.79.1, by Richard Stallman and Roland McGrath.
    Linux: GNU Make 3.81

    These are unmodified make versions. The sequence of "# ? :=" characters in this case is coming from the Windows make. Their origin might very well be buried somewhere in another script, I don't know. Our build system is extremely involved so I'll probably never be able to locate it.

  • User profile image
    cbae

    http://www.gnu.org/software/make/manual/make.html

    3.1 What Makefiles Contain

    ...

    '#' in a line of a makefile starts a comment.  It and the rest of the line are ignored, except that a trailing backslash not escaped by another backslash will continue the comment across multiple lines.  A line containing just a comment (with perhaps spaces before it) is effectively blank, and is ignored.  If you want a literal #, escape it with a backslash (e.g., \#).  Comments may appear on any line in the makefile, although they are treated specially in certain situations.     

    You cannot use comments within variable references or function calls: any instance of # will be treated literally (rather than as the start of a comment) inside a variable reference or function call.

     

  • User profile image
    BitFlipper

    I think you are not understanding. This is the output from a make build, not the contents of a make file. I am well aware of comments in a make file.

  • User profile image
    DCMonkey

    , BitFlipper wrote

    I think you are not understanding. This is the output from a make build, not the contents of a make file. I am well aware of comments in a make file.

    Is it possible that it shows certain internal operations like setting automatic variables as comments in the output log? I don't have a make environment handy to see what the output looks like on a suitably complex build.

    The automatic variable ? is "The names of all the prerequisites that are newer than the target, with spaces between them." You would normally reference this in a Makefile as $?, but presumably make sets the value somewhere internally hence my theory.

  • User profile image
    BitFlipper

    , DCMonkey wrote

    *snip*

    Is it possible that it shows certain internal operations like setting automatic variables as comments in the output log? I don't have a make environment handy to see what the output looks like on a suitably complex build.

    The automatic variable ? is "The names of all the prerequisites that are newer than the target, with spaces between them." You would normally reference this in a Makefile as $?, but presumably make sets the value somewhere internally hence my theory.

    Yes you might be right, although the output log should not really need comments - it is already just informational.

    Note that in this case the build is already up to date, but I am now passing in...

    make --dry-run -k -i -w -p ...

    ...because I want to see which files (out of 100's of thousands) are actually part of the particular build (we have many sub-projects with dependencies all over the place). So I'm thinking in this case it would list all relevant files, not just those that are newer since it is a dry run. I'm guessing that is why in some cases those lines are ~350,000 characters long.

    But it would have been good to know exactly what that output line represents (hence the original search-engine rant).

  • User profile image
    Ion Todirel

    @BitFlipper: read the manual?

Comments closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums, or Contact Us and let us know.