@@ -78,23 +78,27 @@ def sanity_check_target():
78
78
err = "ERROR: Config files found in directory %s. Please move them into the Marlin subfolder." % p
79
79
raise SystemExit (err )
80
80
81
+ #
82
+ # Find the name.cpp.o or name.o and remove it
83
+ #
84
+ def rm_ofile (subdir , name ):
85
+ build_dir = os .path .join (env ['PROJECT_BUILD_DIR' ], build_env );
86
+ for outdir in [ build_dir , os .path .join (build_dir , "debug" ) ]:
87
+ for ext in [ ".cpp.o" , ".o" ]:
88
+ fpath = os .path .join (outdir , "src" , "src" , subdir , name + ext )
89
+ if os .path .exists (fpath ):
90
+ os .remove (fpath )
91
+
81
92
#
82
93
# Give warnings on every build
83
94
#
84
- build_dir = os .path .join (env ['PROJECT_BUILD_DIR' ], build_env );
85
- for outdir in [ build_dir , os .path .join (build_dir , "debug" ) ]:
86
- for wext in [ ".cpp" , "" ]:
87
- warnfile = os .path .join (outdir , "src" , "src" , "inc" , "Warnings" + wext + ".o" )
88
- if os .path .exists (warnfile ):
89
- os .remove (warnfile )
95
+ rm_ofile ("inc" , "Warnings" )
90
96
91
97
#
92
98
# Rebuild 'settings.cpp' for EEPROM_INIT_NOW
93
99
#
94
100
if 'EEPROM_INIT_NOW' in env ['MARLIN_FEATURES' ]:
95
- setfile = os .path .join (srcpath , "module" , "settings.cpp.o" )
96
- if os .path .exists (setfile ):
97
- os .remove (setfile )
101
+ rm_ofile ("module" , "settings" )
98
102
99
103
#
100
104
# Check for old files indicating an entangled Marlin (mixing old and new code)
0 commit comments