Print this page




 554          */
 555         while (--argc > 0) {
 556                 char *arg;
 557                 int arglen;
 558 
 559                 arg = *++argv;
 560                 arglen = strlen(arg);
 561 
 562                 if (*arg != '-') {
 563                         char *filename;
 564 
 565                         /*
 566                          * filenames ending in '.s' are taken to be
 567                          * assembler files, and provide the default
 568                          * basename of the output file.
 569                          *
 570                          * other files are passed through to the
 571                          * preprocessor, if present, or to gas if not.
 572                          */
 573                         filename = arg;
 574                         if (arglen > 2 &&
 575                             (strcmp(arg + arglen - 2, ".s") == 0) ||
 576                             (strcmp(arg + arglen - 2, ".S") == 0)) {
 577                                 /*
 578                                  * Though 'as' allows multiple assembler
 579                                  * files to be processed in one invocation
 580                                  * of the assembler, ON only processes one
 581                                  * file at a time, which makes things a lot
 582                                  * simpler!
 583                                  */
 584                                 if (srcfile == NULL)
 585                                         srcfile = arg;
 586                                 else
 587                                         return (usage(
 588                                             "one assembler file at a time"));
 589 
 590                                 /*
 591                                  * If we haven't seen a -o option yet,
 592                                  * default the output to the basename
 593                                  * of the input, substituting a .o on the end
 594                                  */
 595                                 if (outfile == NULL) {
 596                                         char *argcopy;




 554          */
 555         while (--argc > 0) {
 556                 char *arg;
 557                 int arglen;
 558 
 559                 arg = *++argv;
 560                 arglen = strlen(arg);
 561 
 562                 if (*arg != '-') {
 563                         char *filename;
 564 
 565                         /*
 566                          * filenames ending in '.s' are taken to be
 567                          * assembler files, and provide the default
 568                          * basename of the output file.
 569                          *
 570                          * other files are passed through to the
 571                          * preprocessor, if present, or to gas if not.
 572                          */
 573                         filename = arg;
 574                         if ((arglen > 2) &&
 575                             ((strcmp(arg + arglen - 2, ".s") == 0) ||
 576                             (strcmp(arg + arglen - 2, ".S") == 0))) {
 577                                 /*
 578                                  * Though 'as' allows multiple assembler
 579                                  * files to be processed in one invocation
 580                                  * of the assembler, ON only processes one
 581                                  * file at a time, which makes things a lot
 582                                  * simpler!
 583                                  */
 584                                 if (srcfile == NULL)
 585                                         srcfile = arg;
 586                                 else
 587                                         return (usage(
 588                                             "one assembler file at a time"));
 589 
 590                                 /*
 591                                  * If we haven't seen a -o option yet,
 592                                  * default the output to the basename
 593                                  * of the input, substituting a .o on the end
 594                                  */
 595                                 if (outfile == NULL) {
 596                                         char *argcopy;