Deleted Added
full compact
mkmakefile.c (133248) mkmakefile.c (134542)
1/*
2 * Copyright (c) 1993, 19801990
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 18 unchanged lines hidden (view full) ---

27 * SUCH DAMAGE.
28 */
29
30#ifndef lint
31#if 0
32static char sccsid[] = "@(#)mkmakefile.c 8.1 (Berkeley) 6/6/93";
33#endif
34static const char rcsid[] =
1/*
2 * Copyright (c) 1993, 19801990
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 18 unchanged lines hidden (view full) ---

27 * SUCH DAMAGE.
28 */
29
30#ifndef lint
31#if 0
32static char sccsid[] = "@(#)mkmakefile.c 8.1 (Berkeley) 6/6/93";
33#endif
34static const char rcsid[] =
35 "$FreeBSD: head/usr.sbin/config/mkmakefile.c 133248 2004-08-07 04:19:37Z imp $";
35 "$FreeBSD: head/usr.sbin/config/mkmakefile.c 134542 2004-08-30 23:03:58Z peter $";
36#endif /* not lint */
37
38/*
39 * Build the makefile for the system, from
40 * the information in the files files and the
41 * additional files for the machine being compiled to.
42 */
43

--- 249 unchanged lines hidden (view full) ---

293read_file(char *fname)
294{
295 FILE *fp;
296 struct file_list *tp, *pf;
297 struct device *dp;
298 struct opt *op;
299 char *wd, *this, *needs, *compilewith, *depends, *clean, *warning;
300 int nreqs, isdup, std, filetype,
36#endif /* not lint */
37
38/*
39 * Build the makefile for the system, from
40 * the information in the files files and the
41 * additional files for the machine being compiled to.
42 */
43

--- 249 unchanged lines hidden (view full) ---

293read_file(char *fname)
294{
295 FILE *fp;
296 struct file_list *tp, *pf;
297 struct device *dp;
298 struct opt *op;
299 char *wd, *this, *needs, *compilewith, *depends, *clean, *warning;
300 int nreqs, isdup, std, filetype,
301 imp_rule, no_obj, needcount, before_depend, mandatory, nowerror;
301 imp_rule, no_obj, before_depend, mandatory, nowerror;
302
303 fp = fopen(fname, "r");
304 if (fp == 0)
305 err(1, "%s", fname);
306next:
307 /*
302
303 fp = fopen(fname, "r");
304 if (fp == 0)
305 err(1, "%s", fname);
306next:
307 /*
308 * filename [ standard | mandatory | optional | count ]
308 * filename [ standard | mandatory | optional ]
309 * [ dev* | profiling-routine ] [ no-obj ]
310 * [ compile-with "compile rule" [no-implicit-rule] ]
311 * [ dependency "dependency-list"] [ before-depend ]
312 * [ clean "file-list"] [ warning "text warning" ]
313 */
314 wd = get_word(fp);
315 if (wd == (char *)EOF) {
316 (void) fclose(fp);

--- 23 unchanged lines hidden (view full) ---

340 compilewith = 0;
341 depends = 0;
342 clean = 0;
343 warning = 0;
344 needs = 0;
345 std = mandatory = 0;
346 imp_rule = 0;
347 no_obj = 0;
309 * [ dev* | profiling-routine ] [ no-obj ]
310 * [ compile-with "compile rule" [no-implicit-rule] ]
311 * [ dependency "dependency-list"] [ before-depend ]
312 * [ clean "file-list"] [ warning "text warning" ]
313 */
314 wd = get_word(fp);
315 if (wd == (char *)EOF) {
316 (void) fclose(fp);

--- 23 unchanged lines hidden (view full) ---

340 compilewith = 0;
341 depends = 0;
342 clean = 0;
343 warning = 0;
344 needs = 0;
345 std = mandatory = 0;
346 imp_rule = 0;
347 no_obj = 0;
348 needcount = 0;
349 before_depend = 0;
350 nowerror = 0;
351 filetype = NORMAL;
352 if (eq(wd, "standard")) {
353 std = 1;
354 /*
355 * If an entry is marked "mandatory", config will abort if it's
356 * not called by a configuration line in the config file. Apart
357 * from this, the device is handled like one marked "optional".
358 */
359 } else if (eq(wd, "mandatory")) {
360 mandatory = 1;
348 before_depend = 0;
349 nowerror = 0;
350 filetype = NORMAL;
351 if (eq(wd, "standard")) {
352 std = 1;
353 /*
354 * If an entry is marked "mandatory", config will abort if it's
355 * not called by a configuration line in the config file. Apart
356 * from this, the device is handled like one marked "optional".
357 */
358 } else if (eq(wd, "mandatory")) {
359 mandatory = 1;
361 } else if (eq(wd, "count")) {
362 needcount = 1;
363 } else if (!eq(wd, "optional")) {
360 } else if (!eq(wd, "optional")) {
364 printf("%s: %s must be count, optional, mandatory or standard\n",
361 printf("%s: %s must be optional, mandatory or standard\n",
365 fname, this);
366 exit(1);
367 }
368nextparam:
369 next_word(fp, wd);
370 if (wd == 0) {
371 if (isdup)
372 goto next;

--- 73 unchanged lines hidden (view full) ---

446 nowerror = 1;
447 goto nextparam;
448 }
449 if (needs == 0 && nreqs == 1)
450 needs = ns(wd);
451 if (isdup)
452 goto invis;
453 STAILQ_FOREACH(dp, &dtab, d_next)
362 fname, this);
363 exit(1);
364 }
365nextparam:
366 next_word(fp, wd);
367 if (wd == 0) {
368 if (isdup)
369 goto next;

--- 73 unchanged lines hidden (view full) ---

443 nowerror = 1;
444 goto nextparam;
445 }
446 if (needs == 0 && nreqs == 1)
447 needs = ns(wd);
448 if (isdup)
449 goto invis;
450 STAILQ_FOREACH(dp, &dtab, d_next)
454 if (eq(dp->d_name, wd)) {
455 if (std && dp->d_count <= 0)
456 dp->d_count = 1;
451 if (eq(dp->d_name, wd))
457 goto nextparam;
452 goto nextparam;
458 }
459 if (mandatory) {
460 printf("%s: mandatory device \"%s\" not found\n",
461 fname, wd);
462 exit(1);
463 }
464 if (std) {
465 printf("standard entry %s has a device keyword - %s!\n",
466 this, wd);

--- 11 unchanged lines hidden (view full) ---

478 while ((wd = get_word(fp)) != 0)
479 ;
480 if (tp == 0)
481 tp = new_fent();
482 tp->f_fn = this;
483 tp->f_type = INVISIBLE;
484 tp->f_needs = needs;
485 tp->f_flags |= isdup;
453 if (mandatory) {
454 printf("%s: mandatory device \"%s\" not found\n",
455 fname, wd);
456 exit(1);
457 }
458 if (std) {
459 printf("standard entry %s has a device keyword - %s!\n",
460 this, wd);

--- 11 unchanged lines hidden (view full) ---

472 while ((wd = get_word(fp)) != 0)
473 ;
474 if (tp == 0)
475 tp = new_fent();
476 tp->f_fn = this;
477 tp->f_type = INVISIBLE;
478 tp->f_needs = needs;
479 tp->f_flags |= isdup;
486 if (needcount)
487 tp->f_flags |= NEED_COUNT;
488 tp->f_compilewith = compilewith;
489 tp->f_depends = depends;
490 tp->f_clean = clean;
491 tp->f_warn = warning;
492 goto next;
493
494doneparam:
495 if (std == 0 && nreqs == 0) {

--- 15 unchanged lines hidden (view full) ---

511 tp->f_type = filetype;
512 tp->f_flags &= ~ISDUP;
513 if (imp_rule)
514 tp->f_flags |= NO_IMPLCT_RULE;
515 if (no_obj)
516 tp->f_flags |= NO_OBJ;
517 if (before_depend)
518 tp->f_flags |= BEFORE_DEPEND;
480 tp->f_compilewith = compilewith;
481 tp->f_depends = depends;
482 tp->f_clean = clean;
483 tp->f_warn = warning;
484 goto next;
485
486doneparam:
487 if (std == 0 && nreqs == 0) {

--- 15 unchanged lines hidden (view full) ---

503 tp->f_type = filetype;
504 tp->f_flags &= ~ISDUP;
505 if (imp_rule)
506 tp->f_flags |= NO_IMPLCT_RULE;
507 if (no_obj)
508 tp->f_flags |= NO_OBJ;
509 if (before_depend)
510 tp->f_flags |= BEFORE_DEPEND;
519 if (needcount)
520 tp->f_flags |= NEED_COUNT;
521 if (nowerror)
522 tp->f_flags |= NOWERROR;
523 tp->f_needs = needs;
524 tp->f_compilewith = compilewith;
525 tp->f_depends = depends;
526 tp->f_clean = clean;
527 tp->f_warn = warning;
528 if (pf && pf->f_type == INVISIBLE)

--- 262 unchanged lines hidden ---
511 if (nowerror)
512 tp->f_flags |= NOWERROR;
513 tp->f_needs = needs;
514 tp->f_compilewith = compilewith;
515 tp->f_depends = depends;
516 tp->f_clean = clean;
517 tp->f_warn = warning;
518 if (pf && pf->f_type == INVISIBLE)

--- 262 unchanged lines hidden ---