leadwerks.bmxcleanup

BlitzMax Forums/BlitzMax Programming/leadwerks.bmxcleanup

JoshK(Posted 2007) [#1]
Easier and safer:
Module leadwerks.bmxcleanup
Import brl.filesystem
DeleteDir ".bmx",1



N(Posted 2007) [#2]
I don't know why you'd do that, it'll only increase your build time.


JoshK(Posted 2007) [#3]
Is that something used for fast build? I never use fast build.


N(Posted 2007) [#4]
.bmx/ stores compiled object files. If source code has not been modified, it uses the object file stored in .bmx/ rather than needlessly rebuilding the old object file. Given your past tendency to use Include rather than Import and this unusual habit of deleting .bmx/ every run, I guess it would fit your style rather well, however.


JoshK(Posted 2007) [#5]
You mean importing .bmx source files, not modules, right? What is the advantage to doing that?


TaskMaster(Posted 2007) [#6]
When you include a file, it gets compiled with the file it is included with. When you import, the code from the imported file does not need to be compiled unless it changes.

For example, if you had FileA, and it included FileB and FileC, if you changes something in FileA, then FileA, FileB, and FileC all need to be compiled into FileA.

If FileA imported FileB and FileC, when you change FileA, only FileA gets compiled. FileB and FileC will only be compiled if something changes in them.


JoshK(Posted 2007) [#7]
But imported source code is treated like a module...so it can't be used if you have a source code where files cross-reference each other a lot.


xMicky(Posted 2007) [#8]
When you import, the code from the imported file does not need to be compiled unless it changes.

I thought, if I set "Build options: quick build" the result is as described above even if I use "Include" instead of "Import". Is that wrong ?


Ziltch(Posted 2007) [#9]
xMicky, That is what I thought as well.


ziggy(Posted 2007) [#10]
@Leadwerks: Yes, imported code doesn't understand cross referencing, it acts like a module, so you may think of imported files like pre-compiled stand alone librarys or something like that. cross referencing is only allowed on included files. In fact, importing a module is the same as importing a BMX file, the only diference I see is that when importing a module, you don't have to tell the compiler the location of the file as it is able to locate the file using the module server and module name. Apart from this, as long as I know, it is the same.