Prev Up

Example

The following example sets the variable optspecs to a list of option specifications:
set optspecs {{"b|m:s" "Ignored for compatibility." ""}
    {"directory|C=s" "Change to DIRECTORY before doing anything."
         "DIRECTORY"}
    {"debug|d" "Print lots of debugging information."}
    {"environment-overrides|e" 
         "Environment variables override makefiles."}
    {"file|makefile|f=s" "Read FILE as a makefile." "FILE"}
    {"help|h" "Print this message and exit."}
    {"ignore-errors|i" "Ignore errors from commands."}
    {"include-dir|I=s" "Search DIRECTORY for included makefiles."
         "DIRECTORY"}
    {"jobs|j:s" "Allow N jobs at once; infinite jobs with no arg." "N"}
    {"keep-going|k" "Keep going when some targets can't be made."}
    {"load-average|max-load|l:s" 
         "Don't start multiple jobs unless load is below N." "N"}
    {"just-print|dry-run|recon|n"
         "Don't actually run any commands; just print them."}
    {"old-file|assume-old|o=s" 
         "Consider FILE to be very old and don't remake it." "FILE"}
    {"print-data-base|p" "Print make's internal database."}
    {"question|q" "Run no commands; exit status says if up to date."}
    {"no-builtin-rules|r" "Disable the built-in implicit rules."}
    {"silent|quiet|s" "Don't echo commands."}
    {"no-keep-going|stop|S" "Turns off -k."}
    {"touch|t" "Touch targets instead of remaking them."}
    {"version|v" "Print the version number of make and exit."}
    {"print-directory|w" "Print the current directory."}
    {"no-print-directory" 
         "Turn off -w, even if it was turned on implicitly."}
    {"what-if|new-file|assume-new|W=s" "Consider FILE to be infinitely new." 
         "FILE"}
    {"warn-undefined-variables" 
         "Warn when an undefined variable is referenced."}}

Written by Stefan Hornburg <racke@gundel.han.de>
Last modified 10 April 1997