diff --git a/Rules b/Rules index 28d7315..fb6b9bf 100644 --- a/Rules +++ b/Rules @@ -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 diff --git a/configure b/configure index 0860246..4a57047 100755 --- a/configure +++ b/configure @@ -23,6 +23,7 @@ sub path_translate { } my %labels = (); +my %srcs = (); my @types = ( "make" ); @@ -128,6 +129,7 @@ while($line = ){ $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 = ){ $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"); +