Makefile 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. #
  2. # Makefile for XML reader.
  3. #
  4. #----------------------------------------------
  5. # settings
  6. #----------------------------------------------
  7. # basename of xml type etc:
  8. basename = standard_name_table
  9. # test code:
  10. test = $(basename)-test
  11. #----------------------------------------------
  12. # compiler
  13. #----------------------------------------------
  14. FC = gfortran
  15. FFLAGS = -fbounds-check
  16. LDFLAGS =
  17. #----------------------------------------------
  18. # libraries
  19. #----------------------------------------------
  20. INCS = -I${XMLF_HOME}/include
  21. LIBS = -L${XMLF_HOME}/lib -lxmlf
  22. #----------------------------------------------
  23. # rules
  24. #----------------------------------------------
  25. %.o: %.F90
  26. $(FC) -c $(FFLAGS) $(INCS) $<
  27. %.o: %.f90
  28. $(FC) -c $(FFLAGS) $(INCS) $<
  29. #----------------------------------------------
  30. # targets
  31. #----------------------------------------------
  32. help:
  33. @echo ""
  34. @echo " Usage:"
  35. @echo " make $(basename).f90"
  36. @echo " make $(test).x"
  37. @echo " make clean"
  38. @echo ""
  39. #----------------------------------------------
  40. # targets
  41. #----------------------------------------------
  42. # * reader module
  43. $(basename).f90: $(basename).xml
  44. xmlf-make-reader $(basename).xml
  45. # * test program
  46. $(basename).o: $(basename).f90
  47. $(test).o: $(test).F90 $(basename).o
  48. objs = $(test).o $(basename).o
  49. $(test).x: $(test).o
  50. $(FC) -o $@ $(LDFLAGS) $(objs) $(LIBS)
  51. # * clean
  52. clean:
  53. /bin/rm -f *.o *.mod *.x
  54. /bin/rm -f $(basename).f90