From 99a038284bcbbf3a0f5ee95982f761a71a72850d Mon Sep 17 00:00:00 2001 From: mid-kid Date: Sun, 19 Dec 2021 20:05:40 +0100 Subject: Translate all .include to #include MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This decision was made to reduce the complexity of using .include whilst juggling with tools/scaninc and tools/preproc: - tools/scaninc doesn't apply the proper search rules for .include (it assumes #include behavior). In particular, it doesn't consider paths starting from $PWD, and doesn't scan the included files as a result. - .include had to be processed before #include by preproc in many cases, as code was being included that had to be preprocessed by CPP (think of #define). This contradicts standard GCC behavior. To make include paths consistent across the asm/ data/ and src/ directories, the following files were moved: - constants/ → include/asm/constants/ - asm/macros/ → include/asm/macros/ - asm/macros.inc → include/asm/macros.inc - include/macros/m4a.inc → include/asm/macros/m4a.inc As part of the necessary changes for this to work, the scaninc method in the makefile was improved to generate .d files that don't choke when files are missing. --- tools/dungeonjson/dungeonjson.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'tools/dungeonjson/dungeonjson.cpp') diff --git a/tools/dungeonjson/dungeonjson.cpp b/tools/dungeonjson/dungeonjson.cpp index 48ef147..50ef81a 100644 --- a/tools/dungeonjson/dungeonjson.cpp +++ b/tools/dungeonjson/dungeonjson.cpp @@ -387,13 +387,13 @@ string generate_species_data_text(Json data) { ostringstream text; text << "@ This is auto-generated by species_data.json.\n"; - text << ".include \"include/constants/ability.h\"\n"; - text << ".include \"include/constants/evolve_type.h\"\n"; - text << ".include \"include/constants/friend_area.h\"\n"; - text << ".include \"include/constants/item.h\"\n"; - text << ".include \"include/constants/species.h\"\n"; - text << ".include \"include/constants/type.h\"\n"; - text << ".include \"include/constants/walkable_tile.h\"\n"; + text << "#include \"constants/ability.h\"\n"; + text << "#include \"constants/evolve_type.h\"\n"; + text << "#include \"constants/friend_area.h\"\n"; + text << "#include \"constants/item.h\"\n"; + text << "#include \"constants/species.h\"\n"; + text << "#include \"constants/type.h\"\n"; + text << "#include \"constants/walkable_tile.h\"\n"; text << ".global gSpeciesData\n"; text << "gSpeciesData:"; for (Json data_entry : data.array_items()) { @@ -447,8 +447,8 @@ string generate_item_data_text(Json data) { ostringstream text; text << "@ This is auto-generated by item_data.json.\n"; - text << ".include \"include/constants/item.h\"\n"; - text << ".include \"include/constants/move_id.h\"\n"; + text << "#include \"constants/item.h\"\n"; + text << "#include \"constants/move_id.h\"\n"; text << ".global gItemData\n"; text << "gItemData:"; for (Json data_entry : data.array_items()) { @@ -476,7 +476,7 @@ string generate_move_data_text(Json data) { ostringstream text; text << "@ This is auto-generated by move_data.json.\n"; - text << ".include \"include/constants/type.h\"\n"; + text << "#include \"constants/type.h\"\n"; text << ".global gMoveData\n"; text << "gMoveData:"; for (Json data_entry : data.array_items()) { -- cgit v1.2.3