help-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

having problems w/ makefiles


From: Wizumwalt
Subject: having problems w/ makefiles
Date: 7 Jul 2005 15:16:23 -0700
User-agent: G2/0.2

I'm trying to write a simple makefile and having a few problems. When I
run it ...
1) It only builds the fileA.f90 file and ignores the others.
2) It doesn't put the fileA.o inside my obj dir.

Any help much appreciated.

--- Makefile
COMMAND = myProg

SRCDIR = ./src
OBJDIR = ./obj
BINDIR = ./bin
MODDIR = $(SRCDIR)/modules
VPATH = $(SRCDIR) $(MODDIR)

FC = gfortran
FFLAGS = -I${SRCDIR} -I${MODDIR}

.SUFFIXES:
.SUFFIXES: .f90 .F90 .f .F .o .mod

include filelist.mk

$(OBJDIR)/%.o : $(addprefix $(MODDIR)/, $(MODSRC))
    $(FC) $(FFLAGS) -c $<

# not exactly sure what I'm doing here, but I have files that
# will depend on other files and these file have several
# different extensions. So I'm guessing for each file that needs
# another file, I just write a rule for it like this ...
$(OBJDIR)/fileA.o:  $(MODDIR)/fileA.f90
$(OBJDIR)/fileB.o:  $(MODDIR)/fileB.f90 $(MODDIR)/fileD.F
$(OBJDIR)/fileC.o:  $(MODDIR)/fileC.F90 $(MODDIR)/fileE.f90
$(OBJDIR)/fileD.o:  $(MODDIR)/fileD.F
$(OBJDIR)/fileE.o:  $(MODDIR)/fileE.f90

--- filelist.mk

MODSRC = fileA.f90 fileB.f90 fileC.F90 fileD.F fileE.f90



reply via email to

[Prev in Thread] Current Thread [Next in Thread]