1make2cook(1) General Commands Manual make2cook(1)
2
3
4
6 make2cook - translate makefiles into cookbooks
7
9 make2cook [ option... ][ infile [ outfile ]]
10 make2cook -Help
11 make2cook -VERSion
12
14 The make2cook program is used to translate Makefiles into cookbooks.
15 This command is provided to ease the transition to using the cook
16 command.
17
18 If no input file is named, or the special name ``-'' is used, input
19 will be taken from the standard input. If no output file is named, or
20 the special name ``-'' is used, output will be taken from the
21 standard output.
22
24 There is no one-to-one semantic mapping between make semantics and
25 cook semantics, so the results will probably need some manual editing.
26
27 The functionality provided by classic make [4m(1) implementations is
28 accurately reproduced. Extensions, such as those offered by GNU Make
29 or BSD make, are not always understood, or are sometimes not
30 reproduced identically.
31
32 The following subsections enumerate a few of the things which are
33 understood and not understood. They are probably not complete.
34
35 Understood
36 The cook program requires variables to be defined before they are
37 used, whereas make will default them to be empty. This is understood,
38 and empty definitions are inserted as required.
39
40 Most of the builtin variables of GNU Make are understood.
41
42 Most of the builtin rules of classic make, GNU Make and BSD make are
43 reproduced.
44
45 For best results there should be a blank line after every rule, so
46 that there can be no confusion where one rule ends and a new one
47 begins.
48
49 Builtin variables are defaulted from the environment, if an
50 environment variable of the same name is set.
51
52 The GNU Make override variable assignment is understood.
53
54 The GNU Make ``+='' assignment is understood.
55
56 The GNU Make ``:='' variable assignment is understood.
57
58 Traditional make assignments are macros, they are expanded on use,
59 rather than on assignment. The cook program has only variables.
60 Assignment statements are re-arranged to ensure the correct results
61 when variables are referenced.
62
63 Single and double suffix rules are understood. The .SUFFIXES rules
64 are understood and honoured. Hint: if you want to suppress the
65 builtin-recipes, use a .SUFFIXES rule with no dependencies.
66
67 The .PHONY rule is understood, and is translated into a set forced
68 flag in appropriate recipes, except files from implicit recipes.
69
70 The .PRECIOUS rule is understood, and is translated into a set
71 precious flag in the appropriate recipes, except files from implicit
72 recipes.
73
74 The .DEFAULT rule is understood, and is translated into an implicit
75 recipe.
76
77 The .IGNORE rule is understood, and is translated into a set errok
78 statement.
79
80 The .SILENT rule is understood, and is translated into a set silent
81 statement.
82
83 Most GNU Make functions are understood. The filter and filter-out
84 functions only understand a single pattern. The sort function does
85 not remove duplicates (wrap the stringset function around it if you
86 need this).
87
88 The GNU Make static pattern rules are understood. They are translated
89 into recipe predicates.
90
91 The GNU Make and BSD make include variants are understood.
92
93 The bizarre irregularities surrounding archive files in automatic
94 variables and suffix rules are understood, and translated into
95 consistent readable recipes. The make semantics are preserved.
96
97 The BSD make .CURDIR variable is understood, and translated to an
98 equivalent expression. It cannot be assigned to.
99
100 The GNU Make and BSD make conditionals are understood, provided that
101 they bracket whole segments of the makefile, and that these segments
102 are syntactically valid. Cconditionals may also appear within rule
103 body commands. Conditionals are not understood within the lines of a
104 define.
105
106 The GNU Make define is understood, but its use as a kind of ``function
107 definition'' is not understood.
108
109 The GNU Make export and unexport directives are understood.
110
111 Not Understood
112 The cook program tokenizes its input, whereas make does textual
113 replacement. The shennanigans required to construct a make macro
114 containing a single space are not understood. The translation will
115 result in a cook variable which is empty.
116
117 References to automatic variables within macro definitions will not
118 work.
119
120 The GNU Make foreach function is olny partially understood. This has
121 no exact cook equivalent.
122
123 The GNU Make origin function is not understood. This has no cook
124 equivalent.
125
126 The archive((member)) notation is not understood. These semantics are
127 not available from cook.
128
129 The MAKEFILES and MAKELEVEL variables are not translated, If you wish
130 to reproduce this functionality, you must edit the output.
131
132 The MAKEFLAGS and MFLAGS variables will be translated to use the Cook
133 options function, which has a different range of values.
134
135 Many variants of make can use builtin rules to make the Makefile if it
136 is absent. Cook is unable to cook the cookbook if it is absent.
137
138 Wildcards are not understood in rule targets, rule dependencies or
139 include directives. If you want these, you will have to edit the
140 output to use the [wildcard] function.
141
142 Home directory tildes (~) are not understood in targets and
143 dependencies. If you want this, you will have to edit the output to
144 use the [home] function.
145
146 The -lhome dependency is not understood to mean a library. If you
147 want this, you will have to edit the output to use the [collect
148 findlibs -lname] function.
149
150 The .EXPORT_ALL_VARIABLES rule is not understood. This has no cook
151 equivalent.
152
154 The following options are understood:
155
156 -Help
157 Provide some help with using the make2cook command.
158
159 -Environment
160 This option causes fragments to test for environment variables
161 when performing the default settings for variables. (This
162 corresponds to the make -e option.)
163
164 -History_Commands
165 This option causes make2cook to include recipes for RCS and
166 SCCS in the output.
167
168 -Line_Numbers
169 Insert line number directives into the output, so that it is
170 possible to tell where the lines came from. Most useful when
171 debugging. make2cook program.
172
173 -No_Internal_Rules
174 This option may be used to supress all generation of recipes
175 corresponding to make's internal rules. (This corresponds to
176 the make -r option.)
177
178 -VERSion
179 Print the version of the make2cook program being executed.
180
181 All other options will produce a diagnostic error.
182
183 All options may be abbreviated; the abbreviation is documented as the
184 upper case letters, all lower case letters and underscores (_) are
185 optional. You must use consecutive sequences of optional letters.
186
187 All options are case insensitive, you may type them in upper case or
188 lower case or a combination of both, case is not important.
189
190 For example: the arguments "-help", "-HEL" and "-h" are all
191 interpreted to mean the -Help option. The argument "-hlp" will not be
192 understood, because consecutive optional characters were not supplied.
193
194 Options and other command line arguments may be mixed arbitrarily on
195 the command line.
196
197 The GNU long option names are understood. Since all option names for
198 make2cook are long, this means ignoring the extra leading '-'. The
199 "--option=value" convention is also understood.
200
202 The make2cook command will exit with a status of 1 on any error. The
203 make2cook command will only exit with a status of 0 if there are no
204 errors.
205
207 make2cook version 2.30
208 Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996,
209 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Peter
210 Miller; All rights reserved.
211
212 The make2cook program comes with ABSOLUTELY NO WARRANTY; for details
213 use the 'make2cook -VERSion License' command. This is free software
214 and you are welcome to redistribute it under certain conditions; for
215 details use the 'make2cook -VERSion License' command.
216
218 Peter Miller E-Mail: millerp@canb.auug.org.au
219 /\/\* WWW: http://www.canb.auug.org.au/~millerp/
220
221
222
223Reference Manual Cook make2cook(1)