Alaska Software Inc. - Multiple project with the same source
Username: Password:
AuthorTopic: Multiple project with the same source
James Loughner Multiple project with the same source
on Wed, 24 Dec 2003 17:44:59 -0500
I have several jobs where I have the same source files but control the 
code generation via conditional compiler defines and program lists. THis 
is currently handled by my JimsIDE program.

ie
one.prg
two.prg
three.prg

First.exe built with ONE,TWO,THREE without any /d's

Sec.exe built with ONE,TWO and /dFLAGSEC

Third.exe built with ONE,TWO,THREE and /dFLAGTHIRD

etc.....

This allows me to create several different EXEs from the same codebase.

But since there seems to be only one .xpj file allowed (ie PROJECT.XPJ) 
per folder, how do you do this with the new VX??? My IDE builds the the 
XPJ file on the fly when a compile is requested. SO I don't have a 
naming problem.

Jim
Joe Carrick - The ManiaccRe: Multiple project with the same source
on Wed, 24 Dec 2003 13:06:38 -0800
Hi Jim,

I have no problem using several different xpj's in the same folder.  Name
them:

MyProj1.xpj
MyProj2.xpj
MyProj3.xpj

Set up each one with the desired compiler/linker settings and voila.  VX
treats each as a separate project.

-Joe

"James Loughner" <jwrl@charter.net> wrote in message
news:28yy1$myDHA.2908@S15147418...
> I have several jobs where I have the same source files but control the
> code generation via conditional compiler defines and program lists. THis
> is currently handled by my JimsIDE program.
>
> ie
> one.prg
> two.prg
> three.prg
>
> First.exe built with ONE,TWO,THREE without any /d's
>
> Sec.exe built with ONE,TWO and /dFLAGSEC
>
> Third.exe built with ONE,TWO,THREE and /dFLAGTHIRD
>
> etc.....
>
> This allows me to create several different EXEs from the same codebase.
>
> But since there seems to be only one .xpj file allowed (ie PROJECT.XPJ)
> per folder, how do you do this with the new VX??? My IDE builds the the
> XPJ file on the fly when a compile is requested. SO I don't have a
> naming problem.
>
> Jim
>
>
>
>
>
>
Andreas Herdt Re: Multiple project with the same source
on Thu, 25 Dec 2003 11:02:56 +0100
James Loughner wrote:

> I have several jobs where I have the same source files but control the
> code generation via conditional compiler defines and program lists. THis
> is currently handled by my JimsIDE program.
> 
> ie
> one.prg
> two.prg
> three.prg
> 
> First.exe built with ONE,TWO,THREE without any /d's
> 
> Sec.exe built with ONE,TWO and /dFLAGSEC
> 
> Third.exe built with ONE,TWO,THREE and /dFLAGTHIRD
> 
> etc.....
> 
> This allows me to create several different EXEs from the same codebase.
> 
> But since there seems to be only one .xpj file allowed (ie PROJECT.XPJ)
> per folder, how do you do this with the new VX??? My IDE builds the the
> XPJ file on the fly when a compile is requested. SO I don't have a
> naming problem.
> 
> Jim

Solutions:
1: Make a project file for each exe.
   You can easily change the project by (Alt+f)(Alt+p).
   (Multi Project Capabilities of VX are scheduled whith the
    Release (without pre) )

2: I can see no reason why you can not have all targts in the same
   project file. Then (Alt+F9) will rebuild all targts if required
   and (Ctrl+F9) will rebuild the active target if required.


Regards


Andreas Herdt


//////////////////////////////////////////////////////////////////
//
// Alaska Research & Development
// Homepage: www.alaska-research.com
// Newsgroup: nntp://news.alaska-Software.net
//
//////////////////////////////////////////////////////////////////
James Loughner Re: Multiple project with the same source
on Thu, 25 Dec 2003 12:35:56 -0500
> 
> Solutions:
> 1: Make a project file for each exe.
>    You can easily change the project by (Alt+f)(Alt+p).
>    (Multi Project Capabilities of VX are scheduled whith the
>     Release (without pre) )

SO I must manualy make and name the project file??? When I try from 
within VX the field for the project name is not editable!!!

> 
> 2: I can see no reason why you can not have all targts in the same
>    project file. Then (Alt+F9) will rebuild all targts if required
>    and (Ctrl+F9) will rebuild the active target if required.
> 

Then I would be building several EXEs when I make a change in one even 
if the the cahnage onle effected one because it was conditional compiled!!!

Jim


>
Andreas Gehrs-Pahl Re: Multiple project with the same source
on Thu, 25 Dec 2003 16:07:55 -0500
Jim,

>>2: I can see no reason why you can not have all targts in the same
>>   project file. Then (Alt+F9) will rebuild all targts if required
>>   and (Ctrl+F9) will rebuild the active target if required.

>Then I would be building several EXEs when I make a change in one even 
>if the the cahnage onle effected one because it was conditional compiled!!!

If you have ONE source file (SF1.prg), that is shared by three targets 
(T1.exe, T2.exe, and T3.dll), and you make a change in that source file, all 
three targets SHOULD be re-linked!

Even if the change only affects one of the targets (e.g. T2.exe), because 
you have some conditional compiling going on, all three targets have to be 
recreated regardless, simply to keep the source code, object file and 
executable in sync -- specifically if you want to use the debugger!

You could minimize the re-linking of the (other) targets, by either moving 
those non-shared code snippets into separate, target-specific, source files, 
or by either using "CTRL+F9" in VX, to only re-create (re-link) a specific 
target, or by creating one project for each target -- by simply using the 
"Save As" option for the existing project (in this case twice), and then 
changing all three (resulting) projects to only contain (one of the three) 
single targets.

Of course, each of those options will result either in inconsistencies 
between some of the targets and their source code files, or it will defeat 
(some of the) efficiencies resulting from source code-sharing.

I would rather "endure" a few seconds of re-linking for the other targets, 
though!

-- Andreas

---                                                                      ---
  Andreas Gehrs-Pahl              E-Mail: GPahl@CharterMI.net
  415 Gute Street                     or: Andreas@DDPSoftware.com
  Owosso, MI 48867-4410               or: Andreas@Aerospace-History.net
  Tel: (989) 723-9927           Web Site: http://www.Aerospace-History.net
---                                                                      ---
James Loughner Re: Multiple project with the same source
on Fri, 26 Dec 2003 12:21:35 -0500
I don't think you are understanding. The projects in question for the 
most part use all the same PRGs but most of the PRGs have code that is 
or is not compiled controled by #defines (ie #ifdef) So I don't want to 
compile/link any but the project I'm currently working on. Also there 
are about 7 veriations in the potential EXEs so I really don't want to 
re-link 7 or more EXEs every time I make a small change to code that 
only effects one!!

This could all be solved if I could name the XPJ file something other 
then "PROJECT". This I can apperently do but only outside the VX 
enviroment?????

Jim

Andreas Gehrs-Pahl wrote:

> Jim,
> 
> 
>>>2: I can see no reason why you can not have all targts in the same
>>>  project file. Then (Alt+F9) will rebuild all targts if required
>>>  and (Ctrl+F9) will rebuild the active target if required.
> 
> 
>>Then I would be building several EXEs when I make a change in one even 
>>if the the cahnage onle effected one because it was conditional compiled!!!
> 
> 
> If you have ONE source file (SF1.prg), that is shared by three targets 
> (T1.exe, T2.exe, and T3.dll), and you make a change in that source file, all 
> three targets SHOULD be re-linked!
> 
> Even if the change only affects one of the targets (e.g. T2.exe), because 
> you have some conditional compiling going on, all three targets have to be 
> recreated regardless, simply to keep the source code, object file and 
> executable in sync -- specifically if you want to use the debugger!
> 
> You could minimize the re-linking of the (other) targets, by either moving 
> those non-shared code snippets into separate, target-specific, source files, 
> or by either using "CTRL+F9" in VX, to only re-create (re-link) a specific 
> target, or by creating one project for each target -- by simply using the 
> "Save As" option for the existing project (in this case twice), and then 
> changing all three (resulting) projects to only contain (one of the three) 
> single targets.
> 
> Of course, each of those options will result either in inconsistencies 
> between some of the targets and their source code files, or it will defeat 
> (some of the) efficiencies resulting from source code-sharing.
> 
> I would rather "endure" a few seconds of re-linking for the other targets, 
> though!
> 
> -- Andreas
> 
> ---                                                                      ---
>   Andreas Gehrs-Pahl              E-Mail: GPahl@CharterMI.net
>   415 Gute Street                     or: Andreas@DDPSoftware.com
>   Owosso, MI 48867-4410               or: Andreas@Aerospace-History.net
>   Tel: (989) 723-9927           Web Site: http://www.Aerospace-History.net
> ---                                                                      ---
Andreas Herdt Re: Multiple project with the same source
on Sat, 27 Dec 2003 00:12:52 +0100
James Loughner wrote:

> This could all be solved if I could name the XPJ file something other
> then "PROJECT". This I can apperently do but only outside the VX
> enviroment?????

I understand your complains, now. If you do conditional compiling
with #ifdef precompiler statements then you control what to compile
yourself. I can not think of any automatism with which a system like
VX can be of assistance here. May be somebody can give a hint?

If a solution is to have a rename machanism for project files
here you are:

Select the project.xpj file node of the project manager (Alt+1) with
right mouse button and save the project with Save As. Then you can
load this project with (Cntrl+Shift+O) (Open dialog appears).
This is not really a reaname. Let's call it cloning a project file.
This should serve your needs. Does it?

Regards


Andreas Herdt


//////////////////////////////////////////////////////////////////
//
// Alaska Research & Development
// Homepage: www.alaska-research.com
// Newsgroup: nntp://news.alaska-Software.net
//
//////////////////////////////////////////////////////////////////
James Loughner Re: Multiple project with the same source
on Fri, 26 Dec 2003 19:46:47 -0500
I had not thought of Save As. Daaa. That should work.

In my IDE the definitions are stored in DBFs (ie EXE name, flags, 
options, program lists, etc) and the XPJ file is built at compile time. 
So its easy to set a define and have multiple build definitions for the 
same set of program files only different in the define and exe name 
(also the project name). So I was suprized that when I tried to start a 
new project there was no field where the project (PRJ) name was defined. 
Also I could not edit it in settings (ie uneditable).

I just checked and this will work, however the uneditable target name 
field is still "PROJECT" in the Settings screen.

I guess it will take some getting used to.

Andreas Herdt wrote:
> James Loughner wrote:
> 
> 
>>This could all be solved if I could name the XPJ file something other
>>then "PROJECT". This I can apperently do but only outside the VX
>>enviroment?????
> 
> 
> I understand your complains, now. If you do conditional compiling
> with #ifdef precompiler statements then you control what to compile
> yourself. I can not think of any automatism with which a system like
> VX can be of assistance here. May be somebody can give a hint?
> 
> If a solution is to have a rename machanism for project files
> here you are:
> 
> Select the project.xpj file node of the project manager (Alt+1) with
> right mouse button and save the project with Save As. Then you can
> load this project with (Cntrl+Shift+O) (Open dialog appears).
> This is not really a reaname. Let's call it cloning a project file.
> This should serve your needs. Does it?
>
Andreas Gehrs-Pahl Re: Multiple project with the same source
on Fri, 26 Dec 2003 19:10:23 -0500
Jim,

>I don't think you are understanding. The projects in question for the 
>most part use all the same PRGs but most of the PRGs have code that is 
>or is not compiled controled by #defines (ie #ifdef) So I don't want to 
>compile/link any but the project I'm currently working on. Also there 
>are about 7 veriations in the potential EXEs so I really don't want to 
>re-link 7 or more EXEs every time I make a small change to code that 
>only effects one!!

I understand just fine, but as I mentioned, compiling/linking only one 
target will result in the other targets being out-of-synch with their souce 
code, which is something that I don't like to do.

And you can simply recompile/link one target at a time with VX, so I don't 
quite see your immediate concern.

>This could all be solved if I could name the XPJ file something other 
>then "PROJECT". This I can apperently do but only outside the VX 
>enviroment?????

You can do that quite easily (as mentioned a couple times before), by:

>>simply using the "Save As" option

Open your project, named "Project.xpj", use the "Save As" option and save it 
as "MyNewProject1.xpj". Then use the "Save As" option again and again, to 
save your original project as "MyNewProject2.xpj", "MyNewProject3.xpj", etc.

Then you can open those projects, change them to only cover one Target each, 
and then you could even delete the original file "Project.xpj".

An even easier way would be to simply copy or rename the file from outside 
of VX -- not sure why this would be a problem. But, how would a different 
name for the *.XPJ file (by itself) make any difference in the forst place?

So, I guess you are kinda right -- I don't understand why this is a problem 
for you in the first place.

-- Andreas

---                                                                      ---
  Andreas Gehrs-Pahl              E-Mail: GPahl@CharterMI.net
  415 Gute Street                     or: Andreas@DDPSoftware.com
  Owosso, MI 48867-4410               or: Andreas@Aerospace-History.net
  Tel: (989) 723-9927           Web Site: http://www.Aerospace-History.net
---                                                                      ---