@@ -237,28 +237,29 @@ func compileFileWithRecipe(ctx *types.Context, sourcePath *paths.Path, source *p
237
237
if err != nil {
238
238
return nil , i18n .WrapError (err )
239
239
}
240
- properties .Set (constants .BUILD_PROPERTIES_OBJECT_FILE , buildPath .JoinPath (relativeSource ).String ()+ ".o" )
240
+ depsFile := buildPath .Join (relativeSource .String () + ".d" )
241
+ objectFile := buildPath .Join (relativeSource .String () + ".o" )
241
242
242
- err = properties .GetPath (constants .BUILD_PROPERTIES_OBJECT_FILE ).Parent ().MkdirAll ()
243
+ properties .SetPath (constants .BUILD_PROPERTIES_OBJECT_FILE , objectFile )
244
+ err = objectFile .Parent ().MkdirAll ()
243
245
if err != nil {
244
246
return nil , i18n .WrapError (err )
245
247
}
246
248
247
- objIsUpToDate , err := ObjFileIsUpToDate (ctx , properties . GetPath ( constants . BUILD_PROPERTIES_SOURCE_FILE ), properties . GetPath ( constants . BUILD_PROPERTIES_OBJECT_FILE ), buildPath . Join ( relativeSource . String () + ".d" ) )
249
+ objIsUpToDate , err := ObjFileIsUpToDate (ctx , source , objectFile , depsFile )
248
250
if err != nil {
249
251
return nil , i18n .WrapError (err )
250
252
}
251
-
252
253
if ! objIsUpToDate {
253
254
_ , _ , err = ExecRecipe (ctx , properties , recipe , false /* stdout */ , utils .ShowIfVerbose /* stderr */ , utils .Show )
254
255
if err != nil {
255
256
return nil , i18n .WrapError (err )
256
257
}
257
258
} else if ctx .Verbose {
258
- logger .Println (constants .LOG_LEVEL_INFO , constants .MSG_USING_PREVIOUS_COMPILED_FILE , properties . Get ( constants . BUILD_PROPERTIES_OBJECT_FILE ) )
259
+ logger .Println (constants .LOG_LEVEL_INFO , constants .MSG_USING_PREVIOUS_COMPILED_FILE , objectFile )
259
260
}
260
261
261
- return properties . GetPath ( constants . BUILD_PROPERTIES_OBJECT_FILE ) , nil
262
+ return objectFile , nil
262
263
}
263
264
264
265
func ObjFileIsUpToDate (ctx * types.Context , sourceFile , objectFile , dependencyFile * paths.Path ) (bool , error ) {
0 commit comments