User forums > Help
How to convert Makefile to Code::Blocks project
(1/1)
umen:
i have a simple makefile that looks like this :
--- Code: ---all:
gcc fno-stack-protector -static -O2 test.c test1.S -o test.elf
--- End code ---
i created project in C::B
i set build target to test.c test1.S and added in other compiler option :fno-stack-protector
but no matter what i do the compiler flags as not like in the make file
the build log looks like this :
--- Code: ---g++ -o bin/Debug/payload obj/Debug/test.o obj/Debug/test1.o -static
--- End code ---
1 . why it is configured to use g++ Although i set gcc
2. how to make C::B to be as my make file ?
oBFusCATed:
1. Search for "custom makefile project" on the wiki and in the forum.
2. If you want to use the C::B's build system, you'll have to read this: http://wiki.codeblocks.org/index.php/Adding_support_for_non_C/C%2B%2B_files_to_the_build_system
3. Are you using 20.03? There the g++ problem is fixed.
umen:
1 . Thanks, i found the answer here : and it compiles great ( replace all with debug in the make file .. )
https://stackoverflow.com/questions/28542408/how-use-a-makefile-with-codeblocks
but when i try to debug it I'm getting (added -g)
--- Code: ---gcc -g -fno-stack-protector -static -O2 test.c test1.S -o test.elf
--- End code ---
Active debugger config: GDB/CDB debugger:Default
Building to ensure sources are up-to-date
Selecting target:
Debug
Adding source dir: /home/vagrant/example/
Adding source dir: /home/vagrant/example/
Adding file: /home/vagrant/example/bin/Debug/example
Changing directory to: /home/vagrant/example/.
Set variable: LD_LIBRARY_PATH=.:
Starting debugger: /usr/bin/gdb -nx -fullname -quiet -args /home/vagrant/example/bin/Debug/example
Setting SHELL to '/bin/sh'
done
Setting breakpoints
Debugger name and version: GNU gdb (Ubuntu 9.2-0ubuntu1~20.04) 9.2
Starting the debuggee failed: No executable file specified.
Debugger finished with status 0
3 . yes I'm using 20.3 , what fix you talking about ?
oBFusCATed:
3. Project -> Build options -> Linker settings -> Linker executable -> Auto detect.
For the debugger. Please post the full debugger log. Are you able to run your project? Are the executable and work dir paths setup correctly in Project -> Properties?
Navigation
[0] Message Index
Go to full version