NAME

adapt-mkfile - Transform a makefile with machine-dependent information into one that is adapted to the machine we're running on.


SYNOPSIS

adapt-mkfile [-f incfile] [file1 [file2]]

adapt-mkfile [-h|--help] [-v|--version]


DESCRIPTION

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.


ARGUMENTS

file1, file2

Input and output file names; default to standard input/output

-f incfile

Include the contents of file incfile (see FILES)

-h, --help

Show usage overview

-v, --version

Show version number


SYNTAX

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...


FILES

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:

  1. $ADAPT_MKFILE if that environment variable exists, otherwise ~/.adapt-mkfile.incl
  2. ./.adapt-mkfile.incl (deprecated)
  3. ./adapt-mkfile.incl (preferred)
  4. The file name specified with the -f option

This allows you to enforce local settings without touching the Makefile itself (useful for tricky things like cross-compiling).

Note:

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.


NOTES


AUTHOR

Wolfgang Dobler <Wolfgang [.] Dobler [at] kis.uni-freiburg.de>


SEE ALSO

perl(1), make(1)


BUGS

Too many to mention