2
0
Эх сурвалжийг харах

Tweaked mx2cc deps system - rebuildall!

Mark Sibly 7 жил өмнө
parent
commit
acc09cca39

+ 28 - 21
src/mx2cc/buildproduct.monkey2

@@ -427,25 +427,38 @@ Class GccBuildProduct Extends BuildProduct
 					Forever
 					
 					If opts.arch<>"x64" tmp+=" -arch armv7"
-					
 				Endif
 				
 				tmp+=" -MM ~q"+src+"~q >~q"+deps+"~q"
 				
 				Exec( tmp )
 				
+				Local buf:=New StringStack
+				
+				Local lines:=LoadString( deps ).Split( " \" )
+				
+				For Local i:=1 Until lines.Length
+					
+					Local line:=lines[i].Trim().Replace( "\ "," " )
+					
+					If Not line Or line=src Continue
+					
+					buf.Add( line )
+				Next
+				
+				SaveString( buf.Join( "~n" ),deps )
+				
 				uptodate=True
 				
 			Endif
 			
 			If uptodate
 			
-				Local srcs:=LoadString( deps ).Split( " \" )
-						
-				For Local i:=1 Until srcs.Length
-						
-					Local src:=srcs[i].Trim()
-					If Not src Continue
+				Local lines:=LoadString( deps ).Split( "~n" )
+				
+				For Local line:=Eachin lines
+					
+					Local src:=line
 					
 					Local time:=GetFileTime( src )
 					
@@ -488,7 +501,9 @@ Class GccBuildProduct Extends BuildProduct
 			If system( cmd+" 2>"+fstderr )
 
 				Local buf:=New StringStack
+				
 				For Local line:=Eachin LoadString( fstdout,True ).Split( "~n" )
+					
 					If Not line.StartsWith( "Note: including file:" ) buf.Add( line )
 				Next
 				
@@ -497,17 +512,13 @@ Class GccBuildProduct Extends BuildProduct
 				err+=LoadString( fstderr,True )
 				
 				Throw New BuildEx( err )
-				
 			Endif
 			
-			Local tincs:=LoadString( fstdout )
-			
 			Local buf:=New StringStack
-			buf.Push( StripDir( obj )+": "+src+" \" )
-
-			For Local line:=Eachin tincs.Split( "~n" )
-				
-				line=line.Trim()
+			
+			Local lines:=LoadString( fstdout ).Split( "~n" )
+			
+			For Local line:=Eachin lines
 				
 				If Not line.StartsWith( "Note: including file:" ) Continue
 				
@@ -517,14 +528,10 @@ Class GccBuildProduct Extends BuildProduct
 				
 				line=line.Replace( "\","/" )
 				
-				buf.Add( line+" \" )
+				buf.Add( line )
 			Next
 			
-			Local str:=buf.Join( "~n" )
-			
-'			Print "deps="+str
-			
-			SaveString( str,deps )
+			SaveString( buf.Join( "~n" ),deps )
 			
 			Return obj
 		Endif

+ 2 - 2
src/mx2cc/mx2cc.monkey2

@@ -24,9 +24,9 @@ Global opts_time:Bool
 
 Global StartDir:String
 
-Const TestArgs:="mx2cc makemods -target=ios"' monkey libc"
+'Const TestArgs:="mx2cc makemods -target=ios"' monkey libc"
  
-'Const TestArgs:="mx2cc makeapp -clean src/mx2cc/test.monkey2"
+Const TestArgs:="mx2cc makeapp -clean src/mx2cc/test.monkey2"
 
 Function Main()
 	

+ 1 - 31
src/mx2cc/test.monkey2

@@ -1,36 +1,6 @@
 Namespace test
 
-#Reflect test
-
-Enum E
-	A,B,C
-End
-
-Global G:E
-
 Function Main()
 	
-	Print Typeof<E>
-
-	Local e:=E.A
-	
-	Print Typeof( e )
-	
-	Local type:=Typeof( e )
-	
-	For Local decl:=Eachin type.GetDecls()
-		
-		Local e:=decl.Get( Null )
-		
-		Print decl.Name+"="+e.EnumValue
-	
-	Next
-	
-	Local g:=TypeInfo.GetType( "test" ).GetDecl( "G" )
-	
-	g.Set( Null,type.MakeEnum( E.A ) )
-	Print g.Get( Null ).EnumValue
-
-	g.Set( Null,type.MakeEnum( 2 ) )
-	Print g.Get( Null ).EnumValue
+	Print "Hello world"
 End