gabonator / DS203

DS203 quad oscilloscope firmware compatible with gcc
http://www.valky.eu/?data/hardware/ds203.txt
289 stars 86 forks source link

Common build for all platforms? #18

Open krist10an opened 11 years ago

krist10an commented 11 years ago

Hey Gabriel,

Great work on the DS203 firmware, I like it much better than the stock firmware!

As you've seen, I got it compiling on Linux, but now I have some questions for further development:

I think I can replace all the makefiles with one common makefile that works on all platforms, but that requires that you are interested in using it on Windows and verify that it works correctly. (I see that you already have make.exe installed from your testing scripts). The main benefit of it is that you can compile several files in parallel. In my testing on Linux it shortens the build time from ~50 seconds to ~10 seconds.

If you are interested, how would you organize the build folders? Output and object files in Bin/ Makefile in Build/Makefile?

Let me know :-)

gabonator commented 11 years ago

hmmm, I don't know whether I want to go this way. For now it is nice, that even beginner programmer can download the git repository, then the toolchain and that's all. You don't need any other support utilities, you just need to set the path to gcc toolchain and the bat script handles all the compiling and uploading stuff. I was thinking about making it even more simple - so that the bat script automatically downloads and decompresses the toolchain. But the reduction of compile time you are mentioning sounds very good... Anyway, we can still provide both win32 scripts in the build folder - and probably the script could identify whether the makefile tools are available on the computer, and in case they are, the improved script should be used instead of the older. The only thing I would like to change in the directory structure is that the object files (.o, .d) would be in different folder (e.g. /Intermediate) as the hex, elf and bin (/Bin). Just organize it as you like it. And I am ready to test your makefile scripts :) But I dont have cygwin nor msys, I have only downloaded some standalone win32 build of make utility and that's all, so I hope you will not use some special linux tools like grep/sed/regex :) And... I know that the building time could be improved by using incremental builds (compiling only the changed source files and then linking all together), but I was having some issues with this and decided to delete all the intermediate object files before the compilation starts.

krist10an commented 11 years ago

Sure, then I won't do any changes that will break the build.mk file so your original batch files still work then.

I am using the build.mk file and have both incremental and parallel compilation working in my attempt. And it only uses make and no sed/grep etc :+1: https://github.com/krist10an/DS203/blob/linuxfix2/Build/arm_linux/Makefile

I'll split the file into some reusable parts and some arch specific parts (after thinking about it I think one common makefile might not work). For me it is the most logical if the elf/hex file end up in the same folder as the Makefile, so my suggestion is to put .o/.d files in Bin/ and keep result in Build//APPxx.elf. However, I can use a Build/Intermediate and move the result to Bin/, whatever you want.

krist10an commented 11 years ago

Come to think of it, I'll just make the folders configurable :smiley:

krist10an commented 11 years ago

I now have a suggestion which you can test here: https://github.com/krist10an/DS203/blob/linuxfix2/Build/arm_win32/Makefile

Changes here: https://github.com/krist10an/DS203/compare/linuxfix2

It looks a bit strange that both mac and windows just include the linux version, so I should probably move the code a round a little.

Let me know if it works on your computer.