Skip to content
Snippets Groups Projects
Commit 7f40eb7e authored by Axel Hahn's avatar Axel Hahn
Browse files

update builder + installer

parent 526e4c8f
No related branches found
No related tags found
No related merge requests found
...@@ -27,14 +27,15 @@ _mkdir($dirPackages); ...@@ -27,14 +27,15 @@ _mkdir($dirPackages);
_h1("Check target file"); _h1("Check target file");
if(file_exists($OUTFILE)){ if(file_exists($OUTFILE)){
echo "INFO: output file '$OUTFILE' already exists.\n";
$ts_in=filemtime($INFILE); $ts_in=filemtime($INFILE);
$ts_out=filemtime($OUTFILE); $ts_out=filemtime($OUTFILE);
if($ts_in>$ts_out){ if($ts_in>$ts_out){
echo "INFO: Source file '$INFILE' is newer than '$OUTFILE'. Compiling changes...\n"; echo "INFO: Source file \"$INFILE\" is newer than \"$OUTFILE\". Compiling changes...\n";
} else { } else {
echo "INFO: Source is unchanged since last build..\n"; echo "🔹 INFO: Source is unchanged since last build... rebuilding it anyway.\n";
} }
} else {
echo "✅ INFO: Target \"$OUTFILE\" does not exist yet.\n";
} }
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
...@@ -56,8 +57,8 @@ _h1("Compile"); ...@@ -56,8 +57,8 @@ _h1("Compile");
_chdir("$selfdir/$dirBuild"); _chdir("$selfdir/$dirBuild");
_exec("$SPC \ _exec("$SPC \
micro:combine \ micro:combine \
'$TMPFILE' \ \"$TMPFILE\" \
-O '$OUTFILE'"); -O \"$OUTFILE\"");
// if(unlink($TMPFILE)){ // if(unlink($TMPFILE)){
// echo "Cleanup: $TMPFILE was deleted\n"; // echo "Cleanup: $TMPFILE was deleted\n";
...@@ -67,15 +68,15 @@ _exec("$SPC \ ...@@ -67,15 +68,15 @@ _exec("$SPC \
_h1("Test generated binary"); _h1("Test generated binary");
_exec("file '$OUTFILE'"); _exec("file \"$OUTFILE\"");
_exec("'$OUTFILE' --ini=../src/simple.ini"); _exec("\"$OUTFILE\" --ini=../src/simple.ini");
_h1("Write architecture specific binary"); _h1("Write architecture specific binary");
_exec("cp '$OUTFILE' '$OUTFILE2'"); _exec("cp \"$OUTFILE\" '$OUTFILE2'");
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
_h1("Done"); _h1("Done: Build was successful.");
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
...@@ -91,7 +91,7 @@ function _mkdir(string $sMyDir): void ...@@ -91,7 +91,7 @@ function _mkdir(string $sMyDir): void
_ok(); _ok();
echo "\n"; echo "\n";
} else { } else {
_skip("mkdir: already exists: '$sMyDir"); _skip("mkdir: already exists: '$sMyDir'");
} }
} }
...@@ -144,13 +144,13 @@ if(file_exists($doneBuild)){ ...@@ -144,13 +144,13 @@ if(file_exists($doneBuild)){
if ($bDoBild){ if ($bDoBild){
_exec("$SPC --no-interaction doctor"); _exec("$SPC --no-interaction doctor");
_exec("$SPC download --no-interaction --with-php=$php_version --for-extensions '$php_libs'"); _exec("$SPC download --no-interaction --with-php=$php_version --for-extensions \"$php_libs\"");
echo "💡 Hint: this can take 2 minutes ...\n"; echo "💡 Hint: this can take 2 minutes ...\n";
_exec("$SPC build --no-interaction --build-micro '$php_libs'"); _exec("$SPC build --no-interaction --build-micro \"$php_libs\"");
file_put_contents("$doneBuild", date("Y-m-d H:i:s") . "\n$sDoneData\n"); file_put_contents("$doneBuild", date("Y-m-d H:i:s") . "\n$sDoneData\n");
} else { } else {
_skip("Micro already built - php $php_version - extensions '$php_libs'"); _skip("Micro already built - php $php_version - extensions \"$php_libs\"");
} }
_h1("Done."); _h1("Done.");
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment