Make .prj from CLI

GFA, ASM, STOS, ...

Moderators: simonsunnyboy, Mug UK, Zorro 2, Moderator Team

JeanMars
Captain Atari
Captain Atari
Posts: 178
Joined: Fri Apr 09, 2010 5:15 pm
Location: France
Contact:

Make .prj from CLI

Postby JeanMars » Sun Oct 06, 2019 9:01 am

Hi,

in order to automate some prg generation, I'd like to automate "Make all" menu entry from PureC from command line.
Is there a way to do this or this kind of "make all" can only be initiated from PureC GUI?

Thanks,
Jean

User avatar
shoggoth
Nature
Nature
Posts: 979
Joined: Tue Aug 01, 2006 9:21 am
Location: Halmstad, Sweden
Contact:

Re: Make .prj from CLI

Postby shoggoth » Sun Oct 06, 2019 9:07 am

I made a script some time ago; it uses python + make internally to build from PRJ.

It's part of CrossTOS, which is an experimental cross-compiler-compiler (it bolts a 68k emulator + binary + fake TOS into a portable binary). TC and PureC seems to work well enough to build things.

https://bitbucket.org/pep-entral/crosstos/src/master/

It's all highly experimental and once it started working enough to build things I lost interest :-P
Ain't no space like PeP-space.

ThorstenOtto
Atari Super Hero
Atari Super Hero
Posts: 827
Joined: Sun Aug 03, 2014 5:54 pm

Re: Make .prj from CLI

Postby ThorstenOtto » Sun Oct 06, 2019 9:36 am

What command line tool are you using? You could just remove the object files before doing a "Make". However, there is no tool delivered with Pure-C that can do that, either.

For that reason i wrote pcmake, which can do exactly that. It takes a project file as argument, and then builds it. The option you are looking for is "-B" which will rebuild everything, just like "Make all". It also works with recursive project files. I use that tools for example to automatically build all the applications in the magicmac repo.

You should install & run it from the same folder where pcc.ttp etc. are located.

You can also set the environment variables PCCFLAGS, PCASFLAGS and PCLDFLAGS to pass additional arguments to the compiler/assembler/linker.
You do not have the required permissions to view the files attached to this post.

JeanMars
Captain Atari
Captain Atari
Posts: 178
Joined: Fri Apr 09, 2010 5:15 pm
Location: France
Contact:

Re: Make .prj from CLI

Postby JeanMars » Sun Oct 06, 2019 9:51 am

Hi Thorsten,

looks like it's exactly what I need; just a question: how does object file folder is identified? Is it using pc.cfg or does it have to be part of prj file?

Is pcmake source code available BTW?

Thanks,
Jean

ThorstenOtto
Atari Super Hero
Atari Super Hero
Posts: 827
Joined: Sun Aug 03, 2014 5:54 pm

Re: Make .prj from CLI

Postby ThorstenOtto » Sun Oct 06, 2019 1:41 pm

The tool does not read pc.cfg (it is a binary file for which i have no documentation). Object filenames are therefore derived from source file names, unless you override it in the project file with -O (for a single file) or with -N (to specify an output directory). Pathnames (unless absolute) are interpreted relative to the directory from which the project file was loaded. The options are the same as the ones pcc.ttp accepts. Object files that are directly specified in the project file (like the startup code) are also looked up in the lib directory (thats why you should install it in the same directory as pcc.ttp, since the lib directory is derived from that path).

Source code is not (yet) available (need to write at least some basic instructions first ;)

JeanMars
Captain Atari
Captain Atari
Posts: 178
Joined: Fri Apr 09, 2010 5:15 pm
Location: France
Contact:

Re: Make .prj from CLI

Postby JeanMars » Sun Oct 06, 2019 7:57 pm

Hi Thorsten,

I think I'm not so far away from being sucessfull but wherever I start pcmake.ttp from (VISION folder or PUREC folder), it stops with error (pasm.ttp or pcc.ttp not found):
pcmake.gif


If you have some examples for PRJ and how to call pcmake.ttp, that would help me I guess.
I'm using Mint and toswin2 for shell to start pcmake.ttp

Cheers,
Jean
You do not have the required permissions to view the files attached to this post.

JeanMars
Captain Atari
Captain Atari
Posts: 178
Joined: Fri Apr 09, 2010 5:15 pm
Location: France
Contact:

Re: Make .prj from CLI

Postby JeanMars » Sun Oct 06, 2019 10:01 pm

Hi again,

I made a new test by adding temporarily my PURE_C path to PATH env variable:
In my PRJ file I have:
VISION.PRG
.C [ -L64 -P -NOUTPUT -I ../../INCLUDE ]
.S [ -2 -8 ]
.L [ -S=10240 ]

=
... list of .S / .C files

However when compiling:
pcmake: entering directory U:\h\PURE_C\PROJECTS\VISION\
pasm.ttp -2 -8 -OOUTPUT\PCSTART.o ..\..\LIB\PCSTART.S
pcc.ttp -L64 -P -2 -8 -I..\..\INCLUDE\ -I.\include -OOUTPUT\CRC.o ..\TOOLS\CRC.C
Looks like .S directive are added to pcc, which is not correct.

Any idea?
Cheers,
Jean

ThorstenOtto
Atari Super Hero
Atari Super Hero
Posts: 827
Joined: Sun Aug 03, 2014 5:54 pm

Re: Make .prj from CLI

Postby ThorstenOtto » Mon Oct 07, 2019 5:07 am

JeanMars wrote:I made a new test by adding temporarily my PURE_C path to PATH env variable:


Hm yes that seems to be neccessary, too. OTOH, if you don't do that, you have to call pcmake with an absolute path every time, so that is not really a limitation.

Looks like .S directive are added to pcc, which is not correct.


Hm, yes, that seems to be a bug. You should be able to workaround this by specifying the flags only for the specific files.

JeanMars
Captain Atari
Captain Atari
Posts: 178
Joined: Fri Apr 09, 2010 5:15 pm
Location: France
Contact:

Re: Make .prj from CLI

Postby JeanMars » Mon Oct 07, 2019 6:46 am

Hi Thorsten,

would you mind the share the current source code in its current state? I need such a tool and as I'm about to make it, it would be better to not start from scratch.

ThorstenOtto
Atari Super Hero
Atari Super Hero
Posts: 827
Joined: Sun Aug 03, 2014 5:54 pm

Re: Make .prj from CLI

Postby ThorstenOtto » Mon Oct 07, 2019 8:24 am

I would prefer to have only one version of this tool floating around, to avoid confusion.

A fixed version is attached.
You do not have the required permissions to view the files attached to this post.

JeanMars
Captain Atari
Captain Atari
Posts: 178
Joined: Fri Apr 09, 2010 5:15 pm
Location: France
Contact:

Re: Make .prj from CLI

Postby JeanMars » Mon Oct 07, 2019 7:51 pm

Works like a charm now!
Thank you very much!


Social Media

     

Return to “Coding”

Who is online

Users browsing this forum: No registered users and 7 guests