forked from NOAA-EMC/MOM6
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Autoconf: Fix makedep path The current path of makedep in the autoconf build assumes a directory tree as in .testing. This patch uses the generalized @SrcDir@ to support more general autoconf builds. Other minor changes: * The `depend` rule was split into an explicit Makefile.dep rule and a phony rule to support `make depend` * SRC_DIRS shell assignment is replaced with an Autoconf macro. * A "self-generate" rule was added to `Makefile.in`, so that changes to `Makefile.in` do not trigger a full `./configure` run and regeneration of `.config.status`. This could possibly be extended to support `make depend` but let's first see how this one goes. * Autoconf: makedep uses autoconf var conventions This patch changes the makedep script to use autoconf environment variable conventions rather than mkmf ones: * FCFLAGS in place of FFLAGS * DEFS in place of CPPDEFS * LDFLAGS and LIBS rather than just LDFLAGS (NOTE: This differs from Makefile's LDLFLAGS/LDLIBS) This also allowed us to remove the custom build rule in the FMS build. Note that we now use an autoconf-friendly rule, rather than the default Makefile rule (which was arguably for fixed-format Fortran anyway). The description of autoconf->mkmf translation from the Makefile templates has also been removed, since they're no longer relevant. Some other minor changes in this build: * The `make depend` rule was added to the FMS Makefile template. * @SrcDir@ is directly passed to FMS makedep, rather than identically re-defining it in a variable. * Testing: Resolve makedep paths This patch resolves some issues relating to finding the path to makedep in both .testing and more generalized autoconf builds. An explicit autoconf test for makedep has been added, with a default path which includes the `ac` directory relative to `deps`. The .testing directory, which does not lie within `ac`, instead modifies the PATH to allow autoconf to find makedep. The absolute path is determined and substituted into the appropriate Makefile.in template. Some redundant operations in .testing/Makefile have been removed, but I suspect there are even more. Much of the structure required to support mkmf and list_paths is probably no longer needed.
- Loading branch information
1 parent
546312a
commit 4bcc849
Showing
7 changed files
with
64 additions
and
130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,66 +1,25 @@ | ||
# Makefile template for autoconf builds using mkmf | ||
# Makefile template for FMS | ||
# | ||
# Compiler flags are configured by autoconf's configure script. | ||
# | ||
# Source code dependencies are configured by mkmf and list_paths, specified in | ||
# the `Makefile.mkmf` file. | ||
# | ||
# mkmf conventions are close, but not identical, to autoconf. We attempt to | ||
# map the autoconf variables to the mkmf variables. | ||
# | ||
# The following variables are used by Makefiles generated by mkmf. | ||
# | ||
# CC C compiler | ||
# CXX C++ compiler | ||
# FC Fortran compiler (f77 and f90) | ||
# LD Linker | ||
# AR Archiver | ||
# | ||
# CPPDEFS Preprocessor macros | ||
# CPPFLAGS C preprocessing flags | ||
# CXXFLAGS C++ preprocessing flags | ||
# FPPFLAGS Fortran preprocessing flags | ||
# | ||
# CFLAGS C compiler flags | ||
# FFLAGS Fortran compiler flags | ||
# LDFLAGS Linker flags + libraries | ||
# ARFLAGS Archiver flags | ||
# | ||
# OTHERFLAGS Additional flags for all languages (C, C++, Fortran) | ||
# OTHER_CFLAGS Optional C flags | ||
# OTHER_CXXFLAGS Optional C++ flags | ||
# OTHER_FFLAGS Optional Fortran flags | ||
# TMPFILES Placeholder for `make clean` deletion (as `make neat`). | ||
# | ||
# | ||
# NOTES: | ||
# - FPPFLAGS and FFLAGS always appear as a pair, and autoconf does not use | ||
# FPPFLAGS, so FPPFLAGS does not serve much purpose. | ||
# | ||
# - mkmf's FFLAGS does not distinguish between autoconf's fixed-format | ||
# FFLAGS and free-format FCFLAGS. | ||
# | ||
# - LDFLAGS does not distinguish between autoconf's LDFLAGS and LIBS. | ||
# It also places both after the executable rather than just LIBS. | ||
# Source code dependencies are configured by makedep and saved to Makefile.dep. | ||
|
||
CC = @CC@ | ||
FC = @FC@ | ||
LD = @FC@ | ||
AR = @AR@ | ||
MAKEDEP = @MAKEDEP@ | ||
|
||
CPPDEFS = @DEFS@ | ||
DEFS = @DEFS@ | ||
CPPFLAGS = @CPPFLAGS@ | ||
FFLAGS = @FCFLAGS@ | ||
FCFLAGS = @FCFLAGS@ | ||
LDFLAGS = @LDFLAGS@ | ||
LIBS = @LIBS@ | ||
ARFLAGS = @ARFLAGS@ | ||
|
||
SRC_DIRS = @SRC_DIRS@ | ||
|
||
# Gather modulefiles | ||
TMPFILES = $(wildcard *.mod) | ||
|
||
-include Makefile.dep | ||
|
||
.PHONY: depend | ||
depend: | ||
../../bin/makedep -o Makefile.dep -f '$$(FC) $$(CPPFLAGS) $$(CPPDEFS) $$(FFLAGS) -c $$<' -x libFMS.a -d $(SRC_DIRS) | ||
depend: Makefile.dep | ||
Makefile.dep: | ||
$(MAKEDEP) -o Makefile.dep -x libFMS.a @srcdir@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters