diff options
author | goodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 1999-11-24 19:57:21 +0000 |
---|---|---|
committer | goodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 1999-11-24 19:57:21 +0000 |
commit | d29c9698e567a3d72de56f1088fa40b2d6fe6df6 (patch) | |
tree | 3cef3b115d947027c6293756dc0fc64654522b2d /lib/make/make.config.rules.in | |
parent | db54e98c4d21f26bded1add924813d76f59b3d60 (diff) |
Merged in Erik's free-format f90 stuff. Until we have a standard
thorn with free-format f90 in it this is not guaranteed to
work on all platforms.
Thanks for doing this Erik.
Tidied up the f_file_processor to some extent added grdoc stuff to it,
and made the formatting consistent with the rest of the perl in the CCTK.
Tom
git-svn-id: http://svn.cactuscode.org/flesh/trunk@1168 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'lib/make/make.config.rules.in')
-rw-r--r-- | lib/make/make.config.rules.in | 72 |
1 files changed, 58 insertions, 14 deletions
diff --git a/lib/make/make.config.rules.in b/lib/make/make.config.rules.in index d8eaeea2..80c9bfb7 100644 --- a/lib/make/make.config.rules.in +++ b/lib/make/make.config.rules.in @@ -56,6 +56,11 @@ define F_DEPENDENCIES $(DEPENDENCY_FIXER) endef +define F90_DEPENDENCIES + $(F_DEPEND) $(INC_DIRS:%=-I%) $(EXTRA_DEFINES:%=-D%) -DFCODE $< $(F_DEPEND_OUT) + $(DEPENDENCY_FIXER) +endef + ##################################################################### # Define how to do a C compilation define PREPROCESS_C @@ -93,28 +98,44 @@ endef define POSTPROCESS_F77 endef -# Define how to do a F90 compilation +# Define how to do a fixed-format F90 compilation +define PREPROCESS_F +cat $< | sed 's.//.AUTOMATICALLY_GENERATED_CONCATONATION_PROTECTION_STRING.g' | $(CPP) $(CPPFLAGS) $(INC_DIRS:%=-I%) $(EXTRA_DEFINES:%=-D%) -DFCODE - | $(PERL) -p -e 's/__FORTRANFILE__/\"$(basename $(notdir $<)).F\"/g; s.AUTOMATICALLY_GENERATED_CONCATONATION_PROTECTION_STRING.//.g' - | $(PERL) $(F_FILE_PROCESSOR) > $(basename $(notdir $<)).f +endef + +define COMPILE_F +current_wd=`$(GET_WD)` ; cd $(SCRATCH_BUILD) ; $(F90) $(DEBUG_F90) $(F90FLAGS) $(FCOMPILEONLY)$(OPTIONSEP)$$current_wd$(DIRSEP)$@ $$current_wd$(DIRSEP)$(basename $(notdir $<)).f +endef + +define POSTPROCESS_F +endef + +# Define how to do a free-format F90 compilation define PREPROCESS_F90 -cat $< | sed 's.//.AUTOMATICALLY_GENERATED_CONCATONATION_PROTECTION_STRING.g' | $(CPP) $(CPPFLAGS) $(INC_DIRS:%=-I%) $(EXTRA_DEFINES:%=-D%) -DFCODE - | $(PERL) -p -e 's/__FORTRANFILE__/\"$(basename $(notdir $<)).F\"/g ;s.AUTOMATICALLY_GENERATED_CONCATONATION_PROTECTION_STRING.//.g' | $(PERL) $(F_FILE_PROCESSOR) > $(basename $(notdir $<)).f +cat $< | sed 's.//.AUTOMATICALLY_GENERATED_CONCATONATION_PROTECTION_STRING.g' | $(CPP) $(CPPFLAGS) $(INC_DIRS:%=-I%) $(EXTRA_DEFINES:%=-D%) -DFCODE - | $(PERL) -p -e 's/__FORTRANFILE__/\"$(basename $(notdir $<)).F\"/g; s.AUTOMATICALLY_GENERATED_CONCATONATION_PROTECTION_STRING.//.g' - | $(PERL) -s $(F_FILE_PROCESSOR) -free_format > $(basename $(notdir $<)).f90 endef define COMPILE_F90 -current_wd=`$(GET_WD)` ; cd $(SCRATCH_BUILD) ; $(F90) $(DEBUG_F90) $(F90FLAGS) $(FCOMPILEONLY)$(OPTIONSEP)$$current_wd$(DIRSEP)$@ $$current_wd$(DIRSEP)$(basename $(notdir $<)).f +current_wd=`$(GET_WD)` ; cd $(SCRATCH_BUILD) ; $(F90) $(DEBUG_F90) $(F90FLAGS) $(FCOMPILEONLY)$(OPTIONSEP)$$current_wd$(DIRSEP)$@ $$current_wd$(DIRSEP)$(basename $(notdir $<)).f90 endef define POSTPROCESS_F90 endef +# Define how to do a f77 compilation +define PREPROCESS_f77 +cat $< > $(basename $(notdir $<)).f +endef + # Define how to do a f compilation define PREPROCESS_f cat $< > $(basename $(notdir $<)).f endef - -# Define how to do a f77 compilation -define PREPROCESS_f77 -cat $< > $(basename $(notdir $<)).f +# Define how to do a f90 compilation +define PREPROCESS_f90 +cat $< > $(basename $(notdir $<)).f90 endef @@ -129,7 +150,6 @@ endef @echo Postprocessing $< $(POSTPROCESS_C) - %.c.d: $(SRCDIR)/%.c $(C_DEPENDENCIES) @@ -212,26 +232,25 @@ endef %.f77.d: $(SRCDIR)/%.f77 $(F77_DEPENDENCIES) - # Build rules for F90 %.F.o: $(SRCDIR)/%.F @echo $(DIVIDER) @echo Preprocessing $< - $(PREPROCESS_F90) + $(PREPROCESS_F) @echo Compiling $(DEBUG_F90) $< - $(COMPILE_F90) + $(COMPILE_F) @echo Postprocessing $< - $(POSTPROCESS_F90) + $(POSTPROCESS_F) %.f.o: $(SRCDIR)/%.f @echo $(DIVIDER) @echo Copying $< $(PREPROCESS_f) @echo Compiling $(DEBUG_F90) $< - $(COMPILE_F90) + $(COMPILE_F) @echo Postprocessing $< - $(POSTPROCESS_F90) + $(POSTPROCESS_F) %.F.d: $(SRCDIR)/%.F $(F_DEPENDENCIES) @@ -239,3 +258,28 @@ endef %.f.d: $(SRCDIR)/%.f $(F_DEPENDENCIES) +# Build rules for free-format F90 + +%.F90.o: $(SRCDIR)/%.F90 + @echo $(DIVIDER) + @echo Preprocessing $< + $(PREPROCESS_F90) + @echo Compiling $(DEBUG_F90) $< + $(COMPILE_F90) + @echo Postprocessing $< + $(POSTPROCESS_F90) + +%.f90.o: $(SRCDIR)/%.f90 + @echo $(DIVIDER) + @echo Copying $< + $(PREPROCESS_f90) + @echo Compiling $(DEBUG_F90) $< + $(COMPILE_F90) + @echo Postprocessing $< + $(POSTPROCESS_F90) + +%.F90.d: $(SRCDIR)/%.F90 + $(F90_DEPENDENCIES) + +%.f90.d: $(SRCDIR)/%.f90 + $(F90_DEPENDENCIES) |