3 # This file is part of OpenTTD.
4 # OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
5 # OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
6 # See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
9 # Very basic variant function; barely any error checking.
10 # Just use the first argument as the file to start from when assembling everything
12 gsub("[^/\\\\]*$", "", path
);
16 # Recursive function for assembling by means of resolving the #includes.
17 function assemble
(filename) {
18 while ((getline < filename) > 0) {
19 if (NF ==
2 && $
1 ==
"#include" ) {
21 gsub("[\"'<>]", "", $
2);
28 if (close(filename) < 0) {
29 print "Could not open " filename > "/dev/stderr";