1 | /* Debugging macros and interface.
|
---|
2 | Copyright (C) 1999 Free Software Foundation, Inc.
|
---|
3 | This file is part of GNU Make.
|
---|
4 |
|
---|
5 | GNU Make is free software; you can redistribute it and/or modify
|
---|
6 | it under the terms of the GNU General Public License as published by
|
---|
7 | the Free Software Foundation; either version 2, or (at your option)
|
---|
8 | any later version.
|
---|
9 |
|
---|
10 | GNU Make is distributed in the hope that it will be useful,
|
---|
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
13 | GNU General Public License for more details.
|
---|
14 |
|
---|
15 | You should have received a copy of the GNU General Public License
|
---|
16 | along with GNU Make; see the file COPYING. If not, write to
|
---|
17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
---|
18 | Boston, MA 02111-1307, USA. */
|
---|
19 |
|
---|
20 |
|
---|
21 | #define DB_NONE (0x000)
|
---|
22 | #define DB_BASIC (0x001)
|
---|
23 | #define DB_VERBOSE (0x002)
|
---|
24 | #define DB_JOBS (0x004)
|
---|
25 | #define DB_IMPLICIT (0x008)
|
---|
26 | #define DB_MAKEFILES (0x100)
|
---|
27 | #define DB_KMK (0x800)
|
---|
28 |
|
---|
29 | #define DB_ALL (0xfff)
|
---|
30 |
|
---|
31 | extern int db_level;
|
---|
32 |
|
---|
33 | extern unsigned int makelevel;
|
---|
34 | extern unsigned int job_slots;
|
---|
35 | extern unsigned int job_slots_used;
|
---|
36 |
|
---|
37 |
|
---|
38 | #define DB_HDR() do { printf ("[%u:%u/%u]", makelevel, job_slots_used, job_slots); } while (0)
|
---|
39 |
|
---|
40 | #define ISDB(_l) ((_l)&db_level)
|
---|
41 |
|
---|
42 | #define DBS(_l,_x) do{ if(ISDB(_l)) {DB_HDR(); \
|
---|
43 | print_spaces (depth); \
|
---|
44 | printf _x; fflush (stdout);} }while(0)
|
---|
45 |
|
---|
46 | #define DBF(_l,_x) do{ if(ISDB(_l)) {DB_HDR(); \
|
---|
47 | print_spaces (depth); \
|
---|
48 | printf (_x, file->name); \
|
---|
49 | fflush (stdout);} }while(0)
|
---|
50 |
|
---|
51 | #define DB(_l,_x) do{ if(ISDB(_l)) {DB_HDR(); printf _x; fflush (stdout);} }while(0)
|
---|