xref: /MusicPlayer2/scintilla/win32/DepGen.py (revision 8af74909132ed5e696cb05b6689ae4baf14c1c96)
1#!/usr/bin/env python3
2# DepGen.py - produce a make dependencies file for Scintilla
3# Copyright 2019 by Neil Hodgson <[email protected]>
4# The License.txt file describes the conditions under which this software may be distributed.
5# Requires Python 3.6 or later
6
7import sys
8
9sys.path.append("..")
10
11from scripts import Dependencies
12
13topComment = "# Created by DepGen.py. To recreate, run DepGen.py.\n"
14
15def Generate():
16	sources = ["../src/*.cxx", "../lexlib/*.cxx", "../lexers/*.cxx"]
17	includes = ["../include", "../src", "../lexlib"]
18
19	# Create the dependencies file for g++
20	deps = Dependencies.FindDependencies(["../win32/*.cxx"] + sources,  ["../win32"] + includes, ".o", "../win32/")
21
22	# Add ScintillaBaseL as the same as ScintillaBase
23	deps = Dependencies.InsertSynonym(deps, "ScintillaBase.o", "ScintillaBaseL.o")
24
25	# Add CatalogueL as the same as Catalogue
26	deps = Dependencies.InsertSynonym(deps, "Catalogue.o", "CatalogueL.o")
27
28	Dependencies.UpdateDependencies("../win32/deps.mak", deps, topComment)
29
30	# Create the dependencies file for MSVC
31
32	# Place the objects in $(DIR_O) and change extension from ".o" to ".obj"
33	deps = [["$(DIR_O)/"+Dependencies.PathStem(obj)+".obj", headers] for obj, headers in deps]
34
35	Dependencies.UpdateDependencies("../win32/nmdeps.mak", deps, topComment)
36
37if __name__ == "__main__":
38	Generate()