adapt-mkfile - Transform a makefile with machine-dependent information into one that is adapted to the machine we're running on.
adapt-mkfile [-f incfile] [file1 [file2]]
adapt-mkfile [-h|--help] [-v|--version]
adapt-mkfile processes a makefile and activates or deactivates lines depending on the operating system and the machine name. In addition, the contents of certain files will be appended to the adapt-mkfile block. The aim is to have one meta-makefile (typically `Makefile'), from which a machine-specific `makefile' is generated.
Input and output file names; default to standard input/output
Include the contents of file incfile (see FILES)
Show usage overview
Show version number
### Begin machine dependent
and ### End machine dependent
) is processed.
#(mhd.)
will match mhd0, mhd1,
mhd2, etc, and also mhd1.st-and.ac.uk Alternatively, we can use something like
#(mhd0|mhd1)
or #(mhd[0-6])
.
An example is probably best to illustrate how an input Makefile can look like:
### Begin machine dependent
## Linux: ## This comment will always remain untouched #FC=f95 #FC=/usr/lib/lam/bin/mpif95 #(Cincinnatus|Owen|Master) #FFLAGS= -O4 -C -gline -Wc,-malign-double
## OSF1: ## Compaq/HP alpha #FC=f95 #FFLAGS=-fast -O5 #FFLAGS=-fast -O5 -tune ev6 -arch ev6 #(Mhd.)
## IRIX64: #FC=f90 #FFLAGS= -64 -O3 -C -macro_expand #(Antares) #FFLAGS= -pfalist -64 -O3 -mips4 -C -macro_expand #(Grand)
### End machine dependent
## Main part of Makefile follows...
At the end of the adapt-mkfile block, i.e. just before the ### End
machine dependent
, the contents of the following files will be inserted
(in this order) if present:
This allows you to enforce local settings without touching the Makefile itself (useful for tricky things like cross-compiling).
The file names ~/.adapt-mkfile.inc,
./adapt-mkfile.inc and ./adapt-mkfile.inc will also work, but the
above forms of the file names (suffix .incl
) are recommended.
## linux:
,
## Linux:
and ## LiNuX:
will all be matched on a GNU/Linux box.
default: makefile code
makefile: Makefile adapt-mkfile Makefile makefile code: make start.x run.x ...
Wolfgang Dobler <Wolfgang [.] Dobler [at] kis.uni-freiburg.de>
perl(1), make(1)
Too many to mention