4
* Copyright Ericsson AB 1997-2009. All Rights Reserved.
4
* Copyright Ericsson AB 1997-2011. All Rights Reserved.
6
6
* The contents of this file are subject to the Erlang Public License,
7
7
* Version 1.1, (the "License"); you may not use this file except in
8
8
* compliance with the License. You should have received a copy of the
9
9
* Erlang Public License along with this software. If not, it can be
10
10
* retrieved online at http://www.erlang.org/.
12
12
* Software distributed under the License is distributed on an "AS IS"
13
13
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14
14
* the License for the specific language governing rights and limitations
15
15
* under the License.
263
262
PUSH2("@i", process_opt(&argc, &argv, 0));
266
char *buf, *key, *val;
269
if (argv[1][2] == '\0') { /* -M */
270
/* Push the following options:
272
* o {makedep_output, standard_io}
274
buf = strsave("makedep");
275
PUSH2("@option", buf);
277
key = "makedep_output";
279
buf_len = 1 + strlen(key) + 1 + strlen(val) + 1 + 1;
280
buf = emalloc(buf_len);
281
snprintf(buf, buf_len, "{%s,%s}", key, val);
282
PUSH2("@option", buf);
283
} else if (argv[1][3] == '\0') {
286
/* Push the following options:
289
buf = strsave("makedep");
290
PUSH2("@option", buf);
292
case 'F': /* -MF <file> */
293
/* Push the following options:
295
* o {makedep_output, <file>}
297
buf = strsave("makedep");
298
PUSH2("@option", buf);
300
key = "makedep_output";
301
val = process_opt(&argc, &argv, 1);
302
buf_len = 1 + strlen(key) + 2 + strlen(val) + 2 + 1;
303
buf = emalloc(buf_len);
304
snprintf(buf, buf_len, "{%s,\"%s\"}", key, val);
305
PUSH2("@option", buf);
307
case 'T': /* -MT <target> */
308
/* Push the following options:
309
* o {makedep_target, <target>}
311
key = "makedep_target";
312
val = process_opt(&argc, &argv, 1);
313
buf_len = 1 + strlen(key) + 2 + strlen(val) + 2 + 1;
314
buf = emalloc(buf_len);
315
snprintf(buf, buf_len, "{%s,\"%s\"}", key, val);
316
PUSH2("@option", buf);
318
case 'Q': /* -MQ <target> */
319
/* Push the following options:
320
* o {makedep_target, <target>}
321
* o makedep_quote_target
323
key = "makedep_target";
324
val = process_opt(&argc, &argv, 1);
325
buf_len = 1 + strlen(key) + 2 + strlen(val) + 2 + 1;
326
buf = emalloc(buf_len);
327
snprintf(buf, buf_len, "{%s,\"%s\"}", key, val);
328
PUSH2("@option", buf);
330
buf = strsave("makedep_quote_target");
331
PUSH2("@option", buf);
334
/* Push the following options:
335
* o makedep_add_missing
337
buf = strsave("makedep_add_missing");
338
PUSH2("@option", buf);
341
/* Push the following options:
344
buf = strsave("makedep_add_missing");
345
PUSH2("@option", buf);
266
354
PUSH2("@outdir", process_opt(&argc, &argv, 0));
310
398
case 'W': /* Enable warnings. */
311
399
if (strcmp(argv[1]+2, "all") == 0) {
312
400
PUSH2("@warn", "999");
401
} else if (strcmp(argv[1]+2, "error") == 0) {
402
PUSH2("@option", "warnings_as_errors");
313
403
} else if (isdigit((int)argv[1][2])) {
314
404
PUSH2("@warn", argv[1]+2);
561
651
{"-hybrid", "compile using hybrid-heap emulator"},
562
652
{"-help", "shows this help text"},
563
653
{"-I path", "where to search for include files"},
654
{"-M", "generate a rule for make(1) describing the dependencies"},
655
{"-MF file", "write the dependencies to 'file'"},
656
{"-MT target", "change the target of the rule emitted by dependency "
658
{"-MQ target", "same as -MT but quote characters special to make(1)"},
659
{"-MG", "consider missing headers as generated files and add them to "
661
{"-MP", "add a phony target for each dependency"},
662
{"-MD", "same as -M -MT file (with default 'file')"},
564
663
{"-o name", "name output directory or file"},
565
664
{"-pa path", "add path to the front of Erlang's code path"},
566
665
{"-pz path", "add path to the end of Erlang's code path"},
567
666
{"-smp", "compile using SMP emulator"},
568
667
{"-v", "verbose compiler output"},
668
{"-Werror", "make all warnings into errors"},
569
669
{"-W0", "disable warnings"},
570
670
{"-Wnumber", "set warning level to number"},
571
671
{"-Wall", "enable all warnings"},