Advertisement
Guest User

Untitled

a guest
May 24th, 2015
241
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. # the names of every source file, separated by space;
  2. # you can use a wildcard, or specify the explicitly
  3. F90SRC=$(wildcard *.f90)
  4.  
  5. # directory in which the object files are located (optional);
  6. # it must end with a slash
  7. #OBJPREFIX=obj/
  8.  
  9. # note: it's probably a bad idea to put this snippet
  10. # before the first target rule in the makefile
  11.  
  12. # extract the dependencies of the project
  13. # (the '@' before 'for' silences the output of this command)
  14. #
  15. # note: this is kind of a hack, as all it does is to search the
  16. # sources for a line that looks like "use <module>"
  17. dependencies.mk: $(F90SRC)
  18. @for f in $^; do \
  19. printf "%s:" "$(OBJPREFIX)$${f%.f90}.o"; \
  20. awk -v p="$(OBJPREFIX)" \
  21. '$$1 == "use" && NF == 2 { printf " %s%s.o",p,$$2 }' "$$f"; \
  22. echo; \
  23. done >$@.tmp; \
  24. mv $@.tmp $@
  25.  
  26. include dependencies.mk
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement