Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rules to make .o files inadequate when both .f and .f90 files are present #50

Open
rjleveque opened this issue Aug 7, 2013 · 2 comments
Assignees

Comments

@rjleveque
Copy link
Member

In clawutil/src/Makefile.common, the rules

OBJECTS = $(subst .F,.o, $(subst .F90,.o, $(subst .f,.o, $(subst .f90,.o, $(SOURCES))))) %.o : %.f90 ; $(CLAW_FC) -c $< $(ALL_INCLUDE) $(ALL_FFLAGS) -o $@ %.o : %.f ; $(CLAW_FC) -c $< $(ALL_INCLUDE) $(ALL_FFLAGS) -o $@

were written assuming there might be either a file fname.f or fname.f90 but not both. If both are present and only one is listed in the Makefile, the wrong one might be compiled.

This sometimes bites us when updating a file from .f to .f90 form and the old one is still present.

@ahmadia
Copy link
Member

ahmadia commented Aug 7, 2013

What's the desired behavior here? You could try switching the order of the pattern rules to match, but I suggest you explicitly specify SOURCES instead of using a glob :)

@mandli
Copy link
Member

mandli commented Aug 7, 2013

The line with the OBJECTS definition preferences f90 source before f when making the object list. As Aron pointed out, unless we go back to specifying the object list as well as the source list we have to make some compromise like this.

@mandli mandli assigned mandli and rjleveque and unassigned mandli Oct 12, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants