Skip to content

Conversation

@kati-cisco
Copy link

--include-dir option is supported and a test case verifying it also is included.
As described in #157, this option can be used to specify include directory of makefiles thus allowing just to use include directive with only file names in makefile.

@kati-cisco
Copy link
Author

Any idea or suggestion on how to figure out the check failure would be appreciated.

@danw
Copy link
Collaborator

danw commented Nov 5, 2018

What is Ionut's?

Looking at how gmake handles --include-dir, it only applies to the include statement, while this implementation also applies to anything else using Glob, including $(wildcard ...). I suspect that this would work better by calling Glob multiple times in Evaluator::EvalInclude until it found a match (though gmake doesn't seem to match include a*.mk in include dirs, only exact matches).

@kati-cisco
Copy link
Author

Thank you for reviewing it and we'll take a look.
BTW, Ionut is one of developers here at Cisco who implemented it.

* Move code to the function evaluating include directive and fix test case
@rulatir
Copy link

rulatir commented Oct 8, 2020

Just when I got my hopes up that somebody might have FINALLY written a MakeThatUsesHashesInsteadOfTimestamps™, I look into issues and find years-old unmerged PR that would fix total showstoppers...

for (auto inc_path : g_flags.include_dirs) {
auto to_check = (inc_path + '/' + pat.data());
LOG("searching for %s in : %s", pat.data(), inc_path.c_str());
Glob(to_check.c_str(), &files);
Copy link
Collaborator

@Colecf Colecf Nov 23, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that in GNU make, the include directories are not searched using globs. You can test this with:

root/
   Makefile - include foo*.mk
   dir1
      fooa.mk

make -Idir1 gives "foo*.mk: No such file or directory", but if you change the include to fooa.mk explicitly, it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants