make.common.svn-base 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. PROGRAM = $(BINDIR)/$(BENCHMARK).$(CLASS).$(NPROCS)
  2. FCOMPILE = $(MPIF77) -c $(FMPI_INC) $(FFLAGS)
  3. CCOMPILE = $(MPICC) -c $(CMPI_INC) $(CFLAGS)
  4. # Class "U" is used internally by the setparams program to mean
  5. # "unknown". This means that if you don't specify CLASS=
  6. # on the command line, you'll get an error. It would be nice
  7. # to be able to avoid this, but we'd have to get information
  8. # from the setparams back to the make program, which isn't easy.
  9. CLASS=U
  10. NPROCS=1
  11. default:: ${PROGRAM}
  12. # This makes sure the configuration utility setparams
  13. # is up to date.
  14. # Note that this must be run every time, which is why the
  15. # target does not exist and is not created.
  16. # If you create a file called "config" you will break things.
  17. config:
  18. @cd ../sys; ${MAKE} all
  19. ../sys/setparams ${BENCHMARK} ${NPROCS} ${CLASS} ${SUBTYPE}
  20. COMMON=../common
  21. ${COMMON}/${RAND}.o: ${COMMON}/${RAND}.f
  22. cd ${COMMON}; ${FCOMPILE} ${RAND}.f
  23. ${COMMON}/c_randdp.o: ${COMMON}/randdp.c
  24. cd ${COMMON}; ${CCOMPILE} -o c_randdp.o randdp.c
  25. ${COMMON}/print_results.o: ${COMMON}/print_results.f
  26. cd ${COMMON}; ${FCOMPILE} print_results.f
  27. ${COMMON}/c_print_results.o: ${COMMON}/c_print_results.c
  28. cd ${COMMON}; ${CCOMPILE} c_print_results.c
  29. ${COMMON}/timers.o: ${COMMON}/timers.f
  30. cd ${COMMON}; ${FCOMPILE} timers.f
  31. ${COMMON}/c_timers.o: ${COMMON}/c_timers.c
  32. cd ${COMMON}; ${CCOMPILE} c_timers.c
  33. # Normally setparams updates npbparams.h only if the settings (CLASS/NPROCS)
  34. # have changed. However, we also want to update if the compile options
  35. # may have changed (set in ../config/make.def).
  36. npbparams.h: ../config/make.def
  37. @ echo make.def modified. Rebuilding npbparams.h just in case
  38. rm -f npbparams.h
  39. ../sys/setparams ${BENCHMARK} ${NPROCS} ${CLASS} ${SUBTYPE}
  40. # So that "make benchmark-name" works
  41. ${BENCHMARK}: default
  42. ${BENCHMARKU}: default