File: 2004_12_06_scancache.test

package info (click to toggle)
makepp 2.0.98.5-2.1
  • links: PTS
  • area: main
  • in suites: bookworm, bullseye
  • size: 2,744 kB
  • sloc: perl: 15,893; makefile: 38; javascript: 25; sh: 1
file content (55 lines) | stat: -rw-r--r-- 1,251 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
###	SPAR <http://www.cpan.org/scripts/>
###	1	644	1329052295	1329052295	is_relevant.pl
have_cc
###	24	755	1154546812	1342866673	makepp_test_script.pl
my $x = is_windows > 0 ? '.\\x' : './x';
makepp;
system $x or die 1;

# Make sure error status propagates if we need something that failed to build
# on behalf of cached scanner info earlier.
eval { makepp 'ERROR=1' } and die 2;

wait_timestamp 'x.o';
makepp;
system $x or die 3;

# Make sure that we can fail to build on behalf of cached scanner info, and
# still succeed if we didn't actually need the target that failed to build.
wait_timestamp 'x.o';
makepp 'ERROR=1', 'NOINC=1';
 system $x and die 4;

# Make sure we rescan (not just rebuild) if x.c changes.
c_sed 's/^$/#include "z.h"/', '-o+<x.c';

wait_timestamp 'x.o';
makepp 'ERROR=1', 'NOINC=1';
system $x or die 6;
###	21	644	1113579093	1102389344	Makeppfile
$(phony default): x

x.h:
ifdef ERROR
	perl { die }
else
	&echo '#undef X\n#define X 1' -o $@
endif

y.h:
ifdef NOINC
	&echo -o $@
else
	&echo '#include "x.h"' -o $@
endif

z.h:
	&echo '#undef X\n#define X 1' -o $@

x.o: x.c : smartscan
	$(CC) $(CFLAGS) $(CPPFLAGS) -c $(input) -o $(output)
###	4	644	1102389274	1102389240	x.c
#define X 0
#include "y.h"

int main() { return X; }