ソースを参照

Non bmx object files now have a prefix applied to make them more unique.
cleanmods now removes all .bmx subdirs.

woollybah 5 年 前
コミット
dbd8ce01e5
4 ファイル変更50 行追加6 行削除
  1. 5 0
      CHANGELOG
  2. 22 3
      bmk.bmx
  3. 1 1
      bmk_config.bmx
  4. 22 2
      bmk_make.bmx

+ 5 - 0
CHANGELOG

@@ -1,3 +1,8 @@
+## [3.41] - 2019-12-21
+### Changed
+ - Non bmx object files now have a prefix applied to make them more unique.
+ - cleanmods now removes all .bmx subdirs.
+
 ## [3.40] - 2019-09-02
 ### Added
  - New '-gprof' option for gprof profiling support.

+ 22 - 3
bmk.bmx

@@ -191,10 +191,10 @@ Function CleanModules( args$[] )
 
 		Local path$=ModulePath(name)
 
-		DeleteDir path+"/.bmx",True
-
+		CleanBmxDirs(path)
+		Rem
 		If Not opt_kill Continue
-
+		
 		For Local f$=EachIn LoadDir( path )
 
 			Local p$=path+"/"+f
@@ -213,10 +213,29 @@ Function CleanModules( args$[] )
 			End Select
 
 		Next
+		End Rem
 	Next
 
 End Function
 
+Function CleanBmxDirs(path:String)
+		Local bmx:String = path + "/.bmx"
+		If FileType(bmx) = FILETYPE_DIR Then
+			If opt_verbose Then
+				Print "  Deleting " + bmx
+			End If
+			DeleteDir bmx,True
+		End If
+		
+		For Local f:String = EachIn LoadDir( path )
+			Local p:String = path + "/" + f
+			Select FileType(p)
+				Case FILETYPE_DIR
+					CleanBmxDirs(p)
+			End Select
+		Next
+End Function
+
 Function MakeApplication( args$[],makelib:Int,compileOnly:Int = False )
 
 	If opt_execute And Not compileOnly

+ 1 - 1
bmk_config.bmx

@@ -10,7 +10,7 @@ Import brl.map
 
 Import "stringbuffer_core.bmx"
 
-Const BMK_VERSION:String = "3.40"
+Const BMK_VERSION:String = "3.41"
 
 Const ALL_SRC_EXTS$="bmx;i;c;m;h;cpp;cxx;mm;hpp;hxx;s;cc;asm;S"
 

+ 22 - 2
bmk_make.bmx

@@ -1084,10 +1084,11 @@ Type TBuildManager Extends TCallback
 							sp = ConcatString(ExtractDir(source_path), "/.bmx/", StripDir(source_path), opt_configmung, processor.CPU())
 						End If
 						
-						source.obj_path = sp + ".o"
-						source.obj_time = FileTime(source.obj_path)
 						
 						If Match(ext, "bmx") Then
+							source.obj_path = sp + ".o"
+							source.obj_time = FileTime(source.obj_path)						
+
 							source.iface_path = sp + ".i"
 							source.iface_path2 = source.iface_path + "2"
 							source.iface_time = FileTime(source.iface_path2)
@@ -1104,6 +1105,9 @@ Type TBuildManager Extends TCallback
 								Local p:String = sp + ".s"
 								source.gen_time = FileTime(p)
 							End If
+						Else
+							source.obj_path = PPFix(sp) + ".o"
+							source.obj_time = FileTime(source.obj_path)						
 						End If
 					Else
 						source.isInclude = True
@@ -1114,6 +1118,22 @@ Type TBuildManager Extends TCallback
 		
 		Return source
 	End Method
+	
+	Method PPFix:String(path:String)
+		Local dir:String = ExtractDir(ExtractDir(path))
+		Local s:String
+		For Local i:Int = 0 Until 3
+			Local t:String = StripDir(dir)
+			If Not t Then
+				t = "x"
+			End If
+			s = t[..1] + s
+			
+			dir = ExtractDir(dir)
+		Next
+
+		Return ExtractDir(path) + "/" + s + "_" + StripDir(path)
+	End Method
 
 	Method GetISourceFile:TSourceFile(arc_path:String, arc_time:Int, iface_path:String, iface_time:Int, merge_path:String, merge_time:Int)
 		Local source:TSourceFile