The Perl and Raku Conference 2025: Greenville, South Carolina - June 27-29 Learn more

### 3 775 1168790726 1210255905 is_relevant.pl
is_windows < 0 || is_windows == 1 ?
makepp( '-nfMakefile.relevant' ) : # Let makepp test if it uses a -l capable compiler.
!is_windows
### 5 644 1077141637 1186229250 Makefile.relevant
$(phony x):
iftrue $(filter %cl %cl.exe %bcc32 %bcc32.exe, $(CC))
perl { die }
endif
### 62 644 1160341077 1287952300 RootMakeppfile
#
# Test various things about the lexer, command parsers and C scanner:
# 1) Splitting command up into multiple lines;
# 2) Ignoring the echo with quoted string;
# 3) Handling -lxyz.
# 4) Whether a program is automatically recognized as an implicit dependency.
# 5) Whether register_input_suffix works
#
# Also tests the builtin rule picking up xyz dependencies for xyz.exe on Windows.
#
$(phony all):
.$/main
CPP := $(find-program cpp)
ifeq cpp, $(CPP)
register_input_suffix $(CPP) .vpp
%.v: %.vpp
$(CPP) $< > $@
all: b.v
c.v:
&touch c.v
perl { $two_more = 1 }
endif
perl {{
my $n_files = $two_more ? 8 : 6;
$n_files .= Mpp::is_windows ? ' 2' : ' 1';
open my $fh, '>answers/n_files' or die;
print $fh "$n_files 0\n";
}}
main: LDLIBS = -L. -lxyz
main: xyz1.o
%.o : %.c
@echo Compiling $(input)
echo dummy > /dev/null; $(CC) $(CFLAGS) -c $(input) -o $(output)
echo ' ; gcc a.c ' > /dev/null # Tests ignoring semicolon in quotes
libxyz.a : xyz.o
ifnsys Darwin
$(AR) rs $(output) $(inputs)
else
$(AR) r $(output) $(inputs)
ranlib $(output)
endif
#
# This target should be made:
#
xyz.h:
@&echo 'int xyz();' -o $(output)
#
# This target should not be made.
#
a.c :
&touch $@
### 1 644 1080322036 1080160284 b.vpp
#include "c.v"
### 9 644 1080322036 1210245158 main.c
#include "xyz.h"
int xyz1();
int
main()
{
return xyz();
}
### 4 644 1080322036 1080160259 xyz.c
int xyz()
{
return 0;
}
### 4 644 1080322036 1080160259 xyz1.c
int xyz1()
{
return 0;
}
### D 755 1080322113 1080161189 answers/