119
119
int eargc_base; /* How many arguments in the base of eargv. */
120
char** orig_argv = argv;
122
int can_use_ecc = 1; /* All files are .erl files. */
125
* XXX Currently, never use ecc.
129
122
emulator = getenv("ERLC_EMULATOR");
130
123
if (emulator == NULL) {
131
124
emulator = get_default_emulator(argv[0]);
136
#if defined(__WIN32__) || defined(VXWORKS)
137
can_use_ecc = 0; /* There is no ecc for Windows yet. */
141
128
* Allocate the argv vector to be used for arguments to Erlang.
142
129
* Arrange for starting to pushing information in the middle of
163
150
PUSH("-noinput");
151
PUSH2("-mode", "minimal");
152
PUSH2("-boot", "start_clean");
164
153
PUSH3("-s", "erl_compile", "compile_cmdline");
165
154
rpc_eargv = eargv+eargc;
262
if (strcmp(argv[1], "-rpc") != 0)
266
250
if (argv[1][2] == '\0') {
268
} else if (strcmp(argv[1], "-stop") == 0) {
270
* Not exiting here allows us to write:
271
* erlc -stop jam file.erl
272
* to restart the compiler node before compiling.
281
259
/** XXX Version perhaps, but of what? **/
283
261
case 'W': /* Enable warnings. */
262
if (strcmp(argv[1]+2, "all") == 0) {
263
PUSH2("@warn", "999");
264
} else if (isdigit((int)argv[1][2])) {
265
PUSH2("@warn", argv[1]+2);
336
320
while (argc > 1) {
338
if ((p = strrchr(argv[1], '.')) == NULL || strcmp(p, ".erl") != 0) {
346
* If all files were .erl files, we can use ecc.
350
orig_argv[0] = "ecc";
351
return run_erlang(orig_argv[0], orig_argv);
355
326
* Move up the commands for invoking the emulator and adjust eargv
544
515
{"-help", "shows this help text"},
545
516
{"-I path", "where to search for include files"},
546
517
{"-o name", "name output directory or file"},
547
{"-pa path", "add path to Erlang's code path"},
548
{"-rpc", "use a running Erlang node for compilation"},
549
{"-stop", "stop the compiler Erlang node (implies -rpc)"},
518
{"-pa path", "add path to the front of Erlang's code path"},
519
{"-pa path", "add path to the end of Erlang's code path"},
550
520
{"-v", "verbose compiler output"},
551
{"-W", "enable warnings"},
521
{"-W0", "disable warnings"},
522
{"-Wnumber", "set warning level to number"},
523
{"-Wall", "enable all warnings"},
524
{"-W", "enable warnings (default; same as -W1)"},
552
525
{"-E", "generate listing of expanded code (Erlang compiler)"},
553
526
{"-S", "generate assembly listing (Erlang compiler)"},
554
527
{"-P", "generate listing of preprocessed code (Erlang compiler)"},