cpp 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. .TH CPP 1
  2. .SH NAME
  3. cpp \- C language preprocessor
  4. .SH SYNOPSIS
  5. .B cpp
  6. [
  7. .I option ...
  8. ]
  9. [
  10. .I ifile
  11. [
  12. .I ofile
  13. ]
  14. ]
  15. .SH DESCRIPTION
  16. .I Cpp\^
  17. interprets ANSI C preprocessor directives
  18. and does macro substitution.
  19. The input
  20. .I ifile
  21. and output
  22. .I ofile
  23. default to standard input and standard output respectively.
  24. .PP
  25. The options are:
  26. .TP
  27. .BI -D name\^
  28. .PD 0
  29. .TP
  30. .BI -D name=def\^
  31. .TP
  32. .BI -I dir\^
  33. Same as in
  34. .IR 2c "(1): add
  35. .I dir
  36. to the search for
  37. .CW search
  38. directives.
  39. .PD
  40. .TP
  41. .B -M
  42. Generate no output except a list of include files
  43. in a form suitable for specifying dependencies to
  44. .IR mk (1).
  45. Use twice to list files in angle brackets.
  46. .TP
  47. .B -N
  48. Turn off default include directories. All must be
  49. specified with
  50. .BR -I ,
  51. or in the environment variable
  52. .BR include .
  53. Without this option,
  54. .B /$objtype/include
  55. and
  56. .B /sys/include
  57. are used as the last two searched directories for include directives,
  58. where
  59. .B $objtype
  60. is read from the environment.
  61. .TP
  62. .B -V
  63. Print extra debugging information.
  64. .TP
  65. .B -P
  66. Do not insert
  67. .RB `` #line ''
  68. directives into the output.
  69. .TP
  70. .B -+
  71. Understand C++ comments.
  72. .TP
  73. .B -i
  74. Print the list of directories searched when
  75. .I #include
  76. is found.
  77. Last listed are searched first.
  78. .PD
  79. .PP
  80. In the absence of the
  81. .B -P
  82. option, the processed text output is sprinkled
  83. with lines that show the original input line numbering:
  84. .IP
  85. .B #line
  86. .I linenumber
  87. .L
  88. "\fIifile\fP"
  89. .PP
  90. The command reads the environment variable
  91. .IR include
  92. and adds its (blank-separated) list of directories to
  93. the standard search path for
  94. .CW #include
  95. directives. They are looked at before any directories specified with
  96. .BR -I ,
  97. which are looked at before the default directories.
  98. .PP
  99. The input language is as described in the ANSI C standard.
  100. The standard Plan 9 C compilers do not use
  101. .IR cpp ;
  102. they contain their own simple but adequate preprocessor, so
  103. .I cpp
  104. is usually superfluous.
  105. .SH FILES
  106. .TF /objtype/include
  107. .TP
  108. .B /sys/include
  109. directory for machine-independent include files
  110. .TP
  111. .B /$objtype/include
  112. directory for machine-dependent include files
  113. .SH SOURCE
  114. .B /sys/src/cmd/cpp
  115. .SH SEE ALSO
  116. .IR 2c (1)