1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335
|
'\" t
.\" cook - file construction tool
.\" Copyright (C) 1994, 1997 Peter Miller;
.\" All rights reserved.
.\"
.\" This program is free software; you can redistribute it and/or modify
.\" it under the terms of the GNU General Public License as published by
.\" the Free Software Foundation; either version 2 of the License, or
.\" (at your option) any later version.
.\"
.\" This program is distributed in the hope that it will be useful,
.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
.\" GNU General Public License for more details.
.\"
.\" You should have received a copy of the GNU General Public License
.\" along with this program; if not, write to the Free Software
.\" Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
.\"
.\" MANIFEST: manual entry for the make2cook command
.\"
.TH make2cook 1 Cook "Reference Manual"
.so z_name.so
.ds n) make2cook
.SH NAME
\*(n) \- translate makefiles into cookbooks
.XX "make2cook(1)" "translate makefiles into cookbooks"
.SH SYNOPSIS
.B \*(n)
[
.IR option \&...
][
.I infile
[
.I outfile
]]
.br
.B \*(n)
.B -Help
.br
.B \*(n)
.B -VERSion
.SH DESCRIPTION
The
.I \*(n)
program is used to
translate
.IR Makefile s
into cookbooks.
This command is provided to ease the transition to using the
.I cook
command.
.PP
If no input file is named,
or the special name ``-'' is used,
input will be taken from the standard input.
If no output file is named,
or the special name ``-'' is used,
output will be taken from the standard output.
.SH SEMANTICS
There is no one-to-one semantic mapping between
.I make
semantics
and
.I cook
semantics,
so the results will probably need some manual editing.
.PP
The functionality provided by classic
.I make (1)
implementations is accurately reproduced.
Extensions,
such as those offered by GNU Make or BSD make,
are not always understood,
or are sometimes not reproduced identically.
.PP
The following subsections enumerate a few of the things
which are understood and not understood.
They are probably not complete.
.SS Understood
The
.I cook
program requires variables to be defined before they are used,
whereas
.I make
will default them to be empty.
This is understood,
and empty definitions are inserted as required.
.PP
Most of the builtin variables of GNU Make are understood.
.PP
Most of the builtin rules of classic make, GNU Make and BSD make are
reproduced.
.PP
.B "For best results"
there should be a blank line after every rule, so that there can be no
confusion where one rule ends and a new one begins.
.PP
Builtin variables are defaulted from the environment,
if an environment variable of the same name is set.
.PP
The GNU Make
.I override
variable assignment is understood.
.PP
The GNU Make
``+='' assignment is understood.
.PP
The GNU Make
``:='' variable assignment is understood.
.PP
Traditional make assignments are macros,
they are expanded on use,
rather than on assignment.
The
.I cook
program has only variables.
Assignment statements are re-arranged to ensure the correct results
when variables are referenced.
.PP
Single and double suffix rules are understood.
The .SUFFIXES rules are understood and honoured.
Hint: if you want to suppress the builtin-recipes,
use a .SUFFIXES rule with no dependencies.
.PP
The .PHONY rule is understood, and is translated into a
.I "set forced"
flag in appropriate recipes,
except files from implicit recipes.
.PP
The .PRECIOUS rule is understood, and is translated into a
.I "set precious"
flag in the appropriate recipes,
except files from implicit recipes.
.PP
The .DEFAULT rule is understood,
and is translated into an implicit recipe.
.PP
The .IGNORE rule is understood, and is translated into a
.I "set errok"
statement.
.PP
The .SILENT rule is understood, and is translated into a
.I "set silent"
statement.
.PP
Most GNU Make functions are understood.
The
.I filter
and
.I filter-out
functions only understand a single pattern.
The
.I sort
function does not remove duplicates (wrap the
.I stringset
function around it if you need this).
.PP
The GNU Make
static pattern rules
are understood.
They are translated into recipe predicates.
.PP
The GNU Make and BSD make
.I include
variants are understood.
.PP
The bizarre irregularities surrounding archive files in automatic
variables and suffix rules are understood, and translated into
consistent readable recipes.
The
.I make
semantics are preserved.
.PP
The BSD make
.I \&.CURDIR
variable is understood,
and translated to an equivalent expression.
It cannot be assigned to.
.PP
The GNU Make and BSD make conditionals are understood,
provided that they bracket whole segments of the makefile,
and that these segments are syntactically valid.
Cconditionals may also appear within rule body commands.
Conditionals are
.I not
understood within the lines of a
.IR define .
.PP
The GNU Make
.I define
is understood, but its use as a kind of ``function definition'' is
.I not
understood.
.PP
The GNU Make
.I export
and
.I unexport
directives are understood.
.SS Not Understood
The
.I cook
program tokenizes its input,
whereas make does textual replacement.
The shennanigans required to construct
a make macro containing
a single space
are not understood.
The translation will result in a
.I cook
variable which is empty.
.PP
References to automatic variables within macro definitions
will not work.
.PP
The
GNU Make
.I foreach
function is olny partially understood.
This has no exact
.I cook
equivalent.
.PP
The GNU Make
.I origin
function is not understood.
This has no
.I cook
equivalent.
.PP
The
.IR archive (( member ))
notation is not understood.
These semantics are not available from
.IR cook .
.PP
The
.I MAKEFILES
and
.I MAKELEVEL
variables are not translated,
If you wish to reproduce this functionality,
you must edit the output.
.PP
The
.I MAKEFLAGS
and
.I MFLAGS
variables will be translated to use the Cook
.I options
function,
which has a different range of values.
.PP
Many variants of make can use builtin rules
to make the Makefile if it is absent.
.I Cook
is unable to cook the cookbook if it is absent.
.PP
Wildcards are not understood in rule targets, rule dependencies
or include directives.
If you want these,
you will have to edit the output to use the
.I "[wildcard]"
function.
.PP
Home directory tildes (~) are not understood in targets and
dependencies.
If you want this, you will have to edit the output to use the
.I "[home]"
function.
.PP
The \f(CW-l\fP\f(CIhome\fP dependency is not understood to mean a
library.
If you want this, you will have to edit the output to use the
.IR "[collect findlibs -l" name "]"
function.
.PP
The
.I \&.EXPORT_ALL_VARIABLES
rule is not understood.
This has no
.I cook
equivalent.
.br
.ne 1i
.SH OPTIONS
The following options are understood:
.TP 8n
.B -Help
.br
Provide some help with using the
.I make2cook
command.
.TP 8n
.B -Environment
.br
This option causes fragments to test for environment variables
when performing the default settings for variables.
(This corresponds to the make -e option.)
.TP 8n
.B -History_Commands
.br
This option causes
.I make2cook
to include recipes for
.I RCS
and
.I SCCS
in the output.
.TP 8n
.B -Line_Numbers
.br
Insert line number directives into the output,
so that it is possible to tell where the lines came from.
Most useful when debugging.
.I \*(n)
program.
.TP 8n
.B -No_Internal_Rules
.br
This option may be used to supress all generation of recipes
corresponding to make's internal rules.
(This corresponds to the make -r option.)
.TP 8n
.B -VERSion
.br
Print the version of the
.I \*(n)
program being executed.
.PP
All other options will produce a diagnostic error.
.so o__rules.so
.so z_exit.so
.so copyright.so
|