Make .prj from CLI
Moderators: simonsunnyboy, Mug UK, Zorro 2, Moderator Team
Make .prj from CLI
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
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
Re: Make .prj from CLI
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
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

Ain't no space like PeP-space.
-
- Fuji Shaped Bastard
- Posts: 2367
- Joined: Sun Aug 03, 2014 5:54 pm
Re: Make .prj from CLI
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.
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.
Re: Make .prj from CLI
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
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
-
- Fuji Shaped Bastard
- Posts: 2367
- Joined: Sun Aug 03, 2014 5:54 pm
Re: Make .prj from CLI
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
Source code is not (yet) available (need to write at least some basic instructions first

Re: Make .prj from CLI
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): 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
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): 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.
Re: Make .prj from CLI
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
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
-
- Fuji Shaped Bastard
- Posts: 2367
- Joined: Sun Aug 03, 2014 5:54 pm
Re: Make .prj from CLI
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.JeanMars wrote: I made a new test by adding temporarily my PURE_C path to PATH env variable:
Hm, yes, that seems to be a bug. You should be able to workaround this by specifying the flags only for the specific files.Looks like .S directive are added to pcc, which is not correct.
Re: Make .prj from CLI
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.
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.
-
- Fuji Shaped Bastard
- Posts: 2367
- Joined: Sun Aug 03, 2014 5:54 pm
Re: Make .prj from CLI
I would prefer to have only one version of this tool floating around, to avoid confusion.
A fixed version is attached.
A fixed version is attached.
You do not have the required permissions to view the files attached to this post.
-
- Fuji Shaped Bastard
- Posts: 2367
- Joined: Sun Aug 03, 2014 5:54 pm
Re: Make .prj from CLI
Sources for this tool ar now available at https://github.com/th-otto/pcmake Please let me know if you have any suggestions/fixes.
Re: Make .prj from CLI
Thank you Thorsten, I use this lovely tool everyday on my Foenix A2560U ! 
