comp.lang.ada
 help / color / mirror / Atom feed
* How to best organize and build large projects?
@ 2015-09-20 16:42 John Smith
  2015-09-20 18:42 ` gautier_niouzes
                   ` (4 more replies)
  0 siblings, 5 replies; 16+ messages in thread
From: John Smith @ 2015-09-20 16:42 UTC (permalink / raw)


Hi all,

In your experience, what are some good approaches in case I want to organize and then build an application with many files and resources.  Would you split the project up into source, resources, build_scripts, etc?  Would you use makefiles to build the whole thing or some other tool?

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: How to best organize and build large projects?
  2015-09-20 16:42 How to best organize and build large projects? John Smith
@ 2015-09-20 18:42 ` gautier_niouzes
  2015-09-20 18:58 ` David Botton
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 16+ messages in thread
From: gautier_niouzes @ 2015-09-20 18:42 UTC (permalink / raw)


Are you using GNAT ?
Then, perhaps this tutorial is for you:
   http://www.youtube.com/watch?v=o1cLLhtBNpk
"GNAT Project Manager: Part 1 of 14, Divide & Conquer"
HTH
_________________________
Gautier's Ada programming
http://gautiersblog.blogspot.com/search/label/Ada
NB: follow the above link for a valid e-mail address


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: How to best organize and build large projects?
  2015-09-20 16:42 How to best organize and build large projects? John Smith
  2015-09-20 18:42 ` gautier_niouzes
@ 2015-09-20 18:58 ` David Botton
  2015-09-20 19:45 ` Dmitry A. Kazakov
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 16+ messages in thread
From: David Botton @ 2015-09-20 18:58 UTC (permalink / raw)


Combination of makefiles and gpr files if you are able to use gprbuild in your project.

David Botton

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: How to best organize and build large projects?
  2015-09-20 16:42 How to best organize and build large projects? John Smith
  2015-09-20 18:42 ` gautier_niouzes
  2015-09-20 18:58 ` David Botton
@ 2015-09-20 19:45 ` Dmitry A. Kazakov
  2015-09-22 18:02   ` John Smith
  2015-09-21 10:31 ` Georg Bauhaus
  2015-09-21 12:03 ` Lucas Redding
  4 siblings, 1 reply; 16+ messages in thread
From: Dmitry A. Kazakov @ 2015-09-20 19:45 UTC (permalink / raw)


On Sun, 20 Sep 2015 09:42:42 -0700 (PDT), John Smith wrote:

> In your experience, what are some good approaches in case I want to
> organize and then build an application with many files and resources.
> Would you split the project up into source, resources, build_scripts, etc? 
> Would you use makefiles to build the whole thing or some other tool?

We have a very large project which uses GNAT gpr files only. No makefiles
used. The only scripts are ones to push sources to the remote and virtual
machines in order to start gnatmake there and pull the result files back.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: How to best organize and build large projects?
  2015-09-20 16:42 How to best organize and build large projects? John Smith
                   ` (2 preceding siblings ...)
  2015-09-20 19:45 ` Dmitry A. Kazakov
@ 2015-09-21 10:31 ` Georg Bauhaus
  2015-09-21 12:03 ` Lucas Redding
  4 siblings, 0 replies; 16+ messages in thread
From: Georg Bauhaus @ 2015-09-21 10:31 UTC (permalink / raw)


On 20.09.15 18:42, John Smith wrote:
> Hi all,
>
> In your experience, what are some good approaches in case I want to organize and then build an application with many files and resources.  Would you split the project up into source, resources, build_scripts, etc?  Would you use makefiles to build the whole thing or some other tool?
>

If "to organize" also means things like "generating sources",
adapting resources, and the like, then a ubiquitous scripting
language can be easier than just Ada or just (GNU) make,
if the former has actually been made for such tasks.
If resources are (de facto) proprietary, I guess the proprietor's
tools will be a good choice.
Preferably a scripting language that is either typically installed,
or else easy to get, and portable, such as Perl, or Ruby. (Minimizing
dependencies has always been good ROI unless the plan was (it wasn't)
to generate administrative extra work.)

For Ada sources, I'd expect makefiles to just drive the
Ada compiler's own make programs: Since Ada has its concept
of "library" (and configuration pragmas), one would be right
when expecting library aware build tools. (GNAT has them,
the compilers using the AdaMagic front end have them, the
former Rational tools may even have emphasized them (hearsay),
...)

OTOH, when generating documentation, chances are that
a simple makefile can drive typical processes, such as
transformations from DITA->HTML, DocBook->Something,
nroff->man etc. Trying BSD Make vs Microsoft Nmake vs
GNU make has, on occasion, contributed to robustness.


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: How to best organize and build large projects?
  2015-09-20 16:42 How to best organize and build large projects? John Smith
                   ` (3 preceding siblings ...)
  2015-09-21 10:31 ` Georg Bauhaus
@ 2015-09-21 12:03 ` Lucas Redding
  2015-09-21 15:19   ` Simon Wright
  4 siblings, 1 reply; 16+ messages in thread
From: Lucas Redding @ 2015-09-21 12:03 UTC (permalink / raw)


On Sunday, September 20, 2015 at 5:42:44 PM UTC+1, John Smith wrote:
> Hi all,
> 
> In your experience, what are some good approaches in case I want to organize and then build an application with many files and resources.  Would you split the project up into source, resources, build_scripts, etc?  Would you use makefiles to build the whole thing or some other tool?

In my humble opinion it is always good to break down your product/system:
Create subsystems, within the subsystem create products, and within products create classes/Ada packages depending on the size/distribution of the application. My example below talks about a very large application.

Manage your products/classes/subsystems and system (Main build) in a hierarchy (nesting) of self contained/independent libraries using gpr with possibly a single build script per GPR whether you decide to use gprbuild/gnatmake/make etc it can be independent to the gpr.

Each subsystem/product/package needs to be as self contained/independent as possible; i.e. compiles into a libary which is reused within the hierarchy, or compiles into an executable application. This aids the design/development, maintenance, verification down the line. This way you can distribute the development of the system to separate teams each responsible for a subsystem/product/package. A little effort upfront to design your system as such saves a huge amount of effort down the line.

Bottom up as well, look to maintaining single units, down to separates. Again, you have individual control down to the lowest common denominator ; i.e. if a separate changes, no need to impact the rest of the package, and a recompile is quick.

There is no silver bullet so all the above may be good but you may want to balance it due to the nature of your project. For instance disregard the separates because you dont' need the bottom up control etc.

Hope that helps

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: How to best organize and build large projects?
  2015-09-21 12:03 ` Lucas Redding
@ 2015-09-21 15:19   ` Simon Wright
  2015-09-21 15:28     ` David Botton
  2015-09-21 16:59     ` Dmitry A. Kazakov
  0 siblings, 2 replies; 16+ messages in thread
From: Simon Wright @ 2015-09-21 15:19 UTC (permalink / raw)


Lucas Redding <lucas.redding@gmail.com> writes:

> whether you decide to use gprbuild/gnatmake/make etc it can be
> independent to the gpr

If your project component (executable or library) is multi-language
(e.g. Ada and C), gnatmake isn't the right tool: use gprbuild. NB
gnatmake will lose the ability to build libraries after the next
release.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: How to best organize and build large projects?
  2015-09-21 15:19   ` Simon Wright
@ 2015-09-21 15:28     ` David Botton
  2015-09-21 16:38       ` Simon Wright
                         ` (2 more replies)
  2015-09-21 16:59     ` Dmitry A. Kazakov
  1 sibling, 3 replies; 16+ messages in thread
From: David Botton @ 2015-09-21 15:28 UTC (permalink / raw)


> gnatmake isn't the right tool: use gprbuild. NB

Just keep in mind that FSF GNAT on Windows and other platforms (except OSX thanks to your great work and Linux) does not have gprbuild so things getting uglier down the road unless someone either hacks gprbuild for those platforms or someone creates a universal version not dependant on specific GNAT builds.

For now I support gnatmake or gprbuild in the Gnoga makefiles (it autodetects availability), but if we lose FSF GNAT on Window is yet another big loss for Ada.  

David Botton



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: How to best organize and build large projects?
  2015-09-21 15:28     ` David Botton
@ 2015-09-21 16:38       ` Simon Wright
  2015-09-21 16:50         ` David Botton
  2015-09-21 16:52       ` Dmitry A. Kazakov
  2015-09-21 17:17       ` Shark8
  2 siblings, 1 reply; 16+ messages in thread
From: Simon Wright @ 2015-09-21 16:38 UTC (permalink / raw)


David Botton <david@botton.com> writes:

>> gnatmake isn't the right tool: use gprbuild. NB
>
> Just keep in mind that FSF GNAT on Windows and other platforms (except
> OSX thanks to your great work and Linux) does not have gprbuild so
> things getting uglier down the road unless someone either hacks
> gprbuild for those platforms or someone creates a universal version
> not dependant on specific GNAT builds.

It is some work, but you can use the GPL gprbuild with GCC 5.1 (for
example). I made some notes in the README for the Mac gcc-5.1.0-2015-bin
release;

   The tools require gprbuild, but gprbuild requires XMLAda. The
   workround was to build with GNAT GPL 2015 on the PATH before FSF GCC
   5.1.0, but to run gprconfig so as to create a default.cgpr which
   selected the FSF GCC, and copy this to each tool's head directory
   before doing the build.

This allowed me to use Gprbuild GPL 2015 to build XMLAda, and then to
build itself with appropriate --build and --prefix options to configure.

In any case, the GPL gprbuild source (which is the only source available
to us) is easy enough to configure for your environment.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: How to best organize and build large projects?
  2015-09-21 16:38       ` Simon Wright
@ 2015-09-21 16:50         ` David Botton
  0 siblings, 0 replies; 16+ messages in thread
From: David Botton @ 2015-09-21 16:50 UTC (permalink / raw)


> In any case, the GPL gprbuild source (which is the only source available
> to us) is easy enough to configure for your environment.

Perhaps, but since I don't have time to also do gnat builds, it means relying on the publicly built ones like TDM-GCC and they are more likely to drop Ada then to take time to build gprtools.

David Botton


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: How to best organize and build large projects?
  2015-09-21 15:28     ` David Botton
  2015-09-21 16:38       ` Simon Wright
@ 2015-09-21 16:52       ` Dmitry A. Kazakov
  2015-09-21 17:17       ` Shark8
  2 siblings, 0 replies; 16+ messages in thread
From: Dmitry A. Kazakov @ 2015-09-21 16:52 UTC (permalink / raw)


On Mon, 21 Sep 2015 08:28:24 -0700 (PDT), David Botton wrote:

>> gnatmake isn't the right tool: use gprbuild. NB
> 
> Just keep in mind that FSF GNAT on Windows and other platforms (except OSX
> thanks to your great work and Linux) does not have gprbuild so things
> getting uglier down the road unless someone either hacks gprbuild for
> those platforms or someone creates a universal version not dependant on
> specific GNAT builds.

... and where gprbuild exists chances are good that it might be broken ...

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: How to best organize and build large projects?
  2015-09-21 15:19   ` Simon Wright
  2015-09-21 15:28     ` David Botton
@ 2015-09-21 16:59     ` Dmitry A. Kazakov
  2015-09-21 21:36       ` Simon Wright
  1 sibling, 1 reply; 16+ messages in thread
From: Dmitry A. Kazakov @ 2015-09-21 16:59 UTC (permalink / raw)


On Mon, 21 Sep 2015 16:19:05 +0100, Simon Wright wrote:

> NB
> gnatmake will lose the ability to build libraries after the next
> release.

Not a big loss, maybe. When building a static library one forced to use
"ar" anyway. There seem no obvious way to force "--whole-archive" on the
end project.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: How to best organize and build large projects?
  2015-09-21 15:28     ` David Botton
  2015-09-21 16:38       ` Simon Wright
  2015-09-21 16:52       ` Dmitry A. Kazakov
@ 2015-09-21 17:17       ` Shark8
  2 siblings, 0 replies; 16+ messages in thread
From: Shark8 @ 2015-09-21 17:17 UTC (permalink / raw)


On Monday, September 21, 2015 at 9:28:26 AM UTC-6, David Botton wrote:
> > gnatmake isn't the right tool: use gprbuild. NB
> 
> Just keep in mind that FSF GNAT on Windows and other platforms (except OSX thanks to your great work and Linux) does not have gprbuild so things getting uglier down the road unless someone either hacks gprbuild for those platforms or someone creates a universal version not dependant on specific GNAT builds.
> 
> For now I support gnatmake or gprbuild in the Gnoga makefiles (it autodetects availability), but if we lose FSF GNAT on Window is yet another big loss for Ada.  
> 
> David Botton

I am working on a replacement, as I mentioned to you yesterday -- but since I haven't told C.L.A. allow me to plug Ada Project Manager: https://github.com/OneWingedShark/AdaProjectManager


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: How to best organize and build large projects?
  2015-09-21 16:59     ` Dmitry A. Kazakov
@ 2015-09-21 21:36       ` Simon Wright
  2015-09-21 21:52         ` Dmitry A. Kazakov
  0 siblings, 1 reply; 16+ messages in thread
From: Simon Wright @ 2015-09-21 21:36 UTC (permalink / raw)


"Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> writes:

> On Mon, 21 Sep 2015 16:19:05 +0100, Simon Wright wrote:
>
>> NB
>> gnatmake will lose the ability to build libraries after the next
>> release.
>
> Not a big loss, maybe. When building a static library one forced to
> use "ar" anyway. There seem no obvious way to force "--whole-archive"
> on the end project.

I don't understand what --whole-archive has to do with ar - it's an ld
option.

And I usually use static libraries, don't see any benefit from using
share libraries on my own machine. gprbuild works perfectly
well. Especially with my patch to produce "stand-alone" static
libraries, see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56616.


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: How to best organize and build large projects?
  2015-09-21 21:36       ` Simon Wright
@ 2015-09-21 21:52         ` Dmitry A. Kazakov
  0 siblings, 0 replies; 16+ messages in thread
From: Dmitry A. Kazakov @ 2015-09-21 21:52 UTC (permalink / raw)


On Mon, 21 Sep 2015 22:36:14 +0100, Simon Wright wrote:

> "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> writes:
> 
>> On Mon, 21 Sep 2015 16:19:05 +0100, Simon Wright wrote:
>>
>>> NB
>>> gnatmake will lose the ability to build libraries after the next
>>> release.
>>
>> Not a big loss, maybe. When building a static library one forced to
>> use "ar" anyway. There seem no obvious way to force "--whole-archive"
>> on the end project.
> 
> I don't understand what --whole-archive has to do with ar - it's an ld
> option.

If you have many subcomponents built as static libraries, you want to
collect all them into a single library. The only way to do this, I know, is
to build the library, unpack the result and all component's libraries and
then pack all object files again into a new library.

> And I usually use static libraries, don't see any benefit from using
> share libraries on my own machine.

It has, if you build a Windows DLL. Linux relocatable libraries are of less
use.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: How to best organize and build large projects?
  2015-09-20 19:45 ` Dmitry A. Kazakov
@ 2015-09-22 18:02   ` John Smith
  0 siblings, 0 replies; 16+ messages in thread
From: John Smith @ 2015-09-22 18:02 UTC (permalink / raw)


Thanks, I already found some resources on this.


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2015-09-22 18:02 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-20 16:42 How to best organize and build large projects? John Smith
2015-09-20 18:42 ` gautier_niouzes
2015-09-20 18:58 ` David Botton
2015-09-20 19:45 ` Dmitry A. Kazakov
2015-09-22 18:02   ` John Smith
2015-09-21 10:31 ` Georg Bauhaus
2015-09-21 12:03 ` Lucas Redding
2015-09-21 15:19   ` Simon Wright
2015-09-21 15:28     ` David Botton
2015-09-21 16:38       ` Simon Wright
2015-09-21 16:50         ` David Botton
2015-09-21 16:52       ` Dmitry A. Kazakov
2015-09-21 17:17       ` Shark8
2015-09-21 16:59     ` Dmitry A. Kazakov
2015-09-21 21:36       ` Simon Wright
2015-09-21 21:52         ` Dmitry A. Kazakov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox