Deleted Added
full compact
main.c (146140) main.c (146141)
1/*-
2 * Copyright (c) 1988, 1989, 1990, 1993
3 * The Regents of the University of California. All rights reserved.
4 * Copyright (c) 1989 by Berkeley Softworks
5 * All rights reserved.
6 *
7 * This code is derived from software contributed to Berkeley by
8 * Adam de Boor.

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

41#ifndef lint
42#if 0
43static char copyright[] =
44"@(#) Copyright (c) 1988, 1989, 1990, 1993\n\
45 The Regents of the University of California. All rights reserved.\n";
46#endif
47#endif /* not lint */
48#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1988, 1989, 1990, 1993
3 * The Regents of the University of California. All rights reserved.
4 * Copyright (c) 1989 by Berkeley Softworks
5 * All rights reserved.
6 *
7 * This code is derived from software contributed to Berkeley by
8 * Adam de Boor.

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

41#ifndef lint
42#if 0
43static char copyright[] =
44"@(#) Copyright (c) 1988, 1989, 1990, 1993\n\
45 The Regents of the University of California. All rights reserved.\n";
46#endif
47#endif /* not lint */
48#include <sys/cdefs.h>
49__FBSDID("$FreeBSD: head/usr.bin/make/main.c 146140 2005-05-12 14:16:44Z harti $");
49__FBSDID("$FreeBSD: head/usr.bin/make/main.c 146141 2005-05-12 14:31:42Z harti $");
50
51/*
52 * main.c
53 * The main file for this entire program. Exit routines etc
54 * reside here.
55 *
56 * Utility functions defined in this file:
57 * Main_ParseArgLine

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

983 }
984
985 /* Traverse the graph, checking on all the targets */
986 outOfDate = Make_Run(&targs);
987 }
988 Lst_Destroy(&targs, NOFREE);
989
990 } else {
50
51/*
52 * main.c
53 * The main file for this entire program. Exit routines etc
54 * reside here.
55 *
56 * Utility functions defined in this file:
57 * Main_ParseArgLine

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

983 }
984
985 /* Traverse the graph, checking on all the targets */
986 outOfDate = Make_Run(&targs);
987 }
988 Lst_Destroy(&targs, NOFREE);
989
990 } else {
991 /*
992 * Print the values of any variables requested by
993 * the user.
994 */
995 LstNode *n;
996 const char *name;
997 char *v;
998 char *value;
999
1000 LST_FOREACH(n, &variables) {
1001 name = Lst_Datum(n);
1002 if (expandVars) {
1003 v = emalloc(strlen(name) + 1 + 3);
1004 sprintf(v, "${%s}", name);
1005
1006 value = Buf_Peel(Var_Subst(v,
1007 VAR_GLOBAL, FALSE));
1008 printf("%s\n", value);
1009
1010 free(v);
1011 free(value);
1012 } else {
1013 value = Var_Value(name, VAR_GLOBAL, &v);
1014 printf("%s\n", value != NULL ? value : "");
1015 if (v != NULL)
1016 free(v);
1017 }
1018 }
991 Var_Print(&variables, expandVars);
1019 }
1020
1021 Lst_Destroy(&variables, free);
1022 Lst_Destroy(&makefiles, free);
1023 Lst_Destroy(&create, free);
1024
1025 /* print the graph now it's been processed if the user requested it */
1026 if (DEBUG(GRAPH2))

--- 114 unchanged lines hidden ---
992 }
993
994 Lst_Destroy(&variables, free);
995 Lst_Destroy(&makefiles, free);
996 Lst_Destroy(&create, free);
997
998 /* print the graph now it's been processed if the user requested it */
999 if (DEBUG(GRAPH2))

--- 114 unchanged lines hidden ---