Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[photran] How to use separate subfolders for sources, objects, data file, ... ?

Dear photran users,

I am currently using photran to develop a project with quite a lot of
separate source files, and also several input files and more than a
dozen output files.
=> my project list of files is an horrible mess!

I would like to put all the source files in a separate subfolder, the
object files in another, an data files in another.
Could you give me hints about the way to change my makefile to do that ?

My current makefile is:
RM=rm -f
#
#F90=pgf90
#F90=gfortran
F90=ifort
#F90=f95
#
FFLAGS_pgf90=-fast -C -tp=k8-64
FFLAGS_ifort=-fast
#FFLAGS_ifort=-O3
FFLAGS_gfortran=-O3 -C
FFLAGS_f95=-O3 -C
#FFLAGS_gfortran=-g -C
#FFLAGS=-g -C
#FFLAGS=-FR -O0 -auto -WB -traceback -g -fpe0 -fltconsistency -static
#
LDFLAGS_ifort=-static
LDFLAGS_ifort=-Bdynamic
LDFLAGS_gfortran=-g -C
LDFLAGS_f95=-g -C
LDFLAGS_gfortran=-C
#
LIBRARIES_pgf90=-llapack -lblas -lg2c
LIBRARIES_gfortran=-llapack -lblas
LIBRARIES_f95=-llapack -lblas
LIBRARIES_ifort=-lmkl_lapack -lmkl -lguide -lpthread
#LIBRARIES_ifort=-llapack -lblas -lg2c
#
FFLAGS=$(FFLAGS_$(F90))
LDFLAGS=$(LDFLAGS_$(F90))
LIBRARIES=$(LIBRARIES_$(F90))
.SUFFIXES: .c .f90 .f .o
#.SUFFIXES: .c .f90 .f .o .mod
# Rules for compiling Fortran files
.f90.o:
    -@$(RM) $@
    -@echo Compiling $< ...
    $(F90) -o $@ $(FFLAGS) -c $<
.f90.mod:
    -@$(RM) $@
    -@echo Compiling $< ...
    $(F90) -o $@ $(FFLAGS) -c $<
.f.o:
    -@$(RM) $@
    -@echo Compiling $< ...
    $(F90) -o $@ $(FFLAGS) -c $<
.f.mod:
    -@$(RM) $@
    -@echo Compiling $< ...
    $(F90) -o $@ $(FFLAGS) -c $<
########################################
# Commands to Build Application
########################################
EXEC=polar_scat_$(F90).exe
OBJS=kinds.o modules.o vacuum_propagators.o t3D.o interfaces.o
polar_scat.o alphac_complexe.o get_param.o get_coord.o get_atom_polar.o
get_cont_polar.o derf.o cross_sections.o farfield.o
get_fields_in_perturbation.o get_dipoles_in_perturbation.o rotate.o
I2C.o inv33.o Orientation_cross_section.o povray_file.o vmd_file.o
Scat_Matrix.o get_optical_index_H2O.o
all : $(EXEC)
$(EXEC) : $(OBJS)
    -@$(RM) $@
    -@echo Linking $@ ...
    $(F90) -o $@ $(LDFLAGS) $(OBJS) $(LIBRARIES)
clean :
    -@echo Deleting intermediate files and output files for project
    -$(RM) $(OBJS) *.mod core $(EXEC)
scratch : clean all




Back to the top