You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
642 B
25 lines
642 B
7 years ago
|
#!/usr/bin/php
|
||
|
<?php
|
||
|
|
||
|
$t = file_get_contents('Makefile');
|
||
|
{
|
||
|
$t = str_replace("BINPATH = \r\n", "BINPATH = /usr/bin\r\n", $t);
|
||
|
|
||
|
$t = preg_replace_callback('/C_SOURCES =.*?\r\n\r\n/s', function($m) {
|
||
|
$x = trim($m[0]);
|
||
|
$lines = array_map('trim', explode('\\', $x));
|
||
|
$lines = array_slice($lines, 1);
|
||
|
$lines = array_unique($lines);
|
||
|
$t2 = "C_SOURCES = \\\r\n" . implode(" \\\r\n", $lines);
|
||
|
return $t2."\r\n\r\n";
|
||
|
}, $t);
|
||
|
}
|
||
|
file_put_contents('Makefile', $t);
|
||
|
|
||
|
|
||
|
$t = file_get_contents("Src/freertos.c");
|
||
|
{
|
||
|
$t = str_replace('__weak void', 'void __attribute__((weak))', $t);
|
||
|
}
|
||
|
file_put_contents("Src/freertos.c", $t);
|