compiling with make

  • Follow


Sorry for posting in this group, but i didn't find any specific
'make' newsgroup...  If anybody knows one, please tell me.

I am compiling Fortran 95 files with a Makefile, but a problem
appears...

I have the following dependency line:

mod_constants.o: \
        numeric_kinds.o

and the following rule

%.o: %.f95
        $(FC) -c $(FFLAGS) $<

But somehow, if I type

bartv@sonic:~/fortran/2Dsimulation/src/modules$ make mod_constants.o 
gfortran -c -g -pedantic -Wall -Wimplicit-interface -Wunderflow -fbounds-check -fimplicit-none -std=f95 numeric_kinds.f95
bartv@sonic:~/fortran/2Dsimulation/src/modules$ 

Only numeric_kinds.o gets built, not mod_constants.o.

Can somebody tell me why mod_constants isn't build?

Regards,
Bart

-- 
	"Share what you know.  Learn what you don't."
0
Reply MyFirstName.MyLastName (522) 4/7/2009 1:52:32 PM

On 2009-04-07, Bart Vandewoestyne <MyFirstName.MyLastName@telenet.be> wrote:
> Sorry for posting in this group, but i didn't find any specific
> 'make' newsgroup...  If anybody knows one, please tell me.
>
> I am compiling Fortran 95 files with a Makefile, but a problem
> appears...
>
> I have the following dependency line:
>
> mod_constants.o: \
>         numeric_kinds.o
>
> and the following rule
>
> %.o: %.f95
>         $(FC) -c $(FFLAGS) $<
>
> But somehow, if I type
>
> bartv@sonic:~/fortran/2Dsimulation/src/modules$ make mod_constants.o 
> gfortran -c -g -pedantic -Wall -Wimplicit-interface -Wunderflow -fbounds-check -fimplicit-none -std=f95 numeric_kinds.f95
> bartv@sonic:~/fortran/2Dsimulation/src/modules$ 
>
> Only numeric_kinds.o gets built, not mod_constants.o.
>
> Can somebody tell me why mod_constants isn't build?

Nevermind.  After a lot of debugging efforts, we have found that
the Makefile contained some TABs where it shouldn't have them :-(
Hard to spot errors, unfortunately...

Regards,
Bart

-- 
	"Share what you know.  Learn what you don't."
0
Reply MyFirstName.MyLastName (522) 4/7/2009 3:00:34 PM


Bart Vandewoestyne <MyFirstName.MyLastName@telenet.be> wrote:

> Nevermind.  After a lot of debugging efforts, we have found that
> the Makefile contained some TABs where it shouldn't have them :-(
> Hard to spot errors, unfortunately...

Yes, one of the many horrible flaws of Make. (Its flaws don't keep me
from using it, but I sure notice them.) You cannot determine the
correctness of a Makefile by looking at it because it depends on
distinctions that are invisible to the usual ways of looking at a text
file.

Thats' a pretty common error in Makefiles. You can get simillar
invisibile-error problems with some nonstandard Fortran code, but it is
less common and at least you have to be talking nonstandard source form.

-- 
Richard Maine                    | Good judgment comes from experience;
email: last name at domain . net | experience comes from bad judgment.
domain: summertriangle           |  -- Mark Twain
0
Reply nospam47 (9742) 4/7/2009 3:35:30 PM

In article <1ixsnjz.1avm6wr4aoqtcN%nospam@see.signature>,
 nospam@see.signature (Richard Maine) wrote:

> Yes, one of the many horrible flaws of Make.

The thing that has always perplexed me about the make facility is 
that anyone, any programmer at all with even a little experience, 
could think up a better syntax to accomplish what make does.  Yet, 
for some reason, the make facility with all of these flaws is the 
one that survived 25 or 30 years of competition against alternative 
approaches.  I can understand a little why some poorly designed 
programs remain popular despite superior alternatives (such as the 
most popular operating system ever written, which shall remain 
nameless :-), but make is not like that.  It is an open source 
utility, free of cost, used on multiple platforms, and not supported 
by part of any monopoly.

I use make all the time, and have for decades, but I have never 
liked it.  Survival of the least fittest?

$.02 -Ron Shepard
0
Reply ron-shepard (1197) 4/8/2009 6:00:48 AM

Bart Vandewoestyne wrote:
> 
> Nevermind.  After a lot of debugging efforts, we have found that
> the Makefile contained some TABs where it shouldn't have them :-(
> Hard to spot errors, unfortunately...

Sounds like you need to turn on syntax highlighting for your editor?
Both vim and emacs flag spaces-vs-tabs in makefiles.

Regards,
--
http://twitter.com/bil_kleb
0
Reply Bil.Kleb (900) 4/8/2009 1:09:00 PM

On 2009-04-08, Bil Kleb <Bil.Kleb@nasa.gov> wrote:
>
> Sounds like you need to turn on syntax highlighting for your editor?
> Both vim and emacs flag spaces-vs-tabs in makefiles.

Hmm... for now, I only have

syntax enable
set expandtab

in my .vimrc.  If i edit Fortran 95 code, i can see if there are
tabs in there (they appear as red bars).  But for the Makefile,
this wasn't visible...

Oh... but wait... the problem was in a depend.inc file where i
declare all the dependencies... maybe the syntax highlighting
wasn't there because of the non-standard filename depend.inc?

Regards,
Bart

-- 
	"Share what you know.  Learn what you don't."
0
Reply MyFirstName.MyLastName (522) 4/8/2009 1:43:48 PM

5 Replies
48 Views

(page loaded in 0.542 seconds)


Reply: