Code::Blocks gives you the choice.
1, 2 and 3 do what they pretend to do. Nothing more, nothing less.
That is, if you compile main.c cb will ask the compiler to produce a main.o
but does not call the linker.
In addition to these commands you can always use the combined ones
("save all files", "save everything", "build", "build and run" etc.).
I consider this behaviour actually a feature.
To distinguish between them is helpful, especially in larger projects:
* If you have temporarily set program arguments in your project, and
want to build and run the program several times, but do not want
the arguments to be saved in the project-file permanently. You often
do not want your version-control (eg. mercurial, git) to commit
these temporary things as changes to the project.
* If you just want to see, whether the edited file still compiles (quick) without
being forced to call the linker as well (may take significantly more time).
* Run the existing executable (from previous build) to reverify the current
behaviour before you acually compile and link the changed program.
If you have made changes to the project and are closing it you will be prompted
whether you want to save the changes.
All in all: A Project file gets updated when you tell cb to do so.