2021-02-21 04:53:09 +00:00
|
|
|
#!/usr/bin/env python3
|
2019-07-21 13:26:02 +00:00
|
|
|
# DepGen.py - produce a make dependencies file for Scintilla
|
|
|
|
# Copyright 2019 by Neil Hodgson <neilh@scintilla.org>
|
|
|
|
# The License.txt file describes the conditions under which this software may be distributed.
|
2021-02-21 04:53:09 +00:00
|
|
|
# Requires Python 3.6 or later
|
2019-07-21 13:26:02 +00:00
|
|
|
|
|
|
|
import sys
|
|
|
|
|
|
|
|
sys.path.append("..")
|
|
|
|
|
|
|
|
from scripts import Dependencies
|
|
|
|
|
2021-02-21 04:53:09 +00:00
|
|
|
topComment = "# Created by DepGen.py. To recreate, run DepGen.py.\n"
|
2019-07-21 13:26:02 +00:00
|
|
|
|
|
|
|
def Generate():
|
2022-01-04 23:07:50 +00:00
|
|
|
sources = ["../src/*.cxx"]
|
|
|
|
includes = ["../include", "../src"]
|
2019-07-21 13:26:02 +00:00
|
|
|
|
|
|
|
# Create the dependencies file for g++
|
|
|
|
deps = Dependencies.FindDependencies(["../win32/*.cxx"] + sources, ["../win32"] + includes, ".o", "../win32/")
|
|
|
|
|
2022-01-04 23:07:50 +00:00
|
|
|
# Place the objects in $(DIR_O)
|
|
|
|
deps = [["$(DIR_O)/"+obj, headers] for obj, headers in deps]
|
2019-07-21 13:26:02 +00:00
|
|
|
|
|
|
|
Dependencies.UpdateDependencies("../win32/deps.mak", deps, topComment)
|
|
|
|
|
|
|
|
# Create the dependencies file for MSVC
|
|
|
|
|
|
|
|
# Place the objects in $(DIR_O) and change extension from ".o" to ".obj"
|
|
|
|
deps = [["$(DIR_O)/"+Dependencies.PathStem(obj)+".obj", headers] for obj, headers in deps]
|
|
|
|
|
|
|
|
Dependencies.UpdateDependencies("../win32/nmdeps.mak", deps, topComment)
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
Generate()
|