Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Wed Oct 17, 2018 2:08 am

All times are UTC




Post new topic  Reply to topic  [ 9 posts ] 
Author Message
PostPosted: Sun May 06, 2018 1:52 pm 
Offline
Engineer
Engineer
User avatar

Joined: Sun Aug 24, 2014 12:20 pm
Posts: 79
Location: Kaon Prison, Cybertron
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?

_________________
Some links to stuff I've made:
-=RUKTS=- | -=NML Py-Patcher (a Python 3.0 pre-compiler)=- | -=Screenshots=- | -=Doom Soundtrack port to OpenTTD=-


Image


Top
   
PostPosted: Sun May 06, 2018 5:44 pm 
Offline
Transport Coordinator
Transport Coordinator
User avatar

Joined: Mon May 25, 2015 9:09 am
Posts: 321
Location: The Netherlands
https://dev.openttdcoop.org/projects/ho ... a_Makefile

That taught me how to use it.

_________________
No pics no clicks. Seriously.
ImageImageImageImageImageImage


Top
   
PostPosted: Sun May 06, 2018 10:43 pm 
Offline
Engineer
Engineer

Joined: Wed May 24, 2017 12:51 pm
Posts: 29
Location: East Texas
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.
Code:
#include "src_a.pnml"
#include "src_b.pnml"


Code:
gcc -E project.pnml > project.nml
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.

_________________
Unless otherwise stated, all my code is GPL v2.


Top
   
PostPosted: Mon May 07, 2018 4:04 pm 
Offline
Engineer
Engineer
User avatar

Joined: Sun Aug 24, 2014 12:20 pm
Posts: 79
Location: Kaon Prison, Cybertron
rowdog wrote:
Code:
gcc -E project.pnml > project.nml
will combine the files in the specified order and redirect the output into the 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.


I've tried gcc, but it always throws an error "Failed: Create process" or something.
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=-


Image


Top
   
PostPosted: Mon May 07, 2018 4:42 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Mar 31, 2007 2:23 pm
Posts: 4684
Location: Lost in Music
How about a Windows batch file? :twisted:

_________________
FIRS Industry Replacement Set (Released) | HEQS Heavy Equipment Set (trucks, industrial trams and more) (Finished)
Squid Ate FISH (ships) (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, released)


Top
   
PostPosted: Wed May 09, 2018 2:46 pm 
Offline
Engineer
Engineer
User avatar

Joined: Sun Aug 24, 2014 12:20 pm
Posts: 79
Location: Kaon Prison, Cybertron
andythenorth wrote:
How about a Windows batch file? :twisted:

Umm, I suppose. But I have no idea how to do that.
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=-


Image


Top
   
PostPosted: Wed May 09, 2018 3:44 pm 
Offline
Tycoon
Tycoon

Joined: Tue Feb 22, 2011 6:34 pm
Posts: 2652
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


Top
   
PostPosted: Wed May 09, 2018 4:31 pm 
Offline
Engineer
Engineer
User avatar

Joined: Sun Aug 24, 2014 12:20 pm
Posts: 79
Location: Kaon Prison, Cybertron
Transportman wrote:
Just curious, how did you try setting up your environment? Did you use this guide, or something else?

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 enough

_________________
Some links to stuff I've made:
-=RUKTS=- | -=NML Py-Patcher (a Python 3.0 pre-compiler)=- | -=Screenshots=- | -=Doom Soundtrack port to OpenTTD=-


Image


Top
   
PostPosted: Wed May 09, 2018 7:53 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Mar 31, 2007 2:23 pm
Posts: 4684
Location: Lost in Music
FulliAutomatix wrote:
It doesn't matter now, I've made my own python program for it

That's a good solution. I was trolling a bit with the batch file suggestion.

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)
Squid Ate FISH (ships) (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, released)


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 9 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000-2018 phpBB Limited

Copyright © Owen Rudge/The Transport Tycoon Forums 2001-2018.
Hosted by Zernebok Hosting.