make.inc 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. # ============================================================================
  2. # *** Set build ARCHITECTURE here
  3. # ============================================================================
  4. # NOTE: This setting is supposedly overwritten by a command line argument
  5. BUILD_ARCH := NO_ARCH_DEFINED
  6. $(info --> Using BUILD_ARCH=$(BUILD_ARCH))
  7. # ============================================================================
  8. # *** Build ARCHITECTURE configuration
  9. # ============================================================================
  10. makefile_path := $(dir $(realpath $(lastword $(MAKEFILE_LIST))))Makefile.d
  11. MAKEFILE_CONFIG_ARCH := $(makefile_path)/Makefile.config.$(BUILD_ARCH)
  12. ifneq ($(wildcard $(MAKEFILE_CONFIG_ARCH)),)
  13. include $(MAKEFILE_CONFIG_ARCH)
  14. else
  15. $(info . ======================================================================)
  16. $(info . *** Unknown build architecture: '$(BUILD_ARCH)')
  17. $(info . *** ------------------------------------------------------------------)
  18. $(info . *** Please make sure that you specify the correct)
  19. $(info . *** BUILD_ARCH=<ARCHITECTURE> on the make command line and )
  20. $(info . *** that a file '$(notdir $(MAKEFILE_CONFIG_ARCH))' exists )
  21. $(info . *** in the following directory: )
  22. $(info . *** $(MAKEFILE_CONFIG).d )
  23. $(info . ======================================================================)
  24. $(error Unknown architecture BUILD_ARCH=$(BUILD_ARCH))
  25. endif
  26. # ============================================================================
  27. # *** Architecture independent configuration
  28. # ============================================================================
  29. # External libraies for linking
  30. FLIBS = $(NETCDF_LIBRARY) $(MPILIB)
  31. # ARCHDIR : directory created when compiling
  32. ARCHDIR := $(COUPLE)/$(BUILD_ARCH)
  33. # LIBPSMILE : list of oasis3 libraries
  34. LIBPSMILE := $(ARCHDIR)/lib/libanaisg.a \
  35. $(ARCHDIR)/lib/libanaism.a \
  36. $(ARCHDIR)/lib/libclim.$(CHAN).a \
  37. $(ARCHDIR)/lib/libpsmile.$(CHAN).a \
  38. $(ARCHDIR)/lib/libfscint.a \
  39. $(ARCHDIR)/lib/libmpp_io.a \
  40. $(ARCHDIR)/lib/libscrip.a
  41. # BINDIR : directory for executables
  42. BINDIR := $(ARCHDIR)/bin
  43. # LIBBUILD : contains a directory for each library
  44. LIBBUILD := $(ARCHDIR)/build/lib
  45. # PSMILE_INCDIR : includes all *o and *mod for each library
  46. PSMILE_INCDIR := -I$(LIBBUILD)/psmile.$(CHAN) \
  47. -I$(LIBBUILD)/clim.$(CHAN) \
  48. -I$(LIBBUILD)/mpp_io
  49. F90FLAGS += $(PSMILE_INCDIR)
  50. CCFLAGS += $(PSMILE_INCDIR)
  51. # Needed to work with SCE Makefile
  52. I4mods := I