User forums > Using Code::Blocks
Custom makefile problems
tomasbym:
Hello everybody,
I am having troubles with compiling my project in CB. I have a directory SRC with all the source files and makefile. There is a subdirectory MAKE with makefiles (makefile.type) with different setting. When I compile the project from terminal in SRC I just type make type where type refers to one of the file in the MAKE directory.
In CB I put the project to the SRC directory, in compiling options checked the use custom make file. I am sure that for compiling I need to add the custom variables, but don't know how exactly. In the build/target project variables I have $make -f $makefile $target. I ve tried many ways how nad where to write type but without any success.
Any help would be really appreciated,
Thanks Tomas
Jenna:
It should work if you use "type" as target-name.
You can copy or rename the standard targets in "Project -> Properties -> Build targets".
And thee chose the correct target from the dropdown-list in the compiler toolbar.
tomasbym:
Thank you for you reply,
I changed the target to type and now the project compiles even though I got errors during compiling but the program is running. But unfortunately I am still having some problems
1) I can no run the program but cannot debug it - i.e. it doesn't stop on my breakpoints
2) I execute the program from command line like program <inputfile , where program is the generated program and inputfile is the file with the input for the program. Is there any way how to run it from CB so that is reads the specific inputfile? I can change the source code, but it is not very convenient as I still would like to have option to run it the normal way from terminal.
3) I am not able to run the clean command from CB. It is not a big problem as I can still do it from terminal with make clean-all or make clean-type but I am sure there is an option to do it from CB.
Thanks you once again for your help. Question number 1 is the most important the other two are not that crucial.
Tomas
oBFusCATed:
1. Have you tried the debugger's nightly?
3. You can modify all make commands that are executed. It is in project -> build options or project -> properties, it is one of the last tabs and in most cases it is not visible.
Jenna:
--- Quote from: tomasbym on March 18, 2011, 01:30:20 pm ---Thank you for you reply,
I changed the target to type and now the project compiles even though I got errors during compiling but the program is running. But unfortunately I am still having some problems
1) I can no run the program but cannot debug it - i.e. it doesn't stop on my breakpoints
2) I execute the program from command line like program <inputfile , where program is the generated program and inputfile is the file with the input for the program. Is there any way how to run it from CB so that is reads the specific inputfile? I can change the source code, but it is not very convenient as I still would like to have option to run it the normal way from terminal.
3) I am not able to run the clean command from CB. It is not a big problem as I can still do it from terminal with make clean-all or make clean-type but I am sure there is an option to do it from CB.
Thanks you once again for your help. Question number 1 is the most important the other two are not that crucial.
Tomas
--- End quote ---
1. Do the makefiles set the -g option to create debugging-symbols ?
2. "Project -> Set programs's arguments.."
3. You have to fix the appropriate make-command in the projects/targets "Build options -> 'Make' arguments" for the cleaning process (in your case most likely a "-" between clean and $target .
Navigation
[0] Message Index
[#] Next page
Go to full version