help-make
[Top][All Lists]
Advanced

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

help with compilation of makefile


From: Rakesh Kasturi
Subject: help with compilation of makefile
Date: Thu, 05 Jun 2003 18:24:50 +0200

hello,
im a newbie with makefiles etc..so excuse moi if my query sounds a bit
silly!!

i use fortran programs on a linux machine..my dir. struct. is:
radix:
    diff
    include
    architechtures
    ...
    ...
i have source files to be made in each directory and the corresponding
rules for them in files called *.rules in each directory.
(for ex: diff_cud5_x.rules looks like this-
VPATH+=$(DIFF_DIR)
OBJECTS=diff_cud5_x.o
ALL_OBJECTS+=$(OBJECTS)

diff_cud5_x.o:F90_OPT=$(F90_HIG_OPT)
diff_cud5_x.o:abk.o define_header.o pentadiagonal.o aus\
tausch.o
)

Makefile.in contains the major rules for compiling and linking..

i use a configuration file along with Makefile.in to specify at runtime
all the necessary parameters..

my problem is that the make runs beautifully at first but stops abruptly
after making diff_cud5_x.o..i believe iv done all the needed rules ..and
o course the .F/.f90 files are not empty..

is there something wrong with the Makefile..like wildcards/rules n stuff

id apreciate it if someone can help me with this..i understand that it
stops but im not able to figure out how to make it go further!! do lemme
know if u need more info..i guess iv pretty much given a concise problem
statement.
thanks a lot ahead!!
ciao
rakesh

(pls scroll down for the Makefile.in)
##############################################
#
#  Main Makefile for all files
#
###############################################

# Clear all implicit rules
%.o: %.mod
%.mod: %.o
%.o: %.mod
%.o: %.F
%.o: %.$(F90)


export
INCLUDE_DIR=$(SRC_DIR)/include
KOMMUNIKATION_DIR=$(SRC_DIR)/include/etc
COMMON_DIR=$(SRC_DIR)/common
DIFF_DIR=$(SRC_DIR)/diff
BC_DIR=$(SRC_DIR)/boundaryconditions
HEADER_DIR=$(SRC_DIR)/header/$(HEADER)
IOLIB_DIR=$(SRC_DIR)/io/$(LIBIO)
TIME_DIR=$(SRC_DIR)/$(TIMESTEPPING)
PDE_DIR=$(SRC_DIR)/$(PDE)
INITIAL_DIR=$(SRC_DIR)/initialconditions/$(INITIAL_COND\
ITION)
INLET_DIR=$(SRC_DIR)/inletconditions
GEOM_DIR=$(SRC_DIR)/geometries/$(GEOMETRY)
VISCOSITY_DIR=$(SRC_DIR)/pde/$(VISCOSITY)
STATS_DIR=$(SRC_DIR)/statistics
SYSTEM_UTILS_DIR=$(SRC_DIR)/system_utils
VPATH=.:$(SYSTEM_UTILS_DIR):$(COMMON_DIR):$(HEADER_DIR)\
:$(IOLIB_DIR):$(DIFF_DIR)


# include the architecture
include $(SRC_DIR)/architectures/$(HOST).conf


# Decide on global optimization
ifeq ($(OPTIMIZATION),debug)
        F90_OPT=$(F90_DEB_OPT)
endif
ifeq ($(OPTIMIZATION),high)
        F90_OPT=$(F90_HIG_OPT)
endif



# Evaluate the parallelism flag
ifeq ($(PARALELL),mpi)
       CPP_PARALLEL=-DMPI
else
       CPP_PARALLEL=
endif

#include differentiation DIFF
include $(SRC_DIR)/diff/$(DIFF_X)_x.rules
include $(SRC_DIR)/diff/$(DIFF_Y)_y.rules
include $(SRC_DIR)/diff/$(DIFF_Z)_z.rules

#include differentiation DIFF C
include $(SRC_DIR)/diff/$(DIFF_C_X)_x.rules
include $(SRC_DIR)/diff/$(DIFF_C_Y)_y.rules
include $(SRC_DIR)/diff/$(DIFF_C_Z)_z.rules

define preprocess_F
        $(CPP) -P -C $(CPP_PARALLEL) $(CPPFLAGS) -I$(IN\
CLUDE_DIR) -I$(KOMMUNIKATION_DIR) $< $(notdir  $(basena\
me $<))$(F90_SUFFIX)
endef

define compile-f90
$(F90) $(F90_BASIC_FLAGS) $(F90_OPT) $(F90_SPECIFIC_FLA\
GS) $(notdir $(basename $<))$(F90_SUFFIX) -c
endef
define final-link
$(LN) $(LN_LIBS)$^ -o $@
endef

#General rule to compile


%$(F90_SUFFIX): %.F
        $(preprocess_F)

%.o: %$(F90_SUFFIX)
        $(compile-f90)



$(AOUT):$(ALL_OBJECTS)
        $(compile-f90)
        $(final-link)


--
Black Holes suck!

Rakesh Kasturi
CSE Masters Program
Technische Universitaet Munchen(TUM)
Deutschland







reply via email to

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