Fix another error related to whitespace handling in archives.
[make.git] / tests / scripts / features / archives
blob3fe46a0326d92b7c26444c3c078ca8ac3f31d416
1 #                                                              -*-mode: perl-*-
3 $description = "Test GNU make's archive management features.";
5 $details = "\
6 This only works on systems that support it.";
8 # If this instance of make doesn't support archives, skip it
9 exists $FEATURES{archives} or return -1;
11 # Create some .o files to work with
12 utouch(-60, qw(a1.o a2.o a3.o));
14 # Very simple
15 run_make_test('all: libxx.a(a1.o)',
16               '', "ar rv libxx.a a1.o\nar: creating libxx.a\na - a1.o\n");
18 # Multiple .o's.  Add a new one to the existing library
19 run_make_test('all: libxx.a(a1.o a2.o)',
20               '', "ar rv libxx.a a2.o\na - a2.o\n");
22 # Touch one of the .o's so it's rebuilt
23 utouch(-40, 'a1.o');
24 run_make_test(undef, '', "ar rv libxx.a a1.o\nr - a1.o\n");
26 # Use wildcards
27 run_make_test('all: libxx.a(*.o)',
28               '', "#MAKE#: Nothing to be done for `all'.\n");
30 # Touch one of the .o's so it's rebuilt
31 utouch(-30, 'a1.o');
32 run_make_test(undef, '', "ar rv libxx.a a1.o\nr - a1.o\n");
34 # Use both wildcards and simple names
35 utouch(-50, 'a2.o');
36 run_make_test('all: libxx.a(a3.o *.o)', '',
37               "ar rv libxx.a a3.o\na - a3.o\nar rv libxx.a a2.o\nr - a2.o\n");
39 # Check whitespace handling
40 utouch(-40, 'a2.o');
41 run_make_test('all: libxx.a(  a3.o    *.o     )', '',
42               "ar rv libxx.a a2.o\nr - a2.o\n");
44 rmfiles(qw(a1.o a2.o a3.o libxx.a));
46 # This tells the test driver that the perl test script executed properly.