-
Notifications
You must be signed in to change notification settings - Fork 1
Build system
Jazda uses an extremely simple buildsystem: main.c
includes all .c files it uses. This might not be a "real" build system, but it's sufficient for current use.
- Linux
- avrdude
- gcc
- avr-libc
- Unix shell
If you're using Windows, you can use Linux on a virtual machine to create the .hex file and then flash the microcontroller from Windows.
Building is combined with flashing. If you only need the .hex file though, you can leave your controller disconnected. Use the same commands to flash example files - just change main.c
.
-
Place AtMega8 chip in the programmer
-
Connect the programmer to the computer
-
Execute the following comands, replace
usbasp
with your programmer name (look for it in avrdude manual):cd src sh ../build.sh usbasp m8 main.c
This will create
main.c.hex
file for flashing,main.c.obj
intermediate file andmain.c.disasm
assembly file. If you had your programmer connected,main.c.hex
will start uploading.
The most important reason is that the simple buildsystem works just fine.
- it already works
- files not included thanks to #ifdefs are not compiled and may be broken without a problem
- easier to use C than make language for including files
- whole program optimizations for free
- less header files
- files can have private namespaces
- bettert separation of functionality
- more standardized
- shorter compilation (not really a problem)
Regardless, all modules, sensors and builtins should #include every header file they refer to, as if make was used. In the depths of internal subsystems, header files are not used and every .c file is simply #included.