Suppose your source files are called
- prog1.c
- prog2.c
- mylib.c
- mylib.h
where prog1.c and prog2.c contain the main () function, and mylib.c (with the corresponding header file mylib.h) contains some library functions that must be associated with each program. In the Code :: Blocks project, you need to create several goals. From the menu, select "File / Create / Create Target ..." and name them "prog1" and "prog2". Now add all the source files to the project (if you have not already done so).
Now right-click on prog1.c and select "Properties ..." in the context menu. In the dialog box, select the "Create" tab and make sure that only "prog1" is checked in the "Belongs to targeting" section. Do the same with prog2.c and the target "prog2". For "mylib.c", make sure that both "prog1" and "prog2" are checked.
Now you can easily select in the user interface, which creates a target for assembly and launch. Note that if you add another target, say, βprog3β, you need to go back to the assembly properties of prog1.c and prog2.c and uncheck βprog3β.
source share