@@ -1013,16 +1013,23 @@ otadata, data, ota, , ${OTADATA_SIZE},`;
10131013 generateDependencyRules ( tool ) {
10141014 }
10151015 generateResourcesRules ( tool ) {
1016- var formatPath = "$(TMP_DIR)" + tool . slash + "mc.format.h" ;
1017- var rotationPath = "$(TMP_DIR)" + tool . slash + "mc.rotation.h" ;
1016+ var formatPath ;
1017+ var rotationPath ;
1018+
1019+ if ( tool . platform == "zephyr" ) {
1020+ formatPath = "${TMP_DIR}" + tool . slash + "mc.format.h" ; // cmake needs {var} not (var)
1021+ rotationPath = "${TMP_DIR}" + tool . slash + "mc.rotation.h" ;
1022+ }
1023+ else {
1024+ formatPath = "$(TMP_DIR)" + tool . slash + "mc.format.h" ;
1025+ rotationPath = "$(TMP_DIR)" + tool . slash + "mc.rotation.h" ;
1026+ }
10181027
10191028 for ( var result of tool . resourcesFiles ) {
10201029 var source = result . source ;
10211030 var target = result . target ;
10221031 if ( tool . platform == "zephyr" ) {
10231032 var output = "${RESOURCES_DIR}" + tool . slash + target ;
1024- formatPath = "${TMP_DIR}" + tool . slash + "mc.format.h" ; // cmake needs {var} not (var)
1025- rotationPath = "${TMP_DIR}" + tool . slash + "mc.rotation.h" ;
10261033 //@@
10271034 this . line ( "add_custom_command(" ) ;
10281035 this . line ( "\tOUTPUT " + output ) ;
@@ -1063,8 +1070,9 @@ otadata, data, ota, , ${OTADATA_SIZE},`;
10631070 this . line ( "add_custom_command (" ) ;
10641071 this . line ( "\tOUTPUT ${RESOURCES_DIR}" , tool . slash , target ) ;
10651072 this . line ( "\tDEPENDS " , source ) ;
1066- this . line ( "\tCOMMAND " , tool , "buildclut " , source , " -o ${RESOURCES_DIR}" ) ;
1067- this . line ( ")" ) ;
1073+ this . line ( "\tCOMMAND buildclut " , source , " -o ${RESOURCES_DIR}" ) ;
1074+ this . line ( "\tVERBATIM)" ) ;
1075+ this . line ( ) ;
10681076 }
10691077 else {
10701078 this . line ( "$(RESOURCES_DIR)" , tool . slash , target , ": " , source ) ;
@@ -1077,14 +1085,7 @@ otadata, data, ota, , ${OTADATA_SIZE},`;
10771085 for ( var result of tool . bmpAlphaFiles ) {
10781086 var target = result . target ;
10791087 if ( tool . platform == "zephyr" ) {
1080- if ( result . colorFile ) {
1081- // this.line("add_custom_target (");
1082- // this.line("\tOUTPUT $(RESOURCES_DIR)" + tool.slash + target);
1083- // this.line("\tDEPENDS $(RESOURCES_DIR)" + tool.slash + result.colorFile.target);
1084- // this.line(")");
1085- // this.line();
1086- }
1087- else {
1088+ if ( ! result . colorFile ) {
10881089 var parts = tool . splitPath ( target ) ;
10891090 var source = result . source ;
10901091 var sources = result . sources ;
@@ -1096,14 +1097,14 @@ otadata, data, ota, , ${OTADATA_SIZE},`;
10961097 manifest = " $(MANIFEST)" ;
10971098 }
10981099 this . line ( "add_custom_command (" ) ;
1100+ this . line ( "\tOUTPUT ${RESOURCES_DIR}" + tool . slash + target ) ;
10991101 this . line ( "\tDEPENDS " , source , " " , rotationPath , manifest ) ;
1100- this . echo ( tool , "png2bmp " , target ) ;
11011102 this . write ( "\tCOMMAND png2bmp " , this . write ( source ) , " -a" ) ;
11021103 if ( result . monochrome )
11031104 this . write ( " -m -4" ) ;
11041105 this . write ( " -o ${RESOURCES_DIR} -r " ) ;
1105- this . write ( tool . rotation ) ;
1106- this . line ( ")" ) ;
1106+ this . line ( tool . rotation ) ;
1107+ this . line ( "\tVERBATIM )" ) ;
11071108 this . line ( "" ) ;
11081109 }
11091110 }
@@ -1162,17 +1163,9 @@ otadata, data, ota, , ${OTADATA_SIZE},`;
11621163 this . write ( " " ) ;
11631164 this . write ( clutSource ) ;
11641165 }
1165- // if (alphaTarget)
1166- // this.write(" $(RESOURCES_DIR)" + tool.slash + alphaTarget);
1167- this . write ( " " ) ;
1168- this . write ( formatPath ) ;
1169- this . write ( " " ) ;
1170- this . write ( rotationPath ) ;
1171- this . line ( manifest ) ;
1166+ this . line ( " " + formatPath + " " + rotationPath + manifest ) ;
11721167
1173- this . write ( "\tCOMMAND png2bmp " ) ;
1174-
1175- this . write ( source ) ;
1168+ this . write ( "\tCOMMAND png2bmp " + source ) ;
11761169 if ( ! alphaTarget )
11771170 this . write ( " -c" ) ;
11781171 if ( result . monochrome )
@@ -1191,8 +1184,7 @@ otadata, data, ota, , ${OTADATA_SIZE},`;
11911184 this . write ( " -o ${RESOURCES_DIR} -r " ) ;
11921185 this . write ( tool . rotation ) ;
11931186 this . line ( name ) ;
1194- this . line ( "\tVERBATIM" ) ;
1195- this . line ( ")" ) ;
1187+ this . line ( "\tVERBATIM)" ) ;
11961188 this . line ( "" ) ;
11971189 }
11981190 else {
@@ -1256,11 +1248,26 @@ otadata, data, ota, , ${OTADATA_SIZE},`;
12561248 var target = result . target ;
12571249 parts = tool . splitPath ( target ) ;
12581250 var bmpTarget = parts . name + "-alpha.bmp" ;
1259- var bmpSource = "$(RESOURCES_DIR)" + tool . slash + bmpTarget ;
1260- if ( this . zephyr ) {
1261- trace ( "bmpFontFiles" ) ;
1251+ if ( tool . platform == "zephyr" ) {
1252+ var bmpSource = "${RESOURCES_DIR}" + tool . slash + bmpTarget ;
1253+ // this.echo(tool, "compressbmf ", target);
1254+ this . line ( "add_custom_command(" ) ;
1255+ this . line ( "\tOUTPUT ${RESOURCES_DIR}" , tool . slash , target ) ;
1256+ this . line ( "\tDEPENDS " , source , " " , bmpSource , " " , rotationPath ) ;
1257+ this . line ( "\tCOMMAND compressbmf " , source , " -i " , bmpSource , " -o ${RESOURCES_DIR} -r " , tool . rotation ) ;
1258+ this . line ( "\tVERBATIM)" )
1259+ this . line ( ) ;
1260+ // this.echo(tool, "png2bmp ", bmpTarget);
1261+
1262+ this . line ( "add_custom_command(" ) ;
1263+ this . line ( "\tOUTPUT ${RESOURCES_DIR}" , tool . slash , bmpSource ) ;
1264+ this . line ( "\tDEPENDS " , pngSource , " " , rotationPath ) ;
1265+ this . line ( "\tCOMMAND png2bmp " , pngSource , " -a -o ${RESOURCES_DIR} -r " , tool . rotation , " -t" ) ;
1266+ this . line ( "\tVERBATIM)" ) ;
1267+ this . line ( ) ;
12621268 }
12631269 else {
1270+ var bmpSource = "$(RESOURCES_DIR)" + tool . slash + bmpTarget ;
12641271 this . line ( "$(RESOURCES_DIR)" , tool . slash , target , ": " , source , " " , bmpSource , " " , rotationPath ) ;
12651272 this . echo ( tool , "compressbmf " , target ) ;
12661273 this . line ( "\tcompressbmf " , source , " -i " , bmpSource , " -o $(@D) -r " , tool . rotation ) ;
@@ -1276,8 +1283,29 @@ otadata, data, ota, , ${OTADATA_SIZE},`;
12761283 var source = result . source ;
12771284 var bmpTarget = parts . name + ".bmp" ;
12781285 var bmpSource = "$(RESOURCES_DIR)" + tool . slash + bmpTarget ;
1279- if ( this . zephyr ) {
1280- trace ( "bmpMaskFiles" ) ;
1286+ if ( tool . platform == "zephyr" ) {
1287+ this . line ( "add_custom_command(" ) ;
1288+ this . line ( "\tOUTPUT ${RESOURCES_DIR}" , tool . slash , target ) ;
1289+ this . line ( "\tDEPENDS " , bmpSource ) ;
1290+ // this.echo(tool, "rle4encode ", target);
1291+ this . line ( "\tCOMMAND rle4encode " , bmpSource , " -o ${RESOURCES_DIR}" ) ;
1292+ var sources = result . sources ;
1293+ var manifest = "" ;
1294+ var name = " -n " + parts . name . slice ( 0 , - 6 ) ;
1295+ if ( sources ) {
1296+ for ( var path of sources )
1297+ source += " " + path ;
1298+ manifest = " $(MANIFEST)" ;
1299+ }
1300+ this . line ( "\tVERBATIM)" ) ;
1301+ this . line ( ) ;
1302+ this . line ( "add_custom_command(" ) ;
1303+ this . line ( "\tOUTPUT " , bmpSource ) ;
1304+ this . line ( "\tDEPENDS " , source , " " , rotationPath , manifest ) ;
1305+ // this.echo(tool, "png2bmp ", bmpTarget);
1306+ this . line ( "\tCOMMAND png2bmp " , source , " -a -o ${RESOURCES_DIR} -r " , tool . rotation , " -t " , name ) ;
1307+ this . line ( "\tVERBATIM)" ) ;
1308+ this . line ( ) ;
12811309 }
12821310 else {
12831311 this . line ( "$(RESOURCES_DIR)" , tool . slash , target , ": " , bmpSource ) ;
@@ -1302,7 +1330,7 @@ otadata, data, ota, , ${OTADATA_SIZE},`;
13021330 var target = result . target ;
13031331 if ( result . quality !== undefined ) {
13041332 var temporary = target + result . quality ;
1305- if ( this . zephyr ) {
1333+ if ( tool . platform == " zephyr" ) {
13061334 trace ( "imageFiles" ) ;
13071335 }
13081336 else {
0 commit comments