Skip to content

Commit

Permalink
Merge ../sample-pfunit
Browse files Browse the repository at this point in the history
Conflicts:
	Makefile
  • Loading branch information
Scott Wales committed Mar 7, 2014
2 parents d2504fc + e9d91af commit b82e347
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,15 @@ obj/%.o: obj/%.F90
.SECONDEXPANSION:

# Link programs
bin/%: obj/%.o $$(OBJREQ_%.o)
bin/%: obj/%.o $$(objectrequirements_%.o)
@mkdir -p $(dir $@)
$(LD) $(LDFLAGS) -o $@ $^ $(LDLIBS)

# Link tests with driver
$(TESTS):$(PFUNIT)/include/driver.F90
test/%: obj/%.o $$(OBJREQ_obj/%.o)
test/%: obj/%.o $$(objectrequirements_obj/%.o)
@mkdir -p $(dir $@)
$(FC) $(FCFLAGS) $(TESTFCFLAGS) $(LDFLAGS) -L$(PFUNIT)/lib -DUSE_MPI -DSUITE=$(notdir $*)_suite -o $@ $^ $(LDLIBS) -lpfunit
$(FC) $(FCFLAGS) $(TESTFCFLAGS) $(LDFLAGS) -L$(PFUNIT)/lib -DUSE_MPI -DSUITE=$(or $(basename $(modulesprovided_obj/$*.o)),$(notdir $*))_suite -o $@ $^ $(LDLIBS) -lpfunit

# Dependency generation
deps/%.d: %.f90
Expand Down
10 changes: 7 additions & 3 deletions gendeps
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,17 @@ if modules:
# Create a variable listing all the modules this file depends on - when
# expanded this will turn into all of the objects required to make use of this
# file
outfile.write('OBJREQ_' + obj + '=' +
' '.join('$(MODPROV_%s)'%mod for mod in dependencies)+'\n')
outfile.write('objectrequirements_' + obj + '=' +
' '.join('$(moduleprovider_%s)'%mod for mod in dependencies)+'\n')

# List of modules provided by the file
outfile.write('modulesprovided_' + obj + '=' +
' '.join(modules)+'\n')

# Create a variable for each module in the file listing all the objects the
# module depends on
for mod in modules:
outfile.write('MODPROV_'+mod+'='+obj+' '+'$(OBJREQ_'+obj+')\n')
outfile.write('moduleprovider_'+mod+'='+obj+' '+'$(objectrequirements_'+obj+')\n')

# Add to the list of programs
if isProgram:
Expand Down

0 comments on commit b82e347

Please sign in to comment.