[GRASS5] Makefiles, autoconf, etc.

Ok, I've tried to summarize my thoughts on the current makefile
setup, where it should head, and how to get there below.
I'll take a look at the new beta8 code to see how hard this
will be to implement and report back next week.

Please comment in gory detail.

Whereas:

1) "make" should build targets. "make install" should copy
them to their destinations. This is how the majority of
projects out there operate. The current build setup uses
a collection of scripts to build grass using Gmakefiles.
Properly constructed Makefiles are sufficient to build grass
and all of its support libraries.

2) The standard usage of autoconf/automake takes forever to
configure with many automake constructed makefiles. Running
sed with several dozen substitutions, on several dozen
template files takes forever. It would be better to restrict
the substitutions to a handful of files, and include the
platform specific files from each Makefile.

3) Any build solution for a module product must allow easy
use by external module developers. A template Makefile
structure should be provided that can be customized for use
by extensions.

4) Libraries should be built as shared libs when possible.
This results in greater filesystem cache hits, as each
executable program hits the same chunk of disk space. This
in turn results in improved program performance. This also
results in less disk usage for the installed program.

I propose the following solution:

[background: we use the following layout to build The Product
(tm) at work. It's a satellite control automation tool. (I
just play with grass in my all too rare spare time) It runs
on HP-UX, IRIX, Linux, WinNT, and Solaris. It integrates
three major external toolkits (visualization, corba, scripting)
from three different vendors. This make strategy works well,
provided a couple MAKE variables are set properly.

Separate platform independent makefile components from the
standard set of make rules, and common make variable
definitions. Basically, you divide standard make stuff into
"Grass.make" (defines standard make variables like target
directory, etc.), "Platform.make" (encapsulates platform
specific stuff), and "Rules.make" (define standard make rules).
In addition, common target makefiles (e.g. "Lib.make",
"Shlib.make", "Progs.make") can be included for convenient
creation of common target types.

##################################################
# sample makefile

include $(GRASS_SRC)/include/Make/Grass.make
include $(GRASS_SRC)/include/Make/Platform.make
include $(GRASS_SRC)/include/Make/Rules.make

LIBNAME = sdts

include $(GRASS_SRC)/include/Make/Shlib.make

# end of sample
##################################################

This is all that's required to build a shared library,
provided that Platform.make is configured properly.

By careful selection of default, but overridable rules
and parameters, it's easy to extend this to programs,
and static libs.

Thoughts? Comments? Flames?

-- ebm
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=+
| Eric B. Mitchell mailto:emitchell@altaira.com |
| tel: (301) 809 - 3534 Altair Aerospace Corporation |
| tel: (800) 7 - ALTAIR 4201 Northview Dr. Suite 410 |
| fax: (301) 805 - 8122 Bowie, MD 20716 |
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=+
              ,___
          /"\ / o=\ /"""---===/
         / \_/ \__/ ---===/
         | //\ || /""TT""/ //\ || ||""\
         | // \ || || // \ || ||__/
         | //--==\ |L--/ || //--==\ || || "=,
          \ ---===/
           \____---===/

----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'

On Fri, Jul 28, 2000 at 09:57:46PM -0400, Eric Mitchell wrote:

include $(GRASS_SRC)/include/Make/Grass.make
include $(GRASS_SRC)/include/Make/Platform.make
include $(GRASS_SRC)/include/Make/Rules.make
Thoughts? Comments? Flames?

I'd go for Makefile.grass, Makefile.platform and Makefile.rules myself.
Otherwise what you suggest seems fine, especially given that it will
reduce that painful autoconf substitution sequence.

--
James Cameron mailto:quozl@us.netrek.org http://quozl.netrek.org/

----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'

Hi Eric, Hi developers,

normally i hate metoo postings. But i think that your suggestions are
very reasonable and i have no further suggestions or critique.

I hope that i can help with testing on Linux and IRIX. But my knowledge
on make, autoconf etc. is very limited.

cu,

Andreas

Eric Mitchell wrote:

Ok, I've tried to summarize my thoughts on the current makefile
setup, where it should head, and how to get there below.
I'll take a look at the new beta8 code to see how hard this
will be to implement and report back next week.

Please comment in gory detail.

--
Andreas Lange, 65187 Wiesbaden, Germany, Tel. +49 611 807850
Andreas.Lange@Rhein-Main.de - A.C.Lange@GMX.net

----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'