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 com‐
16 mand.
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 standard
21 output.
22
24 There is no one-to-one semantic mapping between make semantics and cook
25 semantics, so the results will probably need some manual editing.
26
27 The functionality provided by classic make [4m(1) implementations is accu‐
28 rately reproduced. Extensions, such as those offered by GNU Make or
29 BSD make, are not always understood, or are sometimes not reproduced
30 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 used,
37 whereas make will default them to be empty. This is understood, and
38 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 that
46 there can be no confusion where one rule ends and a new one begins.
47
48 Builtin variables are defaulted from the environment, if an environment
49 variable of the same name is set.
50
51 The GNU Make override variable assignment is understood.
52
53 The GNU Make ``+='' assignment is understood.
54
55 The GNU Make ``:='' variable assignment is understood.
56
57 Traditional make assignments are macros, they are expanded on use,
58 rather than on assignment. The cook program has only variables.
59 Assignment statements are re-arranged to ensure the correct results
60 when variables are referenced.
61
62 Single and double suffix rules are understood. The .SUFFIXES rules are
63 understood and honoured. Hint: if you want to suppress the builtin-
64 recipes, use a .SUFFIXES rule with no dependencies.
65
66 The .PHONY rule is understood, and is translated into a set forced flag
67 in appropriate recipes, except files from implicit recipes.
68
69 The .PRECIOUS rule is understood, and is translated into a set precious
70 flag in the appropriate recipes, except files from implicit recipes.
71
72 The .DEFAULT rule is understood, and is translated into an implicit
73 recipe.
74
75 The .IGNORE rule is understood, and is translated into a set errok
76 statement.
77
78 The .SILENT rule is understood, and is translated into a set silent
79 statement.
80
81 Most GNU Make functions are understood. The filter and filter-out
82 functions only understand a single pattern. The sort function does not
83 remove duplicates (wrap the stringset function around it if you need
84 this).
85
86 The GNU Make static pattern rules are understood. They are translated
87 into recipe predicates.
88
89 The GNU Make and BSD make include variants are understood.
90
91 The bizarre irregularities surrounding archive files in automatic vari‐
92 ables and suffix rules are understood, and translated into consistent
93 readable recipes. The make semantics are preserved.
94
95 The BSD make .CURDIR variable is understood, and translated to an
96 equivalent expression. It cannot be assigned to.
97
98 The GNU Make and BSD make conditionals are understood, provided that
99 they bracket whole segments of the makefile, and that these segments
100 are syntactically valid. Cconditionals may also appear within rule
101 body commands. Conditionals are not understood within the lines of a
102 define.
103
104 The GNU Make define is understood, but its use as a kind of ``function
105 definition'' is not understood.
106
107 The GNU Make export and unexport directives are understood.
108
109 Not Understood
110 The cook program tokenizes its input, whereas make does textual
111 replacement. The shennanigans required to construct a make macro con‐
112 taining a single space are not understood. The translation will result
113 in a cook variable which is empty.
114
115 References to automatic variables within macro definitions will not
116 work.
117
118 The GNU Make foreach function is olny partially understood. This has
119 no exact cook equivalent.
120
121 The GNU Make origin function is not understood. This has no cook
122 equivalent.
123
124 The archive((member)) notation is not understood. These semantics are
125 not available from cook.
126
127 The MAKEFILES and MAKELEVEL variables are not translated, If you wish
128 to reproduce this functionality, you must edit the output.
129
130 The MAKEFLAGS and MFLAGS variables will be translated to use the Cook
131 options function, which has a different range of values.
132
133 Many variants of make can use builtin rules to make the Makefile if it
134 is absent. Cook is unable to cook the cookbook if it is absent.
135
136 Wildcards are not understood in rule targets, rule dependencies or
137 include directives. If you want these, you will have to edit the out‐
138 put to use the [wildcard] function.
139
140 Home directory tildes (~) are not understood in targets and dependen‐
141 cies. If you want this, you will have to edit the output to use the
142 [home] function.
143
144 The -lhome dependency is not understood to mean a library. If you want
145 this, you will have to edit the output to use the [collect findlibs
146 -lname] function.
147
148 The .EXPORT_ALL_VARIABLES rule is not understood. This has no cook
149 equivalent.
150
152 The following options are understood:
153
154 -Help
155 Provide some help with using the make2cook command.
156
157 -Environment
158 This option causes fragments to test for environment variables
159 when performing the default settings for variables. (This cor‐
160 responds to the make -e option.)
161
162 -History_Commands
163 This option causes make2cook to include recipes for RCS and
164 SCCS in the output.
165
166 -Line_Numbers
167 Insert line number directives into the output, so that it is
168 possible to tell where the lines came from. Most useful when
169 debugging. make2cook program.
170
171 -No_Internal_Rules
172 This option may be used to supress all generation of recipes
173 corresponding to make's internal rules. (This corresponds to
174 the make -r option.)
175
176 -VERSion
177 Print the version of the make2cook program being executed.
178
179 All other options will produce a diagnostic error.
180
181
182
183Reference Manual Cook make2cook(1)