| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
#include "../src/config.h" |
| 21 |
#include "../src/types.h" |
| 22 |
#include "../src/file_basic.h" |
| 23 |
#include "../src/profile.h" |
| 24 |
#include "../src/dep.h" |
| 25 |
|
| 26 |
#define TS_RES (1000) |
| 27 |
#define TS_INC (5 * TS_RES) |
| 28 |
static FILE_TIMESTAMP fake_clock = 0; |
| 29 |
|
| 30 |
void |
| 31 |
die (int status) |
| 32 |
{ |
| 33 |
exit (status); |
| 34 |
} |
| 35 |
|
| 36 |
FILE_TIMESTAMP |
| 37 |
file_timestamp_now (int *resolution) { |
| 38 |
*resolution = TS_RES; |
| 39 |
|
| 40 |
fake_clock += TS_INC; |
| 41 |
return fake_clock; |
| 42 |
} |
| 43 |
|
| 44 |
int main(int argc, const char * const* argv) { |
| 45 |
bool rc = profile_init(PACKAGE_TARNAME " " PACKAGE_VERSION, argv, 0); |
| 46 |
(void)argc; |
| 47 |
init_hash_files(); |
| 48 |
|
| 49 |
if (rc) { |
| 50 |
file_t *target = enter_file("Makefile"); |
| 51 |
file_t *target2, *target3; |
| 52 |
goaldep_t *goals = alloc_goaldep(); |
| 53 |
|
| 54 |
target->floc.filenm = "Makefile"; |
| 55 |
goals->file = target; |
| 56 |
|
| 57 |
target2 = enter_file("all"); |
| 58 |
target2->floc.filenm = "Makefile"; |
| 59 |
target2->floc.lineno = 5; |
| 60 |
target2->elapsed_time = 500; |
| 61 |
profile_add_dependency(target2, NULL); |
| 62 |
|
| 63 |
target3 = enter_file("all-recursive"); |
| 64 |
target3->floc.filenm = "Makefile"; |
| 65 |
target3->floc.lineno = 5; |
| 66 |
target3->elapsed_time = 1000; |
| 67 |
profile_add_dependency(target3, target2); |
| 68 |
|
| 69 |
profile_close("Program termination", goals, 0); |
| 70 |
} |
| 71 |
|
| 72 |
if (rc == true) { |
| 73 |
return 0; |
| 74 |
} else { |
| 75 |
return 1; |
| 76 |
} |
| 77 |
} |