Compiling using .pnml files
Moderator: Graphics Moderators
- FulliAutomatix
- Engineer
- Posts: 119
- Joined: 24 Aug 2014 12:20
- Location: Kaon Prison, Cybertron
Compiling using .pnml files
So I've got to the point where I'm using a 1500 line .nml file, and I've found no useful explanation to get gcc.exe working to compile from multiple .pnml files.
Since I've been working on RUKTS with Gwyd for the past few months, he's always had to compile, even when testing, as I have no working method for compiling with .pnml files, nor have found any.
He's tried to give gcc.exe to me but I can't get it to work at all.
Could someone please give me a run down on how to compile with .pnml files please?
Since I've been working on RUKTS with Gwyd for the past few months, he's always had to compile, even when testing, as I have no working method for compiling with .pnml files, nor have found any.
He's tried to give gcc.exe to me but I can't get it to work at all.
Could someone please give me a run down on how to compile with .pnml files please?
Some links to stuff I've made:
-=RUKTS=- | -=NML Py-Patcher (a Python 3.0 pre-compiler)=- | -=Screenshots=- | -=Doom Soundtrack port to OpenTTD=- | -=Heightmaps collection=-
-=RUKTS=- | -=NML Py-Patcher (a Python 3.0 pre-compiler)=- | -=Screenshots=- | -=Doom Soundtrack port to OpenTTD=- | -=Heightmaps collection=-
Re: Compiling using .pnml files
My primary use of the pre-processor part of gcc is to combine partial source files together into one big file that I then pass to nmlc to compile.
Suppose I have a top level project file that only exists to collect the parts together. I then "include" the other files to substitute their content.
will combine the files in the specified order and redirect the output into the project.nml
A more advanced use is to #define strings and/or macros that can be substituted throughout your sources.
It's not all that difficult to roll your own makefile and project source structures but, in the long run, you'll be better off starting with the fully developed make-nml project that Erato recommended.
Suppose I have a top level project file that only exists to collect the parts together. I then "include" the other files to substitute their content.
Code: Select all
#include "src_a.pnml"
#include "src_b.pnml"
Code: Select all
gcc -E project.pnml > project.nml
A more advanced use is to #define strings and/or macros that can be substituted throughout your sources.
It's not all that difficult to roll your own makefile and project source structures but, in the long run, you'll be better off starting with the fully developed make-nml project that Erato recommended.
- FulliAutomatix
- Engineer
- Posts: 119
- Joined: 24 Aug 2014 12:20
- Location: Kaon Prison, Cybertron
Re: Compiling using .pnml files
I've tried gcc, but it always throws an error "Failed: Create process" or something.rowdog wrote:will combine the files in the specified order and redirect the output into the project.nmlCode: Select all
gcc -E project.pnml > project.nml
It's not all that difficult to roll your own makefile and project source structures but, in the long run, you'll be better off starting with the fully developed make-nml project that Erato recommended.
And I've looked into makefile, but it's from Ubuntu and any method I've tried to get it to work on Windows 10 have failed for many reasons
Some links to stuff I've made:
-=RUKTS=- | -=NML Py-Patcher (a Python 3.0 pre-compiler)=- | -=Screenshots=- | -=Doom Soundtrack port to OpenTTD=- | -=Heightmaps collection=-
-=RUKTS=- | -=NML Py-Patcher (a Python 3.0 pre-compiler)=- | -=Screenshots=- | -=Doom Soundtrack port to OpenTTD=- | -=Heightmaps collection=-
- andythenorth
- Tycoon
- Posts: 5656
- Joined: 31 Mar 2007 14:23
- Location: Lost in Music
Re: Compiling using .pnml files
How about a Windows batch file?
FIRS Industry Replacement Set (released) | HEQS Heavy Equipment Set (trucks, industrial trams and more) (finished)
Unsinkable Sam (ships) (preview released) | CHIPS Has Improved Players' Stations (finished)
Iron Horse ((trains) (released) | Termite (tracks for Iron Horse) (released) | Busy Bee (game script) (released)
Road Hog (road vehicles and trams) (released)
Unsinkable Sam (ships) (preview released) | CHIPS Has Improved Players' Stations (finished)
Iron Horse ((trains) (released) | Termite (tracks for Iron Horse) (released) | Busy Bee (game script) (released)
Road Hog (road vehicles and trams) (released)
- FulliAutomatix
- Engineer
- Posts: 119
- Joined: 24 Aug 2014 12:20
- Location: Kaon Prison, Cybertron
Re: Compiling using .pnml files
Umm, I suppose. But I have no idea how to do that.andythenorth wrote:How about a Windows batch file?
It doesn't matter now, I've made my own python program for it
Some links to stuff I've made:
-=RUKTS=- | -=NML Py-Patcher (a Python 3.0 pre-compiler)=- | -=Screenshots=- | -=Doom Soundtrack port to OpenTTD=- | -=Heightmaps collection=-
-=RUKTS=- | -=NML Py-Patcher (a Python 3.0 pre-compiler)=- | -=Screenshots=- | -=Doom Soundtrack port to OpenTTD=- | -=Heightmaps collection=-
-
- Tycoon
- Posts: 2781
- Joined: 22 Feb 2011 18:34
Re: Compiling using .pnml files
Just curious, how did you try setting up your environment? Did you use this guide, or something else?
Coder of the Dutch Trackset | Development support for the Dutch Trainset | Coder of the 2cc TrainsInNML
- FulliAutomatix
- Engineer
- Posts: 119
- Joined: 24 Aug 2014 12:20
- Location: Kaon Prison, Cybertron
Re: Compiling using .pnml files
Something else. Thanks btw, but I think I'll stick with my simple python program. I'll be giving that to the community at some point in the future because I think I've made it robust enoughTransportman wrote:Just curious, how did you try setting up your environment? Did you use this guide, or something else?
Some links to stuff I've made:
-=RUKTS=- | -=NML Py-Patcher (a Python 3.0 pre-compiler)=- | -=Screenshots=- | -=Doom Soundtrack port to OpenTTD=- | -=Heightmaps collection=-
-=RUKTS=- | -=NML Py-Patcher (a Python 3.0 pre-compiler)=- | -=Screenshots=- | -=Doom Soundtrack port to OpenTTD=- | -=Heightmaps collection=-
- andythenorth
- Tycoon
- Posts: 5656
- Joined: 31 Mar 2007 14:23
- Location: Lost in Music
Re: Compiling using .pnml files
That's a good solution. I was trolling a bit with the batch file suggestion.FulliAutomatix wrote:It doesn't matter now, I've made my own python program for it
I'm guessing you've made something that concatenates files in python . IMHO it's a much better solution than the C Pre-Processor route.
You can also use python to template the nml viewtopic.php?f=68&t=58390
FIRS Industry Replacement Set (released) | HEQS Heavy Equipment Set (trucks, industrial trams and more) (finished)
Unsinkable Sam (ships) (preview released) | CHIPS Has Improved Players' Stations (finished)
Iron Horse ((trains) (released) | Termite (tracks for Iron Horse) (released) | Busy Bee (game script) (released)
Road Hog (road vehicles and trams) (released)
Unsinkable Sam (ships) (preview released) | CHIPS Has Improved Players' Stations (finished)
Iron Horse ((trains) (released) | Termite (tracks for Iron Horse) (released) | Busy Bee (game script) (released)
Road Hog (road vehicles and trams) (released)
Who is online
Users browsing this forum: No registered users and 7 guests