summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Huderle <huderlem@gmail.com>2019-08-28 16:52:33 -0500
committerhuderlem <huderlem@gmail.com>2019-08-29 16:37:42 -0500
commit1a2b43064638207b5267ed70cd3d12c385591292 (patch)
treee695e36290bc82da0c99d7419252137c15b46d37
parentb420b98d633f16b0905295345cb671b2834b956e (diff)
Update scaninc to include missing .include files in assembler files
-rw-r--r--Makefile2
-rw-r--r--tools/scaninc/scaninc.cpp19
-rw-r--r--tools/scaninc/source_file.cpp5
-rw-r--r--tools/scaninc/source_file.h1
4 files changed, 20 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index c79647fd6..6222e8787 100644
--- a/Makefile
+++ b/Makefile
@@ -225,7 +225,7 @@ endif
ifeq ($(NODEP),1)
$(C_BUILDDIR)/%.o: c_dep :=
else
-$(C_BUILDDIR)/%.o: c_dep = $(shell $(SCANINC) -I include $(C_SUBDIR)/$*.c)
+$(C_BUILDDIR)/%.o: c_dep = $(shell $(SCANINC) -I include -I tools/agbcc/include $(C_SUBDIR)/$*.c)
endif
ifeq ($(DINFO),1)
diff --git a/tools/scaninc/scaninc.cpp b/tools/scaninc/scaninc.cpp
index b95cbd033..a3e40c5d9 100644
--- a/tools/scaninc/scaninc.cpp
+++ b/tools/scaninc/scaninc.cpp
@@ -97,19 +97,26 @@ int main(int argc, char **argv)
}
for (auto include : file.GetIncludes())
{
+ bool exists = false;
+ std::string path("");
for (auto includeDir : includeDirs)
{
- std::string path(includeDir + include);
+ path = includeDir + include;
if (CanOpenFile(path))
{
- bool inserted = dependencies.insert(path).second;
- if (inserted)
- {
- filesToProcess.push(path);
- }
+ exists = true;
break;
}
}
+ if (!exists && file.FileType() == SourceFileType::Asm)
+ {
+ path = include;
+ }
+ bool inserted = dependencies.insert(path).second;
+ if (inserted && exists)
+ {
+ filesToProcess.push(path);
+ }
}
includeDirs.pop_back();
}
diff --git a/tools/scaninc/source_file.cpp b/tools/scaninc/source_file.cpp
index f23ff6db6..df31282f8 100644
--- a/tools/scaninc/source_file.cpp
+++ b/tools/scaninc/source_file.cpp
@@ -89,6 +89,11 @@ SourceFile::SourceFile(std::string path)
}
}
+SourceFileType SourceFile::FileType()
+{
+ return m_file_type;
+}
+
SourceFile::~SourceFile()
{
if (m_file_type == SourceFileType::Cpp || m_file_type == SourceFileType::Header)
diff --git a/tools/scaninc/source_file.h b/tools/scaninc/source_file.h
index f7b6412bd..854b3f116 100644
--- a/tools/scaninc/source_file.h
+++ b/tools/scaninc/source_file.h
@@ -50,6 +50,7 @@ public:
const std::set<std::string>& GetIncbins();
const std::set<std::string>& GetIncludes();
std::string& GetSrcDir();
+ SourceFileType FileType();
private:
union InnerUnion {