push to srcs

This commit is contained in:
Nishi 2025-04-05 18:18:04 +09:00
parent 5c91165781
commit 6d956c80b9
2 changed files with 14 additions and 7 deletions

11
Rules
View File

@ -82,8 +82,9 @@
SLINK stdc++
SLINK m
# --- Add source ---
COMPILE engine
COMPILE engine/OPENGL
XCOMPILE engine/OPENGL/GLX
WCOMPILE engine/OPENGL/WGL
GCOMPILE engine/OPENGL/GLFW
COMPILE engine engine
COMPILE engine/OPENGL engine
XCOMPILE engine/OPENGL/GLX engine
WCOMPILE engine/OPENGL/WGL engine
GCOMPILE engine/OPENGL/GLFW engine
STATIC libnishbox.a engine

10
configure vendored
View File

@ -23,6 +23,7 @@ sub path_translate {
}
my %labels = ();
my %srcs = ();
my @types = (
"make"
);
@ -128,6 +129,7 @@ while($line = <RULES>){
$command = $3;
$arg = $4;
}
my @args = split(/[\t ]+/, $arg);
while($label =~ /(.)/g){
if(!($1 eq " ")){
$run = $run && defined($labels{$1});
@ -229,10 +231,13 @@ while($line = <RULES>){
$LIBS = "$LIBS -l$arg";
}
}elsif($command eq "COMPILE"){
opendir(my $dh, $arg);
if(!defined($srcs{$args[1]})){
@{$srcs{$args[1]}} = ();
}
opendir(my $dh, $args[0]);
my @l = grep(/\.c$/, readdir($dh));
foreach(@l){
print("$_\n");
push(@{$srcs{$args[1]}}, $args[0] . "/" . $_);
}
closedir($dh);
}
@ -247,3 +252,4 @@ print(" CFLAGS: $CFLAGS\n");
print("LDFLAGS: $LDFLAGS\n");
print(" LIBS: $LIBS\n");
print("--------------------------------\n");