Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $files = "";
- function listFolderFiles($dir)
- {
- global $files;
- $ffs = scandir($dir);
- unset($ffs[array_search('.', $ffs, true)]);
- unset($ffs[array_search('..', $ffs, true)]);
- if(count($ffs) < 1)
- return;
- foreach($ffs as $ff)
- {
- if(!is_dir($dir.'/'.$ff) && (endsWith($ff, ".h") || endsWith($ff, ".cpp"))) $files .= $dir . '/' . $ff . ' ';
- if(is_dir($dir.'/'.$ff)) listFolderFiles($dir.'/'.$ff);
- }
- }
- function endsWith($haystack, $needle)
- {
- $length = strlen($needle);
- if($length == 0) return true;
- return (substr($haystack, -$length) === $needle);
- }
- listFolderFiles('.');
- system("g++ " . $files . "-o Server -w -Wall -pedantic -lSOIL -lSDL2main -lSDL2 -lGL -lGLU -lSDL2_ttf -lSDL2_image -std=c++11 -lpthread -lcurl");
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement