info-inventor-dev
[Top] [All Lists]

RE: OpenInventor on SUN, X error

To: Rasmus Tamstorf <tamstorf@xxxxxxxxxxxxx>
Subject: RE: OpenInventor on SUN, X error
From: "J . A . Magallon" <jamagallon@xxxxxxx>
Date: Fri, 9 Feb 2001 19:17:54 +0100
Cc: "Kelm, Peter TBG" <Peter.Kelm@xxxxxxxxxx>, info-inventor-dev@xxxxxxxxxxx
In-reply-to: <Pine.SGI.4.10.10102090818150.1759-100000@xxxxxxxxxxxxxxxxxxxxxxx>; from tamstorf@xxxxxxxxxxxxx on Fri, Feb 09, 2001 at 17:27:18 +0100
References: <35E288755570D311A65400902760DD4B01868CC3@xxxxxxxxxxxxxxxxx> <Pine.SGI.4.10.10102090818150.1759-100000@xxxxxxxxxxxxxxxxxxxxxxx>
Sender: owner-info-inventor-dev@xxxxxxxxxxx
On 02.09 Rasmus Tamstorf wrote:
> On Fri, 9 Feb 2001, Kelm, Peter  TBG wrote:
> 
> 
> That's fine with me. I'm not religious about any particular extension as
> long as it works for all compilers, so that still leaves .cxx, .cpp and
> .cc. 
> 

cpp sounds to much to win-dos, forcing 3 char extensions...
Better use .cc, just two fast keystrokes on 'c', not looking for '+'.

And a point that is not looket at, is that it not only depends on the
compiler that can admit the extension, but also on the make system that
recognizes the extension as a valid one. If not, you have to include
all the time the .SUFFIXES lines in your makefiles.

>From the info in make 3.79.1 (Catalog of Implicit Rules):

Compiling C programs
     `N.o' is made automatically from `N.c' with a command of the form
     `$(CC) -c $(CPPFLAGS) $(CFLAGS)'.

Compiling C++ programs
     `N.o' is made automatically from `N.cc' or `N.C' with a command of
     the form `$(CXX) -c $(CPPFLAGS) $(CXXFLAGS)'.  We encourage you to
     use the suffix `.cc' for C++ source files instead of `.C'.

So GNU make votes for .cc, and that is the way to make life easy. If
any other thing is used, that only contributes to have to include more
extra things in the build tree that could work just with the defaults.

Same problem occurs with portability. My thesis code has to be built in
win and unix. Usually, going for make into subdirs was a pain, because 
for syntax
is different in DOS and bash/ksh/sh, and writing the code inside the loop
with cd, backslashes, and so on. The I discovered the marvelous
'foreach' built-in for in gnumake, so you can do

$(foreach dir,$(SUBDIRS),$(MAKE) -C $(dir))

and loops are portable between win and unix.
So my advice is: read first the full manual of GNU make, don't do like me.

-- 
J.A. Magallon                                                      $> cd pub
mailto:jamagallon@xxxxxxx                                          $> more beer

Linux werewolf 2.4.1-ac8 #2 SMP Fri Feb 9 01:53:46 CET 2001 i686


<Prev in Thread] Current Thread [Next in Thread>